メインコンテンツへスキップ
POST
https://{tenantDomain}/api/v2
/
device-credentials
Go
package example

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

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.DeviceCredentials.CreatePublicKey(
        context.TODO(),
        &management.CreatePublicKeyDeviceCredentialRequestContent{
            DeviceName: "device_name",
            Value: "value",
            DeviceId: "device_id",
        },
    )
}
{
  "id": "dcr_0000000000000001"
}

承認

Authorization
string
header
必須

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

ボディ

device_name
string
必須

Name for this device easily recognized by owner.

Minimum string length: 1
type
enum<string>
必須

Type of credential. Must be public_key.

利用可能なオプション:
public_key
value
string
必須

Base64 encoded string containing the credential.

Minimum string length: 1
device_id
string
必須

Unique identifier for the device. Recommend using Android_ID on Android and identifierForVendor.

Maximum string length: 36
Pattern: ^[-A-Fa-f0-9]+$
client_id
string<client-id>

client_id of the client (application) this credential is for.

レスポンス

Device credentials successfully created.

id
string
デフォルト:dcr_0000000000000001
必須

The credential's identifier