Archive a widget

Didomi API allows you to create as many widgets as you need. At some point, you might want to clean the widgets list by deleting the ones you do not use anymore or those you never used.

In Didomi system, archiving a widget means actually deleting the widget.

However, depending on the widget status, we operate the deletion differently:

  • Draft: Your widget will be deleted and all information and assets you added will be deleted too.

  • Unpublished changes: Your widget will be deleted from Widgets table and a copy will be created in Archived Widgets table. Every change made between the last deployment and the deletion will be lost.

  • Published: Your widget will be deleted from Widgets table and a copy will be created in Archived Widgets table.

Delete a widget

To delete a widget, send a DELETE request on /widgets/{id}.

DELETE https://api.didomi.io/widgets/{id}?organization_id=YOUR_ORG_ID

Retrieve archived widgets

If you have published your widget once and you archive the widget, this entity will be copied in ArchivedWidgets table.

To retrieve archived widgets, send a GET request on /widgets/archived.

Note that the widget ID and the archived widget ID are equivalent.

GET https://api.didomi.io/widgets/archived?organization_id=YOUR_ORG_ID

[
    {
        /**
        * Archived widget ID and widget ID are equivalent.
        */
        "id": "String",
        "created_at": "Date",
        "updated_at": "Date",
        "name": "String",
        "widget_created_at": "Date",
        "organization_id": "String",
        "format": "String",
        "last_domain_used": "String",
        "template_id": "Enum"
    }
]

Optional query parameters:

  • widget_id: ID of a widget

  • $limit: number of max results to return

  • $skip: Number of results to skip

  • $sort: represents sorting options. Accepts date properties to sort (created_at, updated_at) as keys and -1 or 1 for sort direction as value.

    • $sort[created_at]=1 or -1

    • $sort[updated_at]=1 or -1

Retrieve an archived widget

To retrieve archived widgets, send a GET request on /widgets/archived/{id}.

GET https://api.didomi.io/widgets/archived/{id}?organization_id=YOUR_ORG_ID

{
    /**
    * Archived widget ID and widget ID are equivalent.
    */
    "id": "String",
    "created_at": "Date",
    "updated_at": "Date,
    "name": "String",
    "widget_created_at": "Date",
    "organization_id": "String",
    "format": "String",
    "last_domain_used": "String",
    "template_id": "Enum"
}

Widget configurations are kept safe in deployments table. To access the configuration, fetch the deployments and search for the latest with the archived widget ID.

Last updated