Enable/Disable Deliveries via REST API

Follow

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:

Screen Recording 2022-03-29 at 10.23.55.39 AM

Step 1) Select Add new API Key and choose the type of key you need to update (Administrator for enabling/disabling deliveries)

LeadByte - Create REST API Key and 5 more pages - Profile 1 - Microsoft_ Ed.. 2022-03-29 at 10.29.54 AM

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.

LeadByte - Create REST API Key and 4 more pages - Profile 1 - Microsoft_ Ed.. 2022-03-29 at 10.35.47 AM

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

Screen Recording 2022-03-29 at 11.24.36.00 AM

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

blobid0.png

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!

 

 

 

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments