Getting Device Code
This section explains how to get a device code from Microsoft Azure.
Request
POST https://<hostname>:4443/v5/Organizations/{organizationId}/DeviceCode |
Request Headers
The request header must contain an authorization token of the current session.
Request Parameters
The following parameters must be posted as URL.
Parameter | Type | Description |
---|---|---|
organizationId | string | The identification number of the Office 365 organization. Can be obtained as described in Getting Organizations. |
Request Body
None.
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 OK.
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
---|---|
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message: application/json; charset=utf-8 |
Response Body
The response contains the following information.
Property | Type | Description |
---|---|---|
userCode | string | Shows the code that you must copy. |
verificationUrl | string | Shows the verification URL that you must open and paste the copied code to the verification field. |
expiresIn | integer | Shows the lifespan of the code in milliseconds. |
message | string | Shows the help message. |
Example
Request: GET https://abc.tech.local:4443/v5/Organizations/7a53143a-b7c8-4d5a-a569-7dcbca8ab71b/DeviceCode
Request Header: Authorization: Bearer <Access-Token>
Response: 200 OK
Response Body: { "userCode": "CHRG3E93P", "verificationUrl": "https://microsoft.com/devicelogin", "expiresIn": 899, "message": "To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CHRG3E93P to authenticate." } |