Share via


User - Create Or Update

ユーザーを作成または更新します。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}?api-version=2022-08-01
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}?notify={notify}&api-version=2022-08-01

URI パラメーター

名前 / 必須 説明
resourceGroupName
path True

string

リソース グループの名前。 名前の大文字と小文字は区別されます。

serviceName
path True

string

API Management サービスの名前。

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

ターゲット サブスクリプションの ID。

userId
path True

string

ユーザー識別子。 現在のAPI Management サービス インスタンスで一意である必要があります。

api-version
query True

string

この操作に使用する API バージョン。

notify
query

boolean

ユーザーにEmail通知を送信します。

要求ヘッダー

名前 必須 説明
If-Match

string

エンティティの ETag。 エンティティを作成する場合は必須ではありませんが、エンティティを更新する場合は必須です。

要求本文

名前 必須 説明
properties.email True

string

電子メール アドレス。 空にしないでください。値は、サービス インスタンス内で一意である必要があります。

properties.firstName True

string

名。

properties.lastName True

string

姓。

properties.appType

AppType

ユーザー作成要求を送信するアプリケーションの種類を決定します。 既定値はレガシ ポータルです。

properties.confirmation

Confirmation

新しく作成されたユーザーに送信される確認電子メールの種類を決定します。

properties.identities

UserIdentityContract[]

ユーザー ID のコレクション。

properties.note

string

管理者によって設定されたユーザーに関するオプションのメモ。

properties.password

string

ユーザー パスワード。 値が指定されていない場合は、既定のパスワードが生成されます。

properties.state

UserState

アカウントの状態。 ユーザーがアクティブかどうかを指定します。 ブロックされているユーザーは、開発者ポータルにサインインしたり、サブスクライブしている製品の API を呼び出したりできません。 既定の状態は [アクティブ] です。

応答

名前 説明
200 OK

UserContract

ユーザーが正常に更新されました。

Headers

ETag: string

201 Created

UserContract

ユーザーは正常に作成されました。

Headers

ETag: string

Other Status Codes

ErrorResponse

操作に失敗した理由を説明するエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名前 説明
user_impersonation ユーザー アカウントの借用

ApiManagementCreateUser

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512288c680b?api-version=2022-08-01

