Adding an original text

Adds the site's original text to Yandex.Webmaster.

Restriction.

You can add up to 100 texts a day. The text size should be in the range from 500 to 32,000 characters.

  1. Request format
  2. Response format
  3. Response codes

Request format

In the request body, pass the original text and specify the desired data type in the Content-type (application/json or application/xml header):

POST https://api.webmaster.yandex.net/v4/user/{user-id}/hosts/{host-id}/original-texts/
Content-type: application/xml

Path parameters

Name Required Type Default value Description
user-id Yes int64 User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the GET /user/ method.
host-id Yes host id The site ID. To get it, use the GET /user/{user-id}/hosts/ method.

Example

{
  "content": "some text"
}
Parameter Description
content Original text.

Response format

Example

{
  "text_id": "some text",
  "quota_remainder": 1
}
Name Required Type Description
text_id Yes string ID of the added original text.
quota_remainder Yes int32 The remainder of the daily quota for the number of added texts.

Response codes

To view the response structure in detail, click the reason.

Code Reason Description
201 CREATED
403

INVALID_USER_ID

The ID of the user who issued the token differs from the one specified in the request. In the examples below, {user_id} shows the correct uid of the OAuth token owner.

{
  "error_code": "INVALID_USER_ID",
  "available_user_id": 1,
  "error_message": "Invalid user id. {user_id} should be used."
}
404 HOST_NOT_VERIFIED
Site management rights are not verified.
{
  "error_code": "HOST_NOT_VERIFIED",
  "host_id": "http:ya.ru:80",
  "error_message": "some string"
}
409 TEXT_ALREADY_ADDED
The text you added earlier.
{
  "error_code": "TEXT_ALREADY_ADDED",
  "error_message": "some string"
}
422 TEXT_LENGTH_CONSTRAINTS_VIOLATION
The passed text is too short or too long.
{
  "error_code": "TEXT_LENGTH_CONSTRAINTS_VIOLATION",
  "max_length": 1,
  "min_length": 1,
  "actual_length": 1,
  "error_message": "explicit error message"
}
429 QUOTA_EXCEEDED
The daily quota for requests was exceeded.
{
  "error_code": "QUOTA_EXCEEDED",
  "daily_quota": 1,
  "exceeded_until": "2016-01-01T00:00:00,000+0300",
  "error_message": "some string"
}