This is an archive version of the document. To get the most up-to-date information, see the current version.

Getting Device Code

In this article

    This section explains how to get a device code from Microsoft Azure.

    Request

    POST https://<hostname>:4443/v4/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

    Property

    Type

    Description

    targetRegion

    string

    Sets the region of the Office 365 organization that you plan to add.

    Request Example

    POST https://<hostname>:4443/v4/DeviceCode

     

    Request Header:

    Authorization: Bearer <Access-Token>

    Request Body:

    {

      "targetRegion": "worldwide"

    }

    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 and then specify on the Microsoft authentication portal.

    verificationUrl

    string

    Shows the verification URL that you must open to sign in to Microsoft Azure.

    expiresIn

    integer

    Shows the lifespan of the code in milliseconds.

    message

    string

    Shows the help message.

    Response Example

    Response:

    200 OK

     

    Response Body:

    {

      "userCode": "CWE5QHLNM",

      "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 CWE5QHLNM to authenticate."

    }

    I want to report a typo

    There is a misspelling right here:

     

    I want to let the Veeam Documentation Team know about that.