メインコンテンツへスキップ
PATCH
https://{tenantDomain}/api/v2
/
hooks
/
{id}
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.UpdateHookRequestContent{}
    client.Hooks.Update(
        context.TODO(),
        "id",
        request,
    )
}
{
  "dependencies": {},
  "enabled": true,
  "id": "00001",
  "name": "hook",
  "script": "module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };",
  "triggerId": "<string>"
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

パスパラメータ

id
string
必須

更新する Hook の ID。

ボディ

dependencies
object

webtaskサーバーで使用される、このHookの依存関係。

enabled
boolean
デフォルト:false

この Hook を実行するか(true)、無視するか(false)。

name
string
デフォルト:my-hook

この Hook の名前。

Pattern: ^[a-zA-Z0-9]([ \-a-zA-Z0-9]*[a-zA-Z0-9])?$
script
string
デフォルト:module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };

この Hook の実行時に実行されるコード。

Minimum string length: 1

レスポンス

Hook を正常に作成しました。

dependencies
object

webtaskサーバーで使用される、このHookの依存関係。

enabled
boolean
デフォルト:true

この Hook を実行するか(true)、無視するか(false)。

id
string
デフォルト:00001

この Hook の ID。

name
string
デフォルト:hook

この Hook の名前。

script
string
デフォルト:module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };

この Hook の実行時に実行されるコード。

triggerId
string

トリガー ID