Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
factors "github.com/auth0/go-auth0/management/management/guardian/factors"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &factors.SetGuardianFactorsProviderPushNotificationSnsRequestContent{}
client.Guardian.Factors.PushNotification.SetSnsProvider(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.factors.pushNotification.setSnsProvider({});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.factors.pushNotification.setSnsProvider({});
}
main();curl --request PUT \
--url https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aws_access_key_id": "wywA2BH4VqTpfywiDuyDAYZL3xQjoO40",
"aws_region": "us-west-1",
"aws_secret_access_key": "B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL",
"sns_apns_platform_application_arn": "<string>",
"sns_gcm_platform_application_arn": "urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP"
}
'import requests
url = "https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns"
payload = {
"aws_access_key_id": "wywA2BH4VqTpfywiDuyDAYZL3xQjoO40",
"aws_region": "us-west-1",
"aws_secret_access_key": "B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL",
"sns_apns_platform_application_arn": "<string>",
"sns_gcm_platform_application_arn": "urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'aws_access_key_id' => 'wywA2BH4VqTpfywiDuyDAYZL3xQjoO40',
'aws_region' => 'us-west-1',
'aws_secret_access_key' => 'B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL',
'sns_apns_platform_application_arn' => '<string>',
'sns_gcm_platform_application_arn' => 'urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aws_access_key_id\": \"wywA2BH4VqTpfywiDuyDAYZL3xQjoO40\",\n \"aws_region\": \"us-west-1\",\n \"aws_secret_access_key\": \"B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL\",\n \"sns_apns_platform_application_arn\": \"<string>\",\n \"sns_gcm_platform_application_arn\": \"urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aws_access_key_id\": \"wywA2BH4VqTpfywiDuyDAYZL3xQjoO40\",\n \"aws_region\": \"us-west-1\",\n \"aws_secret_access_key\": \"B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL\",\n \"sns_apns_platform_application_arn\": \"<string>\",\n \"sns_gcm_platform_application_arn\": \"urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP\"\n}"
response = http.request(request)
puts response.read_body{
"aws_access_key_id": "wywA2BH4VqTpfywiDuyDAYZL3xQjoO40",
"aws_region": "us-west-1",
"aws_secret_access_key": "B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL",
"sns_apns_platform_application_arn": "<string>",
"sns_gcm_platform_application_arn": "urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP"
}SNSを更新
AWS SNS プッシュ通知プロバイダーの設定を構成します(サブスクリプションが必要)。
PUT
https://{tenantDomain}/api/v2
/
guardian
/
factors
/
push-notification
/
providers
/
sns
Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
factors "github.com/auth0/go-auth0/management/management/guardian/factors"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &factors.SetGuardianFactorsProviderPushNotificationSnsRequestContent{}
client.Guardian.Factors.PushNotification.SetSnsProvider(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.factors.pushNotification.setSnsProvider({});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.factors.pushNotification.setSnsProvider({});
}
main();curl --request PUT \
--url https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aws_access_key_id": "wywA2BH4VqTpfywiDuyDAYZL3xQjoO40",
"aws_region": "us-west-1",
"aws_secret_access_key": "B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL",
"sns_apns_platform_application_arn": "<string>",
"sns_gcm_platform_application_arn": "urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP"
}
'import requests
url = "https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns"
payload = {
"aws_access_key_id": "wywA2BH4VqTpfywiDuyDAYZL3xQjoO40",
"aws_region": "us-west-1",
"aws_secret_access_key": "B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL",
"sns_apns_platform_application_arn": "<string>",
"sns_gcm_platform_application_arn": "urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'aws_access_key_id' => 'wywA2BH4VqTpfywiDuyDAYZL3xQjoO40',
'aws_region' => 'us-west-1',
'aws_secret_access_key' => 'B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL',
'sns_apns_platform_application_arn' => '<string>',
'sns_gcm_platform_application_arn' => 'urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aws_access_key_id\": \"wywA2BH4VqTpfywiDuyDAYZL3xQjoO40\",\n \"aws_region\": \"us-west-1\",\n \"aws_secret_access_key\": \"B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL\",\n \"sns_apns_platform_application_arn\": \"<string>\",\n \"sns_gcm_platform_application_arn\": \"urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/guardian/factors/push-notification/providers/sns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aws_access_key_id\": \"wywA2BH4VqTpfywiDuyDAYZL3xQjoO40\",\n \"aws_region\": \"us-west-1\",\n \"aws_secret_access_key\": \"B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL\",\n \"sns_apns_platform_application_arn\": \"<string>\",\n \"sns_gcm_platform_application_arn\": \"urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP\"\n}"
response = http.request(request)
puts response.read_body{
"aws_access_key_id": "wywA2BH4VqTpfywiDuyDAYZL3xQjoO40",
"aws_region": "us-west-1",
"aws_secret_access_key": "B1ER5JHDGJL3C4sVAKK7SBsq806R3IpL",
"sns_apns_platform_application_arn": "<string>",
"sns_gcm_platform_application_arn": "urn://yRMeBxgcCXh8MeTXPBAxhQnm6gP6f5nP"
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
Required string length:
1 - 1000Required string length:
1 - 1000Pattern:
^(?:us-east-[0-9]{1,2}|us-west-[0-9]{1,2}|ap-southeast-[0-9]{1,2}|ap-northeast-[0-9]{1,2}|ap-central-[0-9]{1,2}|eu-west-[0-9]{1,2}|eu-central-[0-9]{1,2})$Required string length:
1 - 1000Required string length:
1 - 1000Required string length:
1 - 1000レスポンス
AWS SNS の設定が正常に更新されました。
Required string length:
1 - 1000Required string length:
1 - 1000Pattern:
^(?:us-east-[0-9]{1,2}|us-west-[0-9]{1,2}|ap-southeast-[0-9]{1,2}|ap-northeast-[0-9]{1,2}|ap-central-[0-9]{1,2}|eu-west-[0-9]{1,2}|eu-central-[0-9]{1,2})$Required string length:
1 - 1000Required string length:
1 - 1000Required string length:
1 - 1000⌘I