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.
  1. Request format
  2. Response format
  3. Response codes
  4. Example

Request format

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.

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"
}
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

ENTITY_VALIDATION_ERROR
The request body validation failed.
Example response
{
  "error_code": "ENTITY_VALIDATION_ERROR",
  "error_message": "some string"
}
Copied to clipboard
error_code
Error code.
error_message
Error message.
403 Forbidden
INVALID_USER_ID
The ID of the user who issued the token differs from the one specified in the request. The examples below {user_id} show the correct uid of the OAuth token owner.
Example response
{
  "error_code": "INVALID_USER_ID",
  "available_user_id": 1,
  "error_message": "Invalid user id. {user_id} should be used."
}
Copied to clipboard
error_code
Error code.
available_user_id
ID of the user who allowed access.
error_message
Error message.
LICENCE_NOT_ACCEPTED
You have to accept the User agreement.
Example response
{
  "error_code": "LICENCE_NOT_ACCEPTED",
  "error_message": "some string"
}
Copied to clipboard
error_code
Error code.
error_message
Error message.

404 Not Found

HOST_NOT_VERIFIED
Site management rights are not verified.
Example response
{
  "error_code": "HOST_NOT_VERIFIED",
  "host_id": "http:ya.ru:80",
  "error_message": "some string"
}
Copied to clipboard
error_code
Error code.
host_id
ID of the requested site.
error_message
Error message.
410 Gone
UPLOAD_ADDRESS_EXPIRED
Resource unavailable
Example response
{
  "error_code": "UPLOAD_ADDRESS_EXPIRED",
  "valid_until": "2016-01-01T00:00:00,000+0300",
  "error_message": "some string"
}
Copied to clipboard
error_code
Error code.
valid_until
The date and time until which the URL for task creation is available.
error_message
Error message.

413 Payload Too Large

REQUEST_ENTITY_TOO_LARGE
The file size exceeds the limits.
Example response
{
  "error_code": "REQUEST_ENTITY_TOO_LARGE",
  "error_message": "some string"
}
Copied to clipboard
error_code
Error code.
error_message
Error message.

429 Too Many Requests

TOO_MANY_REQUESTS_ERROR
Too many requests sent.
Example response
{
  "error_code": "TOO_MANY_REQUESTS_ERROR",
  "daily_quota": 1,
  "exceeded_until": "2016-01-01T00:00:00,000+0300",
  "error_message": "some string"
}
Copied to clipboard
error_code
Error code.
daily_quota
The maximum number of requests per day.
exceeded_until
Time when the new quota starts.
error_message
Error message.

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

Response:

{
  "task_id": "a6792e60-ebf3-11e8-b31a-ed044935f842"
}