How to update or delete REST API notification settings

  • Philababa

    2 mensajes

    Francia

    Hello,

    I am using the Delcampe REST API notification settings endpoints:

    GET /notification/settings
    POST /notification/settings

    My account currently has 7 active notification settings, all pointing to an old Google Apps Script test URL ending in `/dev`.

    I now need to replace these destinations with my production Web App URL ending in `/exec`.

    Could you please confirm the official REST API method to:

    1. Update the destination URL of an existing notification setting;
    2. Disable an existing notification setting;
    3. Delete an existing notification setting.

    In particular, could you please specify:

    * the endpoint to use;
    * the HTTP method;
    * which notification setting identifier must be supplied;
    * whether GET /notification/settings returns this identifier;
    * whether several active settings for the same notification type may coexist with different destination URLs.

    I would prefer not to create 7 additional notification settings until I know how the old `/dev` settings can be safely disabled, updated or deleted.

    Thank you.
  • @alex
    Administrador

    8 mensajes

    Bélgica

    Hello Philababa,

    Thanks for checking before creating new settings, that was the right call.

    The identifier to use is id_notification. GET /notification/settings returns it for each setting, along with type, destination and active.

    1. Update the destination URL
    There is no endpoint to modify an existing setting. To change the URL, create a new setting with POST /notification/settings (same parameters as before, with your /exec URL), then delete the old one. Note that the POST response does not return the new identifier, use GET /notification/settings again to retrieve it.

    2. Disable a setting
    use PUT /notification/{id_notification}, without a body.
    Be aware that this call toggles the status, it disables an active setting and re-enables an inactive one. The response contains the new status in the active field (0 or 1).

    3. Delete a setting
    use DELETE /notification/{id_notification}

    Regarding several settings for the same type: you can have up to 5 settings per notification type (disabled ones count toward this limit), but only one active setting per type is used when a notification is sent, and which one is not guaranteed. So if the /exec settings are created while the /dev ones are still active, notifications may keep going to /dev.

    Since you no longer need the /dev settings, we recommend deleting them rather than disabling them. Suggested procedure:
    1. POST /notification/settings for each of the 7 types, with your /exec URL
    2. GET /notification/settings to get the id_notification of the 7 /dev settings
    3. DELETE /notification/{id_notification} for each /dev setting

    Creating the new settings first avoids a gap. If you delete first, notifications sent in between will not be delivered.

    Best regards,
    Alex