Create a webhook.

Details

Create a webhook.

An account token or server token may be used to run this endpoint.

Parameters

body

  • ecosystemId (required): The ID of the ecosystem.
  • url (required): The URL of the webhook.
  • secret (optional): A secret token which can be used to secure the webhook.
  • description (optional): The description of the webhook.

Responses

201

  • {
    "id": "WEBHOOK-ID",
    "desription": "WEBHOOK-DESCRIPTION",
    "ecosystemId": "ECOSYSTEM-ID",
    "url": "CALLBACK-URL",
    "disabled": IS-DISABLED,
    "createdAt": "YYYY-MM-DD HH:MM:SS ENCODED"
    }

400

  • Body Parameters Missing: The standard error structure defines this error as invalid parameters, and contains all required body parameters. If this error occurs when the JSON structure of the body parameters is syntactically correct, this means that the “content-type” header is incorrectly specified. The content-type header should be “application/json.”
  • Ecosystem Invalid: The standard error structure defines this error as invalid parameters, with an invalid ID linked to the parameter that designates the ecosystem ID. In this context, it means that the ID given for an ecosystem was not valid.
  • Ecosystem Missing: The standard error structure defines this error as both an invalid parameter name and a missing parameter. In this context, it means that the parameter which is used to specify an ecosystem ID is not present.
  • Webhook Callback Invalid: This error means that the URI for the webhook callback was not formatted properly.
  • Webhook Callback Missing: The standard error structure defines this error as invalid parameters. In this context, it means that the URL for a webhook callback is missing, and was required.

404

  • Ecosystem Not Found: This error means that an ecosystem with the given ID was not found. This is distinct from an invalid ecosystem ID being specified; this means that the ecosystem ID once existed, but no longer does.

Examples

HTTP

POST https://ioe.droplit.io/api/webhooks HTTP/1.1
authorization: TOKEN
content-type: application/json
{
    "ecosystemId": "ECOSYSTEM-ID",
    "url": "CALLBACK-URL"
}

Droplit Console

droplit webhook create CALLBACK-URL --ecosystemId ECOSYSTEM-ID

Droplit SDK

droplit.webhooks.create("ECOSYSTEM-ID", "CALLBACK-URL");

🚧

WARNING

The optional parameters of secret and description are not supported by the SDK during creation.

Language
Authorization
Header
Click Try It! to start a request and see the response here!