{"id":876,"date":"2024-01-16T10:44:32","date_gmt":"2024-01-16T10:44:32","guid":{"rendered":"https:\/\/olxdoc.wpenginepowered.com\/?p=876"},"modified":"2024-01-29T10:08:13","modified_gmt":"2024-01-29T10:08:13","slug":"publishing-errors-2","status":"publish","type":"post","link":"https:\/\/doc.olxgroup.com\/api\/?p=876","title":{"rendered":"Publishing errors"},"content":{"rendered":"\r\n<h2>Publishing errors<\/h2>\r\n<p>These errors happen when something goes wrong during the advert publishing.<\/p>\r\n<h3 id=\"1-category-with-given-id-doesnt-exists\">1. Category with given ID doesn&#8217;t exists<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Bad Request\",\r\n    \"detail\": \"Category with given ID doesn't exists\"\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>provide valid <strong>category_id<\/strong>\u00a0in the request<\/li>\r\n<\/ul>\r\n<h3 id=\"2-fix-the-category\">2. Fix the category<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Invalid request\",\r\n    \"detail\": \"Data validation error occurred\",\r\n    \"validation\": [\r\n      {\r\n        \"field\": \"category_id\",\r\n        \"title\": \"Fix the category\",\r\n        \"detail\": \"Fix the category\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>provide valid <strong>category_id<\/strong>\u00a0in the request<\/li>\r\n<li>make sure that the <strong>category_id<\/strong>\u00a0is a leaf category:<\/li>\r\n<\/ul>\r\n<p><code>GET \/api\/partner\/categories\/1755\r\n{\r\n  \"data\": {\r\n      \"id\": 1755,\r\n      \"name\": \"Praca in\u017cynieryjna, techniczna\",\r\n      \"parent_id\": 1447,\r\n      \"photos_limit\": 0,\r\n      \"is_leaf\": true\r\n  }\r\n}<\/code><\/p>\r\n<h3 id=\"3-error-while-decoding-json-data-syntax-error\">3. Error while decoding JSON data: Syntax error<\/h3>\r\n<p><code>{\r\n  \"data\": {\r\n    \"error\": {\r\n      \"status\": 400,\r\n      \"title\": \"Bad Request\",\r\n      \"detail\": \"Error while decoding JSON data: Syntax error\"\r\n    }\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the payload you are sending does not contain any extra fields<\/li>\r\n<li>make sure that the field names are valid and do not contain any typos<\/li>\r\n<\/ul>\r\n<h3 id=\"4-partner-is-not-allowed-to-use-external-url\">4. Partner is not allowed to use external URL<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Bad Request\",\r\n    \"detail\": \"Partner is not allowed to use external URL\"\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>your API account is not allowed to use <strong>external_url<\/strong>\u00a0field<\/li>\r\n<li>this feature is available only for a Jobs category in PL<\/li>\r\n<li>reach out to us in order to enable this option<\/li>\r\n<\/ul>\r\n<h3 id=\"5-invalid-value-district_id\">5. Invalid value: <strong>district_id<\/strong><\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Invalid request\",\r\n    \"detail\": \"Data validation error occurred\",\r\n    \"validation\": [\r\n      {\r\n        \"field\": \"district_id\",\r\n        \"title\": \"Invalid value\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>verify <strong>district_id<\/strong>\u00a0provided in the request:<\/li>\r\n<\/ul>\r\n<p><code>GET \/api\/partner\/cities\/{cityId}\/districts\r\n<\/code><\/p>\r\n<h3 id=\"6-your-coordinates-are-too-far-from-picked-location\">6. Your coordinates are too far from picked location<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Invalid request\",\r\n    \"detail\": \"Data validation error occurred\",\r\n    \"validation\": [\r\n      {\r\n        \"field\": \"district\/city_id\",\r\n        \"title\": \"Your coordinates are too far from picked location.\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>verify if <strong>latitude<\/strong> and <strong>longitude<\/strong>\u00a0fields are valid for a given district\/city_id:<\/li>\r\n<\/ul>\r\n<p><code>GET \/api\/partner\/locations\/?latitude={lat}&amp;longitude={lon}\r\n<\/code><\/p>\r\n<h3 id=\"7-this-value-is-not-valid-attributes\">7. This value is not valid: <strong>attributes<\/strong><\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"code\": 400,\r\n    \"title\": \"Invalid request\",\r\n    \"detail\": \"Data validation error occurred\",\r\n    \"validation\": [\r\n      {\r\n        \"field\": \"attributes\",\r\n        \"title\": \"This value is not valid.\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the <strong>attributes<\/strong> array contains <strong>code<\/strong> and <strong>value<\/strong>\u00a0keys only:<\/li>\r\n<\/ul>\r\n<p><code>\"attributes\": [\r\n  {\r\n    \"code\": \"type\",\r\n    \"value\": \"fulltime\"\r\n  },\r\n  {\r\n    \"code\": \"contract\",\r\n    \"value\": \"contract\"\r\n  },\r\n  {\r\n    \"code\": \"manager\",\r\n    \"value\": \"0\"\r\n  },\r\n  {\r\n    \"code\": \"remote_recruitment\",\r\n    \"value\": \"0\"\r\n  }\r\n]\r\n<\/code><\/p>\r\n<h3 id=\"8-invalid-value-paramsstate\">8. Invalid value: <strong>params.state<\/strong><\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Invalid request\",\r\n    \"detail\": \"Data validation error occurred\",\r\n    \"validation\": [\r\n      {\r\n        \"field\": \"params.state\",\r\n        \"title\": \"Invalid value\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>verify <strong>state<\/strong> value in the <strong>attributes<\/strong>\u00a0array<\/li>\r\n<\/ul>\r\n<h3 id=\"9-image-error-remote-file-not-exists\">9. Image error: Remote file not exists<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Bad Request\",\r\n    \"detail\": \"Image error: Remote file not exists\"\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>verify all URLs provided in the <strong>images<\/strong>\u00a0array<\/li>\r\n<\/ul>\r\n<h3 id=\"10-image-error-image-limit-exceeded\">10. Image error: Image limit exceeded<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Bad Request\",\r\n    \"detail\": \"Image error: Image limit exceeded\"\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the request does not contain more images than it is allowed:<\/li>\r\n<\/ul>\r\n<p><code>GET \/api\/partner\/categories\/1581\r\n{\r\n  \"data\": {\r\n      \"id\": 1581,\r\n      \"name\": \"Bluzki i koszulki\",\r\n      \"parent_id\": 642,\r\n      \"photos_limit\": 8,\r\n      \"is_leaf\": true\r\n  }\r\n}\r\n<\/code><\/p>\r\n<h3 id=\"11-unsupported-api-version\">11. Unsupported API version<\/h3>\r\n<p><strong>HTTP code: <\/strong><strong>404 Not Found<\/strong><\/p>\r\n<p><code>{\r\n  \"error\": {\r\n    \"type\": \"NotFoundException\",\r\n    \"message\": \"Unsupported API version\"\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the URL you are trying to call to is valid<\/li>\r\n<\/ul>\r\n<h3 id=\"12-advert-not-found\">12. Advert not found<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 404,\r\n    \"title\": \"Not Found\",\r\n    \"detail\": \"Advert not found\"\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the advert ID is valid<\/li>\r\n<\/ul>\r\n<h3 id=\"13-you-are-not-the-owner-of-this-ad\">13. You are not the owner of this ad<\/h3>\r\n<p><code>{\r\n  \"error\": {\r\n    \"status\": 400,\r\n    \"title\": \"Invalid request\",\r\n    \"detail\": \"Data validation error occurred\",\r\n    \"validation\": [\r\n      {\r\n        \"field\": \"ad\",\r\n        \"title\": \"You are not the owner of this ad\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>you are not allowed to manage the ads created by other users<\/li>\r\n<\/ul>\r\n<h3 id=\"14-too-many-capital-letters\">14. Too many capital letters<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"title\",\r\n                \"title\": \"Too many capital letters\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the title or description does not contain more than 50% text written in capital letters<\/li>\r\n<\/ul>\r\n<h3 id=\"15-field-is-not-valid-emails-and-www-addresses-are-not-allowed\">15. Field is not valid. Emails and www addresses are not allowed<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"title\",\r\n                \"title\": \"Field is not valid. Emails and www addresses are not allowed\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the title or description does not contain any e-mail\/www address<\/li>\r\n<\/ul>\r\n<h3 id=\"16-field-is-not-valid-phone-numbers-are-not-allowed\">16. Field is not valid. Phone numbers are not allowed<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"title\",\r\n                \"title\": \"Field is not valid. Phone numbers are not allowed\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the title or description does not contain any phone number<\/li>\r\n<\/ul>\r\n<h3 id=\"17-field-contains-to-much-punctuation\">17. Field contains to much punctuation<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"title\",\r\n                \"title\": \"Field contains to much punctuation\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>following characters cannot be provided in the title and in the description three times in a row: <strong>!\u00a0?\u00a0.\u00a0,\u00a0&#8211;\u00a0=\u00a0+\u00a0#\u00a0%\u00a0&amp;\u00a0@\u00a0*\u00a0_\u00a0&gt;\u00a0&lt;\u00a0:\u00a0(\u00a0)\u00a0|<\/strong><\/li>\r\n<\/ul>\r\n<h3 id=\"18-deactivate-advert---ad-has-to-be-active\">18. Deactivate advert &#8211; ad has to be active<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"ad\",\r\n                \"title\": \"Ad has to be active\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the advert you want to deactivate is active<\/li>\r\n<\/ul>\r\n<h3 id=\"19-delete-advert---invalid-status\">19. Delete advert &#8211; invalid status<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"ad\",\r\n                \"title\": \"Invalid status\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the advert you want to delete is not active<\/li>\r\n<li>deactivate the advert before deletion:<\/li>\r\n<\/ul>\r\n<p><code>POST \/api\/partner\/adverts\/{advertId}\/commands\r\n{\r\n  \"command\": \"deactivate\",\r\n  \"is_success\": true \/\/ this flag indicates whether you have succeeded in selling the product or not\r\n}\r\n<\/code><\/p>\r\n<h3 id=\"20-cannot-refresh-advert\">20. Cannot refresh advert<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"time\",\r\n                \"title\": \"You cannot refresh ad more often than once in 14 days\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>depending on the country you cannot refresh advert more than once in a given period of time<\/li>\r\n<li>please wait until the refresh option will be available for the advert<\/li>\r\n<\/ul>\r\n<h3 id=\"21-city-with-given-id-doesnt-exists\">21. City with given ID doesn&#8217;t exists<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Bad Request\",\r\n        \"detail\": \"City with given ID doesn't exists\"\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>verify <strong>city_id<\/strong>\u00a0provided in the request:<\/li>\r\n<\/ul>\r\n<p><code>GET \/api\/partner\/cities\/{cityId}\r\n{\r\n    \"error\": {\r\n        \"status\": 404,\r\n        \"title\": \"Not Found\",\r\n        \"detail\": \"City not found\"\r\n    }\r\n}\r\n<\/code><\/p>\r\n<h3 id=\"22-invalid-phone-format\">22. Invalid phone format<\/h3>\r\n<p><code>{\r\n    \"error\": {\r\n        \"status\": 400,\r\n        \"title\": \"Invalid request\",\r\n        \"detail\": \"Data validation error occurred\",\r\n        \"validation\": [\r\n            {\r\n                \"field\": \"phone\",\r\n                \"title\": \"Invalid phone format\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>make sure that the <strong>phone<\/strong>\u00a0provided in the request is valid<\/li>\r\n<\/ul>\r\n<h3 id=\"23-missing-required-version-header\">23. Missing required &#8216;Version&#8217; header<\/h3>\r\n<p><code>{\r\n    \"data\": {\r\n        \"error\": {\r\n            \"status\": 400,\r\n            \"title\": \"Bad Request\",\r\n            \"detail\": \"Missing required 'Version' header!\"\r\n        }\r\n    }\r\n}\r\n<\/code><\/p>\r\n<p><strong>Solution<\/strong>:<\/p>\r\n<ul>\r\n<li>add <strong>&#8220;Version&#8221;: &#8220;2.0&#8221;<\/strong>\u00a0header to your request<\/li>\r\n<\/ul>\r\n","protected":false},"excerpt":{"rendered":"<p>Publishing errors These errors happen when something goes wrong during the advert publishing. 1. Category with given ID doesn&#8217;t exists { &#8220;error&#8221;: { &#8220;status&#8221;: 400, &#8220;title&#8221;: &#8220;Bad Request&#8221;, &#8220;detail&#8221;: &#8220;Category with given ID doesn&#8217;t exists&#8221; } } Solution: provide valid category_id\u00a0in the request 2. Fix the category { &#8220;error&#8221;: { &#8220;status&#8221;: 400, &#8220;title&#8221;: &#8220;Invalid request&#8221;,&#8230;  <a href=\"https:\/\/doc.olxgroup.com\/api\/?p=876\" title=\"Read Publishing errors\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/876"}],"collection":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=876"}],"version-history":[{"count":0,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/876\/revisions"}],"wp:attachment":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}