Uploading the RSS feed
Creates task for the RSS feed upload to Yandex.Webmaster. To get the upload link use the operation GET /v4/user/{user-id}/hosts/{host-id}/turbo/uploaddress
.
Attention. Before the upload, review RSS feed restrictions.
Request format
POST <upload_address>
Request headers
Title | Description |
---|---|
Content-Type:application/rss+xml | Specifies the type of the file passed in the request body. |
Content-Encoding:gzip | Specifies the content encoding — gzip. Note. Gzip compression can be used if the RSS feed size exceeds 10 MB. |
Title | Description |
---|---|
Content-Type:application/rss+xml | Specifies the type of the file passed in the request body. |
Content-Encoding:gzip | Specifies the content encoding — gzip. Note. Gzip compression can be used if the RSS feed size exceeds 10 MB. |
Request body format
The RSS feed must be passed in the request body as a binary file or as a string.
Response format
The service returns data in either JSON (default) or XML format. To get the XML response, pass the HTTP header Accept: application/xml
in the request.
{
"task_id": "a6792e60-ebf3-11e8-b31a-ed044935f842"
}
<Data>
<task_id>a6792e60-ebf3-11e8-b31a-ed044935f842</task_id>
</Data>
task_id
The ID for the RSS feed upload task. You can use it to check the upload status.
Response codes
Code | Description |
---|---|
202 ACCEPTED | The request is accepted for processing. |
400 Bad Request |
|
403 Forbidden |
|
404 Not Found |
|
410 Gone |
|
413 Payload Too Large |
|
429 Too Many Requests |
|
Code | Description |
---|---|
202 ACCEPTED | The request is accepted for processing. |
400 Bad Request |
|
403 Forbidden |
|
404 Not Found |
|
410 Gone |
|
413 Payload Too Large |
|
429 Too Many Requests |
|
Example
The RSS feed upload example:
curl -X POST \ https://api.webmaster.yandex.net/v4/upload/turbo/Dz3L9xOfnCecrcgv3jdTInxCY8tMl__tDWwJV9jB1VkdUmDyqx94u-11JqUte05eXYkX49q1Z9CZAsbBgKkdIQ==/ \ -H 'Authorization: OAuth oauth_token' \ -H 'Content-Type: application/rss+xml' \ --data-binary "@rss.xml"
Copied to clipboard
curl -X POST \ https://api.webmaster.yandex.net/v4/upload/turbo/Dz3L9xOfnCecrcgv3jdTInxCY8tMl__tDWwJV9jB1VkdUmDyqx94u-11JqUte05eXYkX49q1Z9CZAsbBgKkdIQ==/ \ -H 'Authorization: OAuth oauth_token' \ -H 'Content-Type: application/rss+xml' \ -d '<?xml version = "1.0" encoding = "UTF-8"?> <rss version="2.0" xmlns:yandex="http://news.yandex.ru" xmlns:turbo="http://turbo.yandex.ru"> <channel> <item turbo="true"> <title>Page title</title> <link>https://example.com</link> <turbo:content> <![CDATA[ <header> <h1>The Healthy Breakfast restaurant</h1> <h2>Healthy and delicious</h2> <figure> <img src="https://avatars.mds.yandex.net/get-sbs-sd/403988/e6f459c3-8ada-44bf-a6c9-dbceb60f3757/orig"> </figure> <menu> <a href="https://example.com/page1.html">Menu item 1</a> <a href="https://example.com/page2.html">Menu item 2</a> </menu> </header> <p>What's a good way to start the day? With a delicious and healthy breakfast!</p> <p>Join us for breakfast. Check out photos of our dishes <a href="#">on our website</a>.</p> <h2>Menu</h2> <figure> <img src="https://avatars.mds.yandex.net/get-sbs-sd/369181/49e3683c-ef58-4067-91f9-786222aa0e65/orig"> <figcaption>Omelette with herbs</figcaption> </figure> <p>Our menu always contains fresh, delicious and healthy options.</p> <p>Find out for yourself.</p> <button formaction="tel:+7(123)456-78-90" data-background-color="#5B97B0" data-color="white" data-primary="true">Reserve a table</button> <div data-block="widget-feedback" data-stick="false"> <div data-block="chat" data-type="whatsapp" data-url="https://whatsapp.com"></div> <div data-block="chat" data-type="telegram" data-url="http://telegram.com"></div> <div data-block="chat" data-type="vkontakte" data-url="https://vk.com"></div> <div data-block="chat" data-type="facebook" data-url="https://facebook.com"></div> <div data-block="chat" data-type="viber" data-url="https://viber.com"></div> </div> <p>Our address: <a href="#">Nullam dolor massa, porta a nulla in, ultricies vehicula arcu.</a></p> <p>Photos — http://unsplash.com</p> ]]> </turbo:content> </item> </channel> </rss>'
Copied to clipboard
Response:
{
"task_id": "a6792e60-ebf3-11e8-b31a-ed044935f842"
}