C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Actions;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Actions.Modules.CreateAsync(
new CreateActionModuleRequestContent {
Name = "name",
Code = "code"
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.actions.types.CreateActionModuleRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().modules().create(
CreateActionModuleRequestContent
.builder()
.name("name")
.code("code")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Modules\Requests\CreateActionModuleRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->modules->create(
new CreateActionModuleRequestContent([
'name' => 'name',
'code' => 'code',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.modules.create(
name="name",
code="code",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.modules.create(
name: "name",
code: "code"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/actions/modules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"name": "<string>",
"api_version": "<string>",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"publish": true,
"secrets": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: '<string>',
name: '<string>',
api_version: '<string>',
dependencies: [{name: '<string>', version: '<string>'}],
publish: true,
secrets: [{name: '<string>', value: '<string>'}]
})
};
fetch('https://{tenantDomain}/api/v2/actions/modules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/actions/modules"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"api_version\": \"<string>\",\n \"dependencies\": [\n {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"publish\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"actions_using_module_total": 123,
"all_changes_published": true,
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"id": "<string>",
"latest_version": {
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"id": "<string>",
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"version_number": 123
},
"latest_version_number": 123,
"name": "<string>",
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"updated_at": "2023-11-07T05:31:56Z"
}Action Module を作成
actions 間で再利用できるコード用の新しい Auth0 Actions Module を作成します。
POST
https://{tenantDomain}/api/v2
/
actions
/
modules
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Actions;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Actions.Modules.CreateAsync(
new CreateActionModuleRequestContent {
Name = "name",
Code = "code"
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.actions.types.CreateActionModuleRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.actions().modules().create(
CreateActionModuleRequestContent
.builder()
.name("name")
.code("code")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Actions\Modules\Requests\CreateActionModuleRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->actions->modules->create(
new CreateActionModuleRequestContent([
'name' => 'name',
'code' => 'code',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.actions.modules.create(
name="name",
code="code",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.actions.modules.create(
name: "name",
code: "code"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/actions/modules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"name": "<string>",
"api_version": "<string>",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"publish": true,
"secrets": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: '<string>',
name: '<string>',
api_version: '<string>',
dependencies: [{name: '<string>', version: '<string>'}],
publish: true,
secrets: [{name: '<string>', value: '<string>'}]
})
};
fetch('https://{tenantDomain}/api/v2/actions/modules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/actions/modules"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"api_version\": \"<string>\",\n \"dependencies\": [\n {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"publish\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"actions_using_module_total": 123,
"all_changes_published": true,
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"id": "<string>",
"latest_version": {
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"dependencies": [
{
"name": "<string>",
"version": "<string>"
}
],
"id": "<string>",
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"version_number": 123
},
"latest_version_number": 123,
"name": "<string>",
"secrets": [
{
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"updated_at": "2023-11-07T05:31:56Z"
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
Action Moduleのソースコード。
Maximum string length:
65536Pattern:
^[^ ]*$Action Moduleの名前。
Maximum string length:
255Pattern:
^[^ ]*$モジュールのAPIバージョン。
Maximum string length:
20Pattern:
^[^ ]*$Action Moduleのnpm dependencies。
Show child attributes
Show child attributes
作成直後にモジュールを公開するかどうか。
Action Moduleに関連付けるsecrets。
Show child attributes
Show child attributes
レスポンス
action module を作成しました。
このモジュールを使用しているデプロイ済みの Actions の数。
すべてのドラフトでの変更がバージョンとして公開されているかどうか。
モジュールのドラフトバージョンのソースコード。
モジュールが作成された日時。
モジュールのドラフトバージョンに含まれる npm の依存関係。
Show child attributes
Show child attributes
モジュールの一意のID。
参照オブジェクトとしての最新の公開済みバージョン。公開済みのバージョンがない場合は省略されます。
Show child attributes
Show child attributes
最新の公開済みバージョンのバージョン番号。公開済みバージョンがない場合は省略されます。
モジュールの名前。
モジュールのドラフトバージョンに含まれる secrets(返されるのは名前とタイムスタンプのみで、値は返されません)。
Show child attributes
Show child attributes
モジュールが最後に更新された日時。
⌘I