Share via


Authentication - Generate access token legacy (Deprecating)

[Deprecating]Generates an access token required for accessing few partner api resources. This is an older version which is soon to be deprecated, please the newer version Generate Access Token v3

POST https://api.partnercenter.microsoft.com/generatetoken

Request Header

Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded", "text/json"

Name Required Type Description
Authorization True

string

Authorization Bearer token. Currently takes graph.windows.net audience token for app-only scenarios, which is deprecating. Please move to v3/generatetoken endpoint. Refer Deprecation of Active directory graph token for detailed information.

Accept True

string

Acceptable content type; widely accepeted type application/json

ms-correlationid

string

Used for tracking requests internally. If a ms-correlationid is not provided, the server will generate a new one for each request

ms-requestid

string

Used for idempotency of requests. If a ms-requestid is not provided, the server will generate a new one for each request

Request Body

Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded", "text/json"

Name Type Description
grant_type

string

Only supports grant_type=jwt_token

Responses

Name Type Description
200 OK

The request succeeded.

Media Types: "application/json", "application/xml", "text/xml", "text/json"

400 Bad Request

There was missing or invalid input. The response body contains the error details.

Media Types: "application/json", "application/xml", "text/xml", "text/json"

401 Unauthorized

The request was not authenticated. The client needs to authenticate with the partner API service first.

Media Types: "application/json", "application/xml", "text/xml", "text/json"

403 Forbidden

The request was authenticated but was refused because the caller does not have the rights to invoke it.

Media Types: "application/json", "application/xml", "text/xml", "text/json"

404 Not Found

The resource is not found or not available with the given input parameters.

Media Types: "application/json", "application/xml", "text/xml", "text/json"

500 Internal Server Error

The partner API service or one of its dependencies failed to fulfill the request. Callers can retry the request.

Media Types: "application/json", "application/xml", "text/xml", "text/json"