ウェブフック設定

更新しました
Cover image for: ウェブフック設定

webhook設定リソースは、Webhookレシーバにイベントを送信するためにAPIによって使用されます。

組織はデフォルトのwebook設定を持つことができます。これは、その組織内のすべてのキーが独自のwebhook設定を指定していないために使用されます。

属性

名前タイプ説明
id webhook config ID Resource identifier.
resource string, always webhook_config Resource type specifier.
organisation organisation ID The organisation the resource belongs to.
url string The url to target when sending events.
secret string The shared secret used to verify event signatures.
state string One of: new, valid, invalid, deactivated.
date_created datetime When the resource was created.

秘密の

Webhook設定が作成されると、それと並行してシークレットが生成され、それがAPIによって送信されたイベントに署名するために使用されます。この秘密を使って入ってくるイベントの署名を検証するためにあなたのwebhook受信機を実装することを強くお勧めします。署名検証手順の詳細については、 webhook設定文書を参照してください。

  • newが作成されたばかりか、最近更新されましたが、まだテストされていません。
  • validは検証に合格し、使用する準備が整いました。組織が使用可能になるには、この状態で少なくとも1つのwebhook設定が必要です。
  • invalid 、検証、テストに失敗しました。更新または再テストする必要があります。
  • deactivatedは所有組織によってdeactivatedにされています。

POST /configs/webhook作成します

このアクションはエンドポイントの詳細を検証するためにwebhook_config.testタスクを作成します。 Webフック受信機がまだ設定されていない場合、このテストはおそらく失敗し、設定をinvalid状態に設定しinvalid 。ただし、configはテストアクションを使用していつでも再テストできます。

パラメーター

name type description
url required The URL of your webhook receiver.

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/"
}'

ricloud-pyを使う

import ricloud

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

GET /configs/webhook/{webhook_config ID}

cURLを使う

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

ricloud-pyを使う

import ricloud

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

リストGET /configs/webhook

deactivated状態のWebhook設定は、デフォルトでは非表示になっており、明示的なフィルタリングによってのみ一覧表示できます。

パラメーター

name type description
state string Filter webhook configs by their state.
date_created datetime filter Filter by resource creation date.

POST /configs/webhook/{webhook_config ID}更新してPOST /configs/webhook/{webhook_config ID}

このアクションはバックグラウンドでwebhook_confg.testタスクを作成して設定に対する変更を検証します。

あなたが本質的に設定を引退させている場合にだけ、 state属性はdeactivatedに変更することができます。

パラメーター

name type description
url string Update the URL.
state string Only to new or deactivated.

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/",
}'

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/')

テストPOST /configs/webhook/{webhook_config ID}/test

このアクションは指定された設定を使用してテストイベントを送信するwebhook_config.testタスクを作成します。テストの結果はそれに応じてwebook設定のstate属性を更新します。

cURLを使う

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

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()

どのように我々は助けることができます?

サポートチームがお手伝いします!

営業時間は月曜日から金曜日の午前9時から午後5時(GMT)です。 時間は現在 4:30 AM GMTです。

1営業日以内に、お返事を差し上げます。メールアドレスはこちら。

私たちの素晴らしいサポートチーム

この記事を改善できますか?

ユーザーからの連絡をお待ちしています。電子メールを送信したり、コメントを残したり、ツイートしたりしないでください。 @reincubate?

© 2008 - 2024 Reincubate Ltd. 無断複写・転載を禁じます。 イングランドとウェールズに登録 #5189175, VAT GB151788978. Reincubate®およびCamo®は登録商標です。 個人情報保護方針 & 条項.