{ "swagger": "2.0", "info": { "title": "ApiManagementClient", "description": "Use these REST APIs for performing operations on User entity in Azure API Management deployment. The User entity in API Management represents the developers that call the APIs of the products to which they are subscribed.", "version": "2016-10-10" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users": { "get": { "tags": [ "Users" ], "operationId": "Users_ListByService", "description": "Lists a collection of registered users in the specified service instance.", "externalDocs": { "url": "https://msdn.microsoft.com/en-us/library/azure/dn776330.aspx" }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|------------------|------------------------|-----------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| state | eq | N/A |\n| registrationDate | ge, le, eq, ne, gt, lt | N/A |\n| note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists a collection of User entities.", "schema": { "$ref": "#/definitions/UserCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/UserContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}": { "get": { "tags": [ "Users" ], "operationId": "Users_Get", "description": "Gets the details of the user specified by its identifier.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Gets the specified user entity.", "schema": { "$ref": "#/definitions/UserContract" }, "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } }, "put": { "tags": [ "Users" ], "operationId": "Users_CreateOrUpdate", "description": "Creates or Updates a user.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserCreateParameters" }, "description": "Create or update parameters." }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "User was successfully created." }, "204": { "description": "User was successfully updated." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } }, "patch": { "tags": [ "Users" ], "operationId": "Users_Update", "description": "Updates the details of the user specified by its identifier.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserUpdateParameters" }, "description": "Update parameters." }, { "name": "If-Match", "in": "header", "required": true, "description": "The entity state (Etag) version of the user to update. A value of \"*\" can be used for If-Match to unconditionally apply the operation.", "type": "string" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "The user details were successfully updated." }, "405": { "description": "Administrator user cannot be modified.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } }, "delete": { "tags": [ "Users" ], "operationId": "Users_Delete", "description": "Deletes specific user.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "deleteSubscriptions", "in": "query", "required": false, "type": "boolean", "description": "Whether to delete user's subscription or not." }, { "name": "If-Match", "in": "header", "required": true, "description": "The entity state (Etag) version of the user to delete. A value of \"*\" can be used for If-Match to unconditionally apply the operation.", "type": "string" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "The user details were successfully deleted." }, "405": { "description": "Administrator user cannot be modified.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl": { "post": { "tags": [ "Users" ], "operationId": "Users_GenerateSsoUrl", "description": "Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The response body contains the single sign-on URL.", "schema": { "x-ms-client-flatten": true, "$ref": "#/definitions/GenerateSsoUrlResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/groups": { "get": { "tags": [ "UserGroups" ], "operationId": "UserGroups_ListByUsers", "description": "Lists all user groups.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|-------------|------------------------|---------------------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists a collection of Group entities.", "schema": { "$ref": "./apimgroups.json#/definitions/GroupCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "./apimgroups.json#/definitions/GroupContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/subscriptions": { "get": { "tags": [ "UserSubscriptions" ], "operationId": "UserSubscriptions_ListByUsers", "description": "Lists the collection of subscriptions of the specified user.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|--------------|------------------------|---------------------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| state | eq | |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists a collection of Subscription entities.", "schema": { "$ref": "./apimsubscriptions.json#/definitions/SubscriptionCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "./apimsubscriptions.json#/definitions/SubscriptionContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/identities": { "get": { "tags": [ "UserIdentities" ], "operationId": "UserIdentities_ListByUsers", "description": "Lists all user identities.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists of User Identities.", "schema": { "$ref": "#/definitions/UserIdentityCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token": { "post": { "tags": [ "Users" ], "operationId": "Users_GetSharedAccessToken", "description": "Gets the Shared Access Authorization Token for the User.", "x-ms-examples": { "ApiManagementUsersGetToken": { "$ref": "./examples/ApiManagementUsersGetToken.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserTokenParameters" }, "description": "Create Authorization Token parameters." }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The response body contains the authorization token for the user.", "schema": { "x-ms-client-flatten": true, "$ref": "#/definitions/UserTokenResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } } } }, "definitions": { "GenerateSsoUrlResult": { "properties": { "value": { "type": "string", "description": "Redirect Url containing the SSO URL value." } }, "description": "Generate SSO Url operations response details." }, "UserCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/UserContract" }, "description": "Page values." }, "count": { "type": "integer", "format": "int64", "description": "Total record count number across all pages." }, "nextLink": { "type": "string", "description": "Next page link if any." } }, "description": "Paged Users list representation." }, "UserContract": { "properties": { "id": { "type": "string", "description": "User identifier path." }, "firstName": { "type": "string", "description": "First name." }, "lastName": { "type": "string", "description": "Last name." }, "email": { "type": "string", "description": "Email address." }, "state": { "type": "string", "description": "User state.", "enum": [ "Active", "Blocked" ], "x-ms-enum": { "name": "UserStateContract", "modelAsString": false } }, "registrationDate": { "type": "string", "format": "date-time", "description": "Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n" }, "note": { "type": "string", "description": "Administrator's note about given user." }, "identities": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/UserIdentityContract" }, "description": "Collection of user identities." } }, "description": "User profile." }, "UserCreateParameters": { "properties": { "email": { "type": "string", "description": "Email address. Must not be empty and must be unique within the service instance.", "minLength": 1, "maxLength": 254 }, "password": { "type": "string", "description": "User Password." }, "firstName": { "type": "string", "description": "First name.", "minLength": 1, "maxLength": 100 }, "lastName": { "type": "string", "description": "Last name.", "minLength": 1, "maxLength": 100 }, "state": { "type": "string", "description": "Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.", "enum": [ "Active", "Blocked" ], "default": "Active", "x-ms-enum": { "name": "UserStateContract", "modelAsString": false } }, "note": { "type": "string", "description": "Optional note about a user set by the administrator." } }, "required": [ "email", "password", "firstName", "lastName" ], "description": "Parameters supplied to the Create User operation." }, "UserIdentityCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/UserIdentityContract" }, "description": "User Identity values." } }, "description": "List of Users Identity list representation." }, "UserIdentityContract": { "properties": { "provider": { "type": "string", "description": "Identity provider name." }, "id": { "type": "string", "description": "Identifier value within provider." } }, "description": "User identity details." }, "UserTokenParameters": { "properties": { "keyType": { "type": "string", "description": "The Key to be used to generate token for user.", "enum": [ "primary", "secondary" ], "default": "primary", "x-ms-enum": { "name": "KeyTypeContract", "modelAsString": false } }, "expiry": { "type": "string", "format": "date-time", "description": "The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n" } }, "required": [ "keyType", "expiry" ], "description": "Parameters supplied to the Get User Token operation." }, "UserTokenResult": { "properties": { "value": { "type": "string", "description": "Shared Access Authorization token for the User." } }, "description": "Get User Token response details." }, "UserUpdateParameters": { "properties": { "email": { "type": "string", "description": "Email address." }, "password": { "type": "string", "description": "Password." }, "firstName": { "type": "string", "description": "First name.", "minLength": 1, "maxLength": 100 }, "lastName": { "type": "string", "description": "Last name.", "minLength": 1, "maxLength": 100 }, "state": { "type": "string", "description": "Account state.", "enum": [ "Active", "Blocked" ], "x-ms-enum": { "name": "UserStateContract", "modelAsString": false } }, "note": { "type": "string", "description": "Note about user." } }, "description": "Parameters supplied to the Update User operation." } }, "parameters": { "UserIdParameter": { "name": "uid", "in": "path", "required": true, "type": "string", "description": "User identifier. Must be unique in the current API Management service instance.", "minLength": 1, "maxLength": 256, "pattern": "^[^*#&+:<>?]+$", "x-ms-parameter-location": "method" } } }