Requesting user information

When you request information about a user, the Yandex.Passport API returns all the data that the OAuth token that is specified in the request has permissions for.

Request format

A request for information about a Yandex user is formed like this:
[  format=json | xml]
[& oauth_token=<OAuth token>]
[& with_openid_identity=1 | yes | true]

Request parameters:

Parameter Value Description
format xml | json

Format for returned data. Possible values:

  • "json" — Returns a JSON document. This value is used by default if the parameter is not specified in the request.
  • "xml" — Returns an XML document.
oauth_token <OAuth token>

An OAuth access token that gives permission to access the user's account data using the Yandex.Passport API. The contents of the response depend on the permissions that are granted by the OAuth token specified in the request.

The OAuth token must be specified in the request in one of two ways — either in the value of this parameter, or in the HTTP header:

Authorization: OAuth <OAuth token>

If the token is specified in the header, the oauth_token parameter can be omitted from the request.

with_openid_identity 1 | yes | true

Whether to request OpenID identities that the user could have obtained from Yandex. The list is included in the response in the JSON array or XML element openid_identities.

To request identities, set the value to “1”, “yes”, or “true”. If any other value is set, the parameter is ignored.

This parameter is used when migrating from Yandex OpenID to the Yandex.Passport API.