Enable/Disable Deliveries via REST API
In order to enable/disable your deliveries via the REST API, first you'll need to set up your API key.
Head to the Admin tab > Tech Hub > REST API to get started:
Step 1) Select Add new API Key and choose the type of key you need to update (Administrator for enabling/disabling deliveries)
Step 2) Set the permissions of the REST API key. For enabling and disabling deliveries via the REST API, you'll need to grant access to update deliveries.
Step 3) If you need assistance in writing the REST API post to update a lead, scroll down the page and we provide some examples you can use alongside the response you should be expecting
Step 4) Ensure you activate this API key once set up, otherwise it won't be classed as a valid key and you won't be able to use it
Performing the enablement/disablement of a delivery
Firstly, you will be posting the JSON Post to the following URL:
https://helpcentre.leadbyte.com/restapi/v1.3/deliveries/{id}
Remove {id} and replace this with the delivery ID. This can be found by navigating to the relevant delivery and finding the FID in the URL.
Use the following body to change a delivery from "Inactive" to "Active"
{ "key": "", "update": { "status": "Active" } }
Alternatively, use this body to change a delivery from "Active" to "Inactive"
{ "key": "", "update": { "status": "Inactive" } }
You will then receive the following response if successful:
{ "status": "Success", "message": "OK", "deliveries": [ { "id": 825, "success": true, "message": "Delivery updated" } ] }
Or the below if the delivery is already active/inactive:
{ "status": "Warning", "message": "OK", "deliveries": [ { "id": 825, "success": false, "message": "Delivery already active" } ] }
As always, if there are any further questions, raise a support ticket where we'll be happy to help!
Comments