Adding a Sitemap file
Adds the Sitemap file to Yandex.Webmaster.
Request format
In the request body, pass the Sitemap file URL and specify the desired data type in the Content-type
header (application/json
or application/xml
):
POST https://api.webmaster.yandex.net/v4/user/{user-id}/hosts/{host-id}/user-added-sitemaps
|
Type: |
|
Type: |
Example
{
"url": "http://example.com"
}
<Data>
<url>http://example.com</url>
</Data>
Parameter |
Description |
|
URL of the Sitemap file to add. |
Response format
Examples
JSONXML
{ "sitemap_id": "c7-fe:80-c0" }
<Data> <sitemap_id>c7-fe:80-c0</sitemap_id> </Data>
Name
Required
Type
Description
sitemap_id
Yes
string
ID of the added Sitemap file.
Response codes
To view the response structure in detail, click the reason.
Code |
Reason |
Description |
201 |
CREATED |
|
403 |
The ID of the user who issued the token differs from the one specified in the request. In the examples below, JSON
XML
|
|
404 |
Site management rights are not verified. JSON
XML
|
|
409 |
The Sitemap was already added. 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.
Type: host id (string)
. The site ID. To get it, use the GET /v4/user/{user-id}/hosts method.
Description
URL of the Sitemap file to add.
Required
Yes
Type
string
Description
ID of the Sitemap file.
Description
Error code.
Description
ID of the user who allowed access.
Description
ID of the requested site.
Description
Error message.