C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Hooks.Secrets.CreateAsync(
id: "id",
request: new Dictionary<string, string>(){
["key"] = "value",
}
);
}
}package example
import (
context "context"
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 := map[string]any{
"key": "value",
}
client.Hooks.Secrets.Create(
context.TODO(),
"id",
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import java.util.HashMap;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.hooks().secrets().create(
"id",
new HashMap<String, String>() {{
put("key", "value");
}}
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
$client = new Management(
token: '<token>',
);
$client->hooks->secrets->create(
'id',
[
'key' => 'value',
],
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.hooks.secrets.create(
id="id",
request={
"key": "value"
},
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.hooks.secrets.create(
id: "id",
request: {
key: "value"
}
)import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.hooks.secrets.create("id", {
"key": "value",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.hooks.secrets.create("id", {
"key": "value",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/hooks/{id}/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'Add hook secrets
Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets.
POST
https://{tenantDomain}/api/v2
/
hooks
/
{id}
/
secrets
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Hooks.Secrets.CreateAsync(
id: "id",
request: new Dictionary<string, string>(){
["key"] = "value",
}
);
}
}package example
import (
context "context"
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 := map[string]any{
"key": "value",
}
client.Hooks.Secrets.Create(
context.TODO(),
"id",
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import java.util.HashMap;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.hooks().secrets().create(
"id",
new HashMap<String, String>() {{
put("key", "value");
}}
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
$client = new Management(
token: '<token>',
);
$client->hooks->secrets->create(
'id',
[
'key' => 'value',
],
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.hooks.secrets.create(
id="id",
request={
"key": "value"
},
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.hooks.secrets.create(
id: "id",
request: {
key: "value"
}
)import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.hooks.secrets.create("id", {
"key": "value",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.hooks.secrets.create("id", {
"key": "value",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/hooks/{id}/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'Autorisations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
The id of the hook to retrieve
Corps
application/jsonapplication/x-www-form-urlencoded
Hashmap of key-value pairs where the value must be a string.
Réponse
Hook secrets successfully added.
⌘I