Pular para o conteúdo principal

Webhook configs

Publicado em 26 de junho de 2019· Atualizado em 23 de janeiro de 2023

Cover image for: Webhook configs

The webhook config resource is used by the API to send events to your webhook receiver.

An organisation can have a default webook config which is used by all keys within that organisation that don't specify a webhook config of their own.

Attributes

nametypedescription
idwebhook config IDResource identifier.
resourcestring, always webhook_configResource type specifier.
organisationorganisation IDThe organisation the resource belongs to.
urlstringThe url to target when sending events.
secretstringThe shared secret used to verify event signatures.
statestringOne of: new, valid, invalid, deactivated.
date_createddatetimeWhen the resource was created.

Secret

When a webhook config is created, a secret will be generated alongside it that will be used to sign events sent by the API. It is highly recommended that you implement your webhook receiver to verify the signature of incoming events using this secret. For more details on the signature verification procedure see the webhook configuration docs.

States

  • new has just been created or recently updated but not yet tested.
  • valid has passed validation and is ready to be used. An organisation must have at least one webhook config in this state in order to be useable.
  • invalid has failed the validation test. Must be updated or retested.
  • deactivated has been turned off by the owning organisation.

Create POST /configs/webhook

This action will create a webhook_config.test task in order to validate the endpoint details. If the webhook receiver is not yet setup, this test will likely fail and set the config to the invalid state. However, the config can always be re-tested using the test action.

Parameters

nametypedescription
urlrequiredThe URL of your webhook receiver.

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://www.mywebhook.com/webhooks/"
}'

Using ricloud-py

import ricloud

webhook_config = ricloud.WebhookConfig.create(url='https://www.mywebhook.com/webhooks/')

Retrieve GET /configs/webhook/{webhook_config ID}

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook/<webhook_config ID> \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

webhook_config = ricloud.WebhookConfig.retrieve(<webhook_config ID>)

List GET /configs/webhook

Webhook configs in the deactivated state are hidden by default and can only be listed by explicit filtering.

Parameters

nametypedescription
statestringFilter webhook configs by their state.
date_createddatetime filterFilter by resource creation date.

Update POST /configs/webhook/{webhook_config ID}

This action will create a webhook_confg.test task in the background to validate any changes made to the config.

The state attribute can only be changed to deactivated in the case you are essentially retiring a config.

Parameters

nametypedescription
urlstringUpdate the URL.
statestringOnly to new or deactivated.

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook/<webhook_config ID> \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://www.myupdatedwebhook.com/webhooks/",
}'

Using ricloud-py

import ricloud

webhook_config = ricloud.WebhookConfig.update_with_id(
  <webhook_config ID>,
  url='https://www.myupdatedwebhook.com/webhooks/'
)

# OR

webhook_config = ricloud.WebhookConfig.retrieve(<webhook_config ID>)

webhook_config.update(url='https://www.myupdatedwebhook.com/webhooks/')

Test POST /configs/webhook/{webhook_config ID}/test

This action creates a webhook_config.test task which sends a test event using the specified configuration. The outcome of the test will update the state attribute of the webook configuration accordingly.

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook/<webhook_config ID>/test \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

test_task = ricloud.WebhookConfig.test_with_id(<webhook_config ID>)

# OR

webhook_config = ricloud.WebhookConfig.retrieve(<webhook_config ID>)

test_task = webhook_config.test()

Artigos relacionados

Precisa de ajuda?

Procuramos responder a todas as mensagens em até um dia útil.

support@reincubate.com
Logotipo do King's Award for Enterprise

King's Award for Enterprise: a Reincubate venceu quatro vezes a mais alta honraria empresarial oficial do Reino Unido, a mais recente em reconhecimento ao notável crescimento da empresa nos últimos três anos.

Nossas relações com usuários e parceiros estão no centro dos nossos valores e dos produtos que criamos. Veja nossas avaliações para saber o que eles têm a dizer sobre nós.

Certificação ISO 27001 pelo Centre for Assessment, credenciado pelo UKAS

© 2008-2026 Reincubate Ltd. Todos os direitos reservados. Registrada na Inglaterra e no País de Gales sob o nº 5189175, VAT GB151788978. Camo®, Streamlight® e Reincubate® são marcas registradas. Patentes pendentes.

Ajuda