Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Set the Authorization header to the value Bearer <token>, replacing <token> with the API access token belonging to your organization.

  2. Construct a GraphQL query using the registerWebhook mutation:

    Code Block
    languagegraphql
    mutation registerWebhook ($url: String!) {
        registerWebhook (url: $url) {
            id
            url
            createdAt
            lastUpdatedAt
        }
    }

  3. Construct a JSON object containing the GraphQL variables for the query created in the previous step:

    Code Block
    languagejson
    {
      "url": "https://example.com/webhooks"
    }

  4. Send a POST request to https://api.respondflow.com/graphql with the GraphQL query and variables in the request body. We recommend using a GraphQL client library in the language of your choice to construct and send GraphQL API requests.

    For example, to send the above GraphQL request using curl:

    Code Block
    curl --location --request POST 'https://api.respondflow.com/graphql' \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data-raw '{"query":"mutation registerWebhook ($url: String!) {\n    registerWebhook (url: $url) {\n        id\n        url\n        createdAt\n        lastUpdatedAt\n    }\n}","variables":{"url":"https://example.com/webhooks"}}'


    Once a webhook is registered, you should receive POST requests containing webhook notification event data related to your SMS messages.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#DEEBFF

Troubleshooting

Our server expects to receive a status code 200 from a successful POST request to the registered url, otherwise you will receive this error

Error from GraphQL API: webhook failed to respond successfully

🛠  Example webhook payloads

...