Getting a list of a user's sites

Description

Gets a list of sites added by the user, with general information about each of them.

Request format

Send a GET request to the address of the resource for user site lists:

GET https://api.webmaster.yandex.net/v3/user/{user-id}/hosts/

Path parameters

NameRequiredTypeDefault valueDescription
user-idYesint64The user ID.

Response format

If successful, the server returns 200 OK and the list of sites with information about each of them.

Example

{
  "hosts": [
    {
      "host_id": "http:ya.ru:80",
      "ascii_host_url": "http://xn--d1acpjx3f.xn--p1ai/",
      "unicode_host_url": "http://яндекс.рф/",
      "verified": true,
      "main_mirror": {
        "host_id": "http:ya.ru:80",
        "verified": true,
        "ascii_host_url": "http://xn--d1acpjx3f.xn--p1ai/",
        "unicode_host_url": "http://яндекс.рф/"
      }
    }, ...
  ]
}
NameRequiredTypeDescription
host_idYeshost idSite ID.
ascii_host_urlYesstringASCII URL of the site.
unicode_host_urlNostringUTF-8 URL of the site.
verifiedYesApiVerificationStateError description for the VERIFICATION_FAILED status.
main_mirrorYesApiVerificationFailReasonThe reason that verification failed.

The status of verifying site management rights (ApiVerificationState)

StatusDescription
NONEVerification wasn't performed, and site management rights weren't confirmed.
VERIFIEDRights were verified.
IN_PROGRESSRights are in the process of being verified.
VERIFICATION_FAILEDSite management rights were checked, but not confirmed.
INTERNAL_ERRORAn unexpected error occurred during verification.

The reasons why site management rights weren't confirmed (ApiVerificationFailReason)

Reason for refusalDescription
DELEGATION CANCELLEDCanceled delegation of site management rights.
DNS_RECORD_NOT_FOUNDThe specified DNS record does not exist.
META_TAG_NOT_FOUNDMissing metatag in the header on the site's main page.
PDD_VERIFICATION_CANCELLEDThis site does not allow verifying rights via Mail for Domains.
WHOIS_EMAIL_NOT_FOUNDThe specified email address does not exist in the WHOIS record for this site.
WRONG_HTML_PAGE_CONTENTInvalid HTML file content.

Errors

403 Forbidden

The user ID for the token doesn't match the one specified in the request. In the examples below, {user_id} is the correct uid for the owner of the OAuth token.

{
  "error_code": "INVALID_USER_ID",
  "available_user_id": 1,
  "error_message": "Invalid user id. {user_id} should be used."
}
ParameterDescription
error_codeError code.
available_user_idID of the user who allowed access.
error_messageError message.