Getting the list of the user's sites
Returns the list of sites added by the user and information about each of them.
Request format
GET https://api.webmaster.yandex.net/v4/user/{user-id}/hosts
|
Type: |
Response format
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://яндекс.рф/"
}
}, ...
]
}
<Data>
<host>
<host_id>http:ya.ru:80</host_id>
<ascii_host_url>http://xn--d1acpjx3f.xn--p1ai/</ascii_host_url>
<unicode_host_url>http://яндекс.рф/</unicode_host_url>
<verified>yes</verified>
<main_mirror>
<host_id>http:ya.ru:80</host_id>
<verified>false</verified>
<ascii_host_url>http://xn--d1acpjx3f.xn--p1ai/</ascii_host_url>
<unicode_host_url>http://яндекс.рф/</unicode_host_url>
</main_mirror>
</host>
...
</Data>
Name |
Required |
Type |
Description |
|
Yes |
|
The site ID. |
|
Yes |
|
The site's ASCII URL |
|
No |
|
The site's UTF-8 URL. |
|
Yes |
|
Whether the site is verified. |
|
Yes |
The site's main mirror, if there is one. |
The status of verifying the right to manage the site (ApiVerificationState)
Status |
Description |
|
Verification wasn't completed and rights are not confirmed. |
|
The rights are verified. |
|
The rights verification is in progress. |
|
Verification was performed but rights are not confirmed. |
|
An unexpected error occurred when verifying the rights. |
Reasons for refusal to verify site management rights (ApiVerificationFailReason)
Reason for refusal |
Description |
|
Delegation of site management rights was canceled. |
|
The specified DNS record doesn't exist. |
|
The meta tag is missing in the site's home page header. |
|
Verification of site management rights via Yandex.Mail for Domain isn't allowed for this site. |
|
The HTML file content is set incorrectly. |
Response codes
To view the response structure in detail, click the reason.
Code |
Reason |
Description |
200 |
OK |
|
403 |
The ID of the user who issued the token differs from the one specified in the request. In the examples below, JSON
XML
|
Related information
Type: int64
. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the GET /v4/user method.
Required
Yes
Type
host id
(string
)
Description
The site ID.
Required
Yes
Type
string
Description
The site's ASCII URL
Required
No
Type
string
Description
The site's UTF-8 URL.
Required
Yes
Type
boolean
Description
Whether the site is verified.
Required
Yes
Type
Description
The site's main mirror, if there is one.
Description
Error code.
Description
ID of the user who allowed access.
Description
Error message.