メインコンテンツへスキップ
GET
https://{tenantDomain}/api/v2
/
rules
/
{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.GetRuleRequestParameters{
        Fields: management.String(
            "fields",
        ),
        IncludeFields: management.Bool(
            true,
        ),
    }
    client.Rules.Get(
        context.TODO(),
        "id",
        request,
    )
}
{
  "enabled": true,
  "id": "con_0000000000000001",
  "name": "rule_1",
  "order": 1,
  "script": "function (user, context, callback) {\n  callback(null, user, context);\n}",
  "stage": "login_success"
}

承認

Authorization
string
header
必須

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

パスパラメータ

id
string
必須

取得する Rule の ID。

クエリパラメータ

fields
string

結果に含める、または除外するフィールドのカンマ区切りリスト(include_fields に指定した値に基づく)。すべてのフィールドを取得するには空のままにします。

include_fields
boolean

指定したフィールドを含めるか(true)、除外するか(false)を指定します。

レスポンス

Rule を正常に取得しました。

enabled
boolean
デフォルト:true

この Rule が有効(true)か、無効(false)か。

id
string
デフォルト:con_0000000000000001

この Rule の ID。

name
string
デフォルト:rule_1

この Rule の名前。

order
number
デフォルト:1

他の Rules に対するこの Rule の実行順序。値が小さい Rule ほど先に実行されます。

script
string
デフォルト:function (user, context, callback) { callback(null, user, context); }

この Rule の実行時に使用されるコード。

stage
string
デフォルト:login_success

この Rule の実行ステージ。login_successlogin_failure、または pre_authorize を指定できます。