Communication Identity - Create
新しい ID と、必要に応じてアクセス トークンを作成します。
POST {endpoint}/identities?api-version=2023-10-01
URI パラメーター
名前 | / | 必須 | 型 | 説明 |
---|---|---|---|---|
endpoint
|
path | True |
string |
通信リソース (例: https://my-resource.communication.azure.com |
api-version
|
query | True |
string |
呼び出す API のバージョン。 |
要求本文
名前 | 型 | 説明 |
---|---|---|
createTokenWithScopes |
また、作成された ID のアクセス トークンも作成します。 |
|
expiresInMinutes |
integer (int32) minimum: 60maximum: 1440 |
[60,1440] 分の範囲内のトークンのカスタム有効期間 (省略可能)。 指定しない場合は、既定値の 1440 分 (24 時間) が使用されます。 |
応答
名前 | 型 | 説明 |
---|---|---|
201 Created |
Created - 作成された ID を返します。 |
|
Other Status Codes |
エラー |
例
Create an Identity and optionally an access token with custom expiration time within the [60-1440] minutes range. If expiration time is not specified, the default value of 1440 minutes (24 hours) will be used.
要求のサンプル
POST https://my-resource.communication.azure.com/identities?api-version=2023-10-01
{
"createTokenWithScopes": [
"chat",
"voip",
"chat.join",
"chat.join.limited",
"voip.join"
],
"expiresInMinutes": 60
}
応答のサンプル
{
"identity": {
"id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081"
},
"accessToken": {
"token": "token",
"expiresOn": "2023-10-10T21:39:39.3244584+00:00"
}
}
定義
名前 | 説明 |
---|---|
Communication |
Communication Services エラー。 |
Communication |
Communication Services エラー。 |
Communication |
通信 ID。 |
Communication |
アクセス トークン。 |
Communication |
アクセス トークンを使用した通信 ID。 |
Communication |
|
Communication |
アクセス トークンのスコープの一覧。 |
CommunicationError
Communication Services エラー。
名前 | 型 | 説明 |
---|---|---|
code |
string |
エラー コード。 |
details |
このエラーの原因となった特定のエラーの詳細。 |
|
innererror |
内部エラーがある場合。 |
|
message |
string |
エラー メッセージ。 |
target |
string |
エラーターゲット。 |
CommunicationErrorResponse
Communication Services エラー。
名前 | 型 | 説明 |
---|---|---|
error |
Communication Services エラー。 |
CommunicationIdentity
通信 ID。
名前 | 型 | 説明 |
---|---|---|
id |
string |
ID の識別子。 |
CommunicationIdentityAccessToken
アクセス トークン。
名前 | 型 | 説明 |
---|---|---|
expiresOn |
string (date-time) |
トークンの有効期限。 |
token |
string |
ID に対して発行されたアクセス トークン。 |
CommunicationIdentityAccessTokenResult
アクセス トークンを使用した通信 ID。
名前 | 型 | 説明 |
---|---|---|
accessToken |
アクセス トークン。 |
|
identity |
通信 ID。 |
CommunicationIdentityCreateRequest
名前 | 型 | 規定値 | 説明 |
---|---|---|---|
createTokenWithScopes |
また、作成された ID のアクセス トークンも作成します。 |
||
expiresInMinutes |
integer (int32) minimum: 60maximum: 1440 |
1440 |
[60,1440] 分の範囲内のトークンのカスタム有効期間 (省略可能)。 指定しない場合は、既定値の 1440 分 (24 時間) が使用されます。 |
CommunicationIdentityTokenScope
アクセス トークンのスコープの一覧。
値 | 説明 |
---|---|
chat |
これは、チャット API へのフル アクセスに使用します。 |
chat.join |
チャット スレッドを作成、削除、または更新する権限を持たないチャット API へのアクセス。 |
chat.join.limited |
参加者の追加または削除を許可しない、より限定的なバージョンの chat.join。 このスコープは、ゲスト シナリオなど、トークン ベアラーが完全に信頼されていない場合に使用します。 |
voip |
呼び出し元 API へのフル アクセスには、これを使用します。 |
voip.join |
呼び出し元 API にアクセスしますが、新しい呼び出しを開始する権限がありません。 |