{
  "properties": {
    "firstName": "foo",
    "lastName": "bar",
    "email": "foobar@outlook.com",
    "confirmation": "signup"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512288c680b",
  "type": "Microsoft.ApiManagement/service/users",
  "name": "5931a75ae4bbd512288c680b",
  "properties": {
    "firstName": "foo",
    "lastName": "bar",
    "email": "foobar@outlook.com",
    "state": "active",
    "registrationDate": "2018-01-07T21:21:29.16Z",
    "groups": [],
    "identities": [
      {
        "provider": "Basic",
        "id": "foobar@outlook.com"
      }
    ]
  }
}
{
  "id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512288c680b",
  "type": "Microsoft.ApiManagement/service/users",
  "name": "5931a75ae4bbd512288c680b",
  "properties": {
    "firstName": "foo",
    "lastName": "bar",
    "email": "foobar@outlook.com",
    "state": "active",
    "registrationDate": "2018-01-07T21:21:29.16Z",
    "groups": [],
    "identities": [
      {
        "provider": "Basic",
        "id": "foobar@outlook.com"
      }
    ]
  }
}

定義

名前 説明
AppType

ユーザー作成要求を送信するアプリケーションの種類を決定します。 既定値はレガシ ポータルです。

Confirmation

新しく作成されたユーザーに送信される確認電子メールの種類を決定します。

ErrorFieldContract

エラー フィールド コントラクト。

ErrorResponse

エラー応答。

GroupContractProperties

グループ コントラクトのプロパティ。

GroupType

[グループの種類]。

UserContract

ユーザーの詳細。

UserCreateParameters

ユーザー作成の詳細。

UserIdentityContract

ユーザー ID の詳細。

UserState

アカウントの状態。 ユーザーがアクティブかどうかを指定します。 ブロックされているユーザーは、開発者ポータルにサインインしたり、サブスクライブしている製品の API を呼び出したりできません。 既定の状態は [アクティブ] です。

AppType

ユーザー作成要求を送信するアプリケーションの種類を決定します。 既定値はレガシ ポータルです。

名前 説明
developerPortal

string

ユーザー作成要求が新しい開発者ポータルによって送信されました。

portal

string

ユーザー作成要求は、レガシ開発者ポータルから送信されました。

Confirmation

新しく作成されたユーザーに送信される確認電子メールの種類を決定します。

名前 説明
invite

string

サインアップして登録を完了するようにユーザーを招待する電子メールを送信します。

signup

string

ユーザーが正常にサインアップしたことを確認する電子メールをユーザーに送信します。

ErrorFieldContract

エラー フィールド コントラクト。

名前 説明
code

string

プロパティ レベルのエラー コード。

message

string

プロパティ レベルエラーの人間が判読できる表現。

target

string

プロパティ名。

ErrorResponse

エラー応答。

名前 説明
error.code

string

サービスによって定義されたエラー コード。 このコードは、応答に指定された HTTP エラー コードのサブステータスとして機能します。

error.details

ErrorFieldContract[]

検証エラーが発生した場合に要求で送信される無効なフィールドの一覧。

error.message

string

人が判読できるエラーの表現。

GroupContractProperties

グループ コントラクトのプロパティ。

名前 説明
builtIn

boolean

グループが 3 つのシステム グループ (管理者、開発者、またはゲスト) のいずれかである場合は true。それ以外の場合は false。

description

string

グループの説明。 HTML 書式設定タグを含めることができます。

displayName

string

[グループ名]:

externalId

string

外部グループの場合、このプロパティには外部 ID プロバイダーのグループの ID (Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>の場合など) が含まれます。それ以外の場合、値は null です。

type

GroupType

[グループの種類]。

GroupType

[グループの種類]。

名前 説明
custom

string

external

string

system

string

UserContract

ユーザーの詳細。

名前 既定値 説明
id

string

リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

リソースの名前

properties.email

string

電子メール アドレス。

properties.firstName

string

名。

properties.groups

GroupContractProperties[]

ユーザーが参加しているグループのコレクション。

properties.identities

UserIdentityContract[]

ユーザー ID のコレクション。

properties.lastName

string

姓。

properties.note

string

管理者によって設定されたユーザーに関するオプションのメモ。

properties.registrationDate

string

ユーザー登録の日付。 日付は、ISO 8601 標準で指定されている形式 yyyy-MM-ddTHH:mm:ssZ に準拠しています。

properties.state

UserState

active

アカウントの状態。 ユーザーがアクティブかどうかを指定します。 ブロックされているユーザーは、開発者ポータルにサインインしたり、サブスクライブしている製品の API を呼び出したりできません。 既定の状態は [アクティブ] です。

type

string

リソースの型。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"

UserCreateParameters

ユーザー作成の詳細。

名前 既定値 説明
properties.appType

AppType

ユーザー作成要求を送信するアプリケーションの種類を決定します。 既定値はレガシ ポータルです。

properties.confirmation

Confirmation

新しく作成されたユーザーに送信される確認電子メールの種類を決定します。

properties.email

string

電子メール アドレス。 空にしないでください。値は、サービス インスタンス内で一意である必要があります。

properties.firstName

string

名。

properties.identities

UserIdentityContract[]

ユーザー ID のコレクション。

properties.lastName

string

姓。

properties.note

string

管理者によって設定されたユーザーに関するオプションのメモ。

properties.password

string

ユーザー パスワード。 値が指定されていない場合は、既定のパスワードが生成されます。

properties.state

UserState

active

アカウントの状態。 ユーザーがアクティブかどうかを指定します。 ブロックされているユーザーは、開発者ポータルにサインインしたり、サブスクライブしている製品の API を呼び出したりできません。 既定の状態は [アクティブ] です。

UserIdentityContract

ユーザー ID の詳細。

名前 説明
id

string

プロバイダー内の識別子の値。

provider

string

ID プロバイダー名。

UserState

アカウントの状態。 ユーザーがアクティブかどうかを指定します。 ブロックされているユーザーは、開発者ポータルにサインインしたり、サブスクライブしている製品の API を呼び出したりできません。 既定の状態は [アクティブ] です。

名前 説明
active

string

ユーザーの状態がアクティブです。

blocked

string

ユーザーがブロックされています。 ブロックされたユーザーは、開発者ポータルで認証したり、API を呼び出したりすることはできません。

deleted

string

ユーザー アカウントが閉じられました。 すべての ID と関連エンティティが削除されます。

pending

string

ユーザー アカウントが保留中です。 アクティブにする前に ID の確認が必要です。