Disable a Webhook
Use our API to disable a webhook.
This guide provides instructions for disabling a webhook using the Webhooks API resource, making it inactive. Once you have disabled a webhook, no new requests will be posted or added for it. If there are existing requests for a disabled (inactive) webhook in the request queue, they will be held. If the webhook is enabled (active) before a request expires, Maast will attempt to post the request again.
See Disable a Webhook in API Reference for field definitions.
Prerequisites
- See Create a Sandbox Account to sign up and log in to the Maast Manager portal.
- Follow the steps in Get Your API Credentials to save a sandbox ID and API key.
- See Authentication to format the credentials and generate your API token. (Alternatively, use the credentials as-is to test this endpoint with our 'Try It!' feature.)
- Set up a webhook endpoint (
notification_url
) on your server to listen to POST requests. See Webhooks: Configure Your Server for more information. - Use the Add a Webhook guide to create a webhook and save the
webhook_id
.
Implement
Write a PUT request. For the request endpoint, include the webhook_id
value between /webhook/
and /disable
. The resulting endpoint is /platform/webhook/{webhook_id}/disable
. See the sample code below, where the webhook_id
value is 123
:
curl --request PUT \
--url https://api-test.maast.com/platform/webhook/123/disable \
--header 'accept: application/json' \
--header 'authorization: Basic OjllZGVjMjFhMzFjMHh5ejc4OWUzMGEzNDE2YWJjMTIz' \
--header 'content-type: application/json'
Integrate
Once you have written and sent your GET request, you will receive a response like this from the Maast server:
{
"code": 0,
"data": {
"message": "Webhook Disabled"
},
"message": "Success"
}
Check the code
field in the request response: 0
confirms success. If the value is something other than 0
, check Platform API Response Codes in Reference. See Disable a Webhook in API Reference for response field definitions.
Test and Go Live
See our Test and Go Live guide to test your API integration and to start transacting with an active production account. When moving to production, you must redo the validation process for your webhooks configuration.
Validate in Production
When moving to production, you must redo the validation process for your webhooks configuration.
Updated 12 months ago