{"id":654,"date":"2023-12-22T15:33:01","date_gmt":"2023-12-22T15:33:01","guid":{"rendered":"https:\/\/olxdoc.wpenginepowered.com\/?p=654"},"modified":"2023-12-22T15:33:01","modified_gmt":"2023-12-22T15:33:01","slug":"get-advert-metadata","status":"publish","type":"post","link":"https:\/\/doc.olxgroup.com\/api\/?p=654","title":{"rendered":"Get advert metadata"},"content":{"rendered":"\n\n\t<h1>Get advert metadata<\/h1>\n<p>&nbsp;<\/p>\n<p>If you\u00a0<a href=\"https:\/\/developer.olxgroup.com\/docs\/receiving-advert-notifications\" target=\"_self\" rel=\"noopener\">followed the steps of how to process advert notifications<\/a>, you know that you can be notified about advert status changes through notifications sent directly to your application&#8217;s webhook\/callback URL. Alternatively, we also provide endpoints where you can get the metadata (which includes the status) of a single or all adverts when needed.<\/p>\n\t\u2757\ufe0f<strong>Temporary Solution<\/strong>\nUsing the GET advert metadata endpoint is only a temporary solution to be used during the integration phase or to get information if you lost it for technical reasons.\nThis request should not be used for final integration. To &#8220;get&#8221; the status of all adverts or operations you need to have the Notification URL correctly implemented and all notifications will be sent to you and you should display them to the application user.\n\t<h4>Get metadata of a single advert<\/h4>\n<p><strong>Endpoint<\/strong>:\u00a0<code tabindex=\"0\" data-lang=\"\">GET https:\/\/api.olxgroup.com\/advert\/v1\/&lt;ADVERT UUID&gt;\/meta<\/code><\/p>\n\t<p>For a single advert you can do the following:<\/p>\n<code tabindex=\"0\" data-lang=\"curl\"><\/code>\n<code>cURL\ncurl --location --request GET 'https:\/\/api.olxgroup.com\/advert\/v1\/<advert UUID>\/meta'\n--header 'Accept: application\/json' \n--header 'Content-Type: application\/json' \n--header 'X-API-KEY: <your API KEY>' \n--header 'Authorization: Bearer <access TOKEN>' \n--header 'User-Agent: <crm NAME>'<\/crm><\/access><\/your><\/advert><\/code><button onclick=\"copyJson('copy_29495')\">Copy<\/button>\ncURL\ncurl &#8211;location &#8211;request GET &#8216;https:\/\/api.olxgroup.com\/advert\/v1\/<advert UUID>\/meta&#8217;\n&#8211;header &#8216;Accept: application\/json&#8217; \n&#8211;header &#8216;Content-Type: application\/json&#8217; \n&#8211;header &#8216;X-API-KEY: <your API KEY>&#8216; \n&#8211;header &#8216;Authorization: Bearer <access TOKEN>&#8216; \n&#8211;header &#8216;User-Agent: <crm NAME>&#8216;\nCopied to clipboard\n\t<p>Here&#8217;s an example of the response:<\/p>\n<code>JSON\n{\n    \"transaction_id\": \"06ba5533-69b2-11e8-9341-6312550b19ed\",\n    \"message\": \"Advert status information\",\n    \"data\": {\n        \"uuid\": \"f7695d17-8ee2-4409-89ac-74c673630edb\",\n        \"last_action_status\": \"POSTED\",\n        \"last_action_at\": \"2018-06-06T17:21:05.537+0000\",\n        \"custom_fields\": {\n            \"id\": \"123456\",\n            \"reference_id\": \"TEST1234\"\n        },\n        \"state\": {\n            \"code\": \"new\",\n            \"visible_in_profile\": \"true\",\n            \"ttl\": \"2018-07-04 16:01:12\",\n            \"url\": \"https:\/\/www.imovirtual.com\/anuncio\/apartamento-muito-moderno-em-cabanelas-IDGj9u.html\",\n            \"created_at\": \"2018-06-06 18:21:05\",\n            \"activated_at\": null,\n            \"modified_at\": \"2018-06-06 18:21:39\",\n            \"moderation\": {\n                \"reason\": null,\n                \"description\": null\n            }\n        },\n        \"last_error\": null\n    }\n}<\/code><button onclick=\"copyJson('copy_2184')\">Copy<\/button>\nJSON\n{\n    &#8220;transaction_id&#8221;: &#8220;06ba5533-69b2-11e8-9341-6312550b19ed&#8221;,\n    &#8220;message&#8221;: &#8220;Advert status information&#8221;,\n    &#8220;data&#8221;: {\n        &#8220;uuid&#8221;: &#8220;f7695d17-8ee2-4409-89ac-74c673630edb&#8221;,\n        &#8220;last_action_status&#8221;: &#8220;POSTED&#8221;,\n        &#8220;last_action_at&#8221;: &#8220;2018-06-06T17:21:05.537+0000&#8221;,\n        &#8220;custom_fields&#8221;: {\n            &#8220;id&#8221;: &#8220;123456&#8221;,\n            &#8220;reference_id&#8221;: &#8220;TEST1234&#8221;\n        },\n        &#8220;state&#8221;: {\n            &#8220;code&#8221;: &#8220;new&#8221;,\n            &#8220;visible_in_profile&#8221;: &#8220;true&#8221;,\n            &#8220;ttl&#8221;: &#8220;2018-07-04 16:01:12&#8221;,\n            &#8220;url&#8221;: &#8220;https:\/\/www.imovirtual.com\/anuncio\/apartamento-muito-moderno-em-cabanelas-IDGj9u.html&#8221;,\n            &#8220;created_at&#8221;: &#8220;2018-06-06 18:21:05&#8221;,\n            &#8220;activated_at&#8221;: null,\n            &#8220;modified_at&#8221;: &#8220;2018-06-06 18:21:39&#8221;,\n            &#8220;moderation&#8221;: {\n                &#8220;reason&#8221;: null,\n                &#8220;description&#8221;: null\n            }\n        },\n        &#8220;last_error&#8221;: null\n    }\n}\nCopied to clipboard\n\t<h3>Get metadata of all adverts<\/h3>\n\t<p><strong>Endpoint<\/strong>:\u00a0<code tabindex=\"0\" data-lang=\"\">GET https:\/\/api.olxgroup.com\/advert\/v1\/meta<\/code><\/p>\n\t<p>In some cases, it might be more useful to get the status of multiple adverts in one single call. For example, when your app is displaying a page of 10 or 20 adverts, you probably don&#8217;t want to make a single API call for each one. The following endpoint returns the metadata for all adverts for a given user:<\/p>\n<code>cURL\ncurl --location --request GET 'https:\/\/api.olxgroup.com\/advert\/v1\/meta'\n--header 'Accept: application\/json' \n--header 'Content-Type: application\/json' \n--header 'X-API-KEY: <your API KEY>' \n--header 'Authorization: Bearer <access TOKEN>' \n--header 'User-Agent: <crm NAME>'<\/crm><\/access><\/your><\/code><button onclick=\"copyJson('copy_40954')\">Copy<\/button>\ncURL\ncurl &#8211;location &#8211;request GET &#8216;https:\/\/api.olxgroup.com\/advert\/v1\/meta&#8217;\n&#8211;header &#8216;Accept: application\/json&#8217; \n&#8211;header &#8216;Content-Type: application\/json&#8217; \n&#8211;header &#8216;X-API-KEY: <your API KEY>&#8216; \n&#8211;header &#8216;Authorization: Bearer <access TOKEN>&#8216; \n&#8211;header &#8216;User-Agent: <crm NAME>&#8216;\nCopied to clipboard\n\t<p>Here&#8217;s an example of what you&#8217;ll get:<\/p>\n<code>JSON\n{\n    \"transaction_id\": \"58fda4cf-69a8-11e8-ad43-b36032d0fc62\",\n    \"message\": \"Adverts status information\",\n    \"data\": [\n        {\n            \"uuid\": \"81237759-90a9-468c-8c86-3ef1ca9b4b02\",\n            \"last_action_status\": \"POSTED\",\n            \"last_action_at\": \"2018-06-06T16:13:51.976+0000\",\n            \"custom_fields\": {\n            \t\"id\": \"123456\",\n            \t\"reference_id\": \"TEST1234\"\n        \t\t},\n            \"state\": {\n                \"code\": \"moderated\",\n                \"visible_in_profile\": \"true\",\n                \"ttl\": \"2018-07-04 16:01:12\",\n                \"url\": \"https:\/\/www.imovirtual.com\/anuncio\/apartamento-moderno-em-cabanelas-IDGiZz.html\",\n                \"created_at\": \"2018-06-06 17:13:51\",\n                \"activated_at\": \"2018-06-06 17:14:08\",\n                \"modified_at\": \"2018-06-06 17:23:40\",\n                \"moderation\": {\n                    \"reason\": \"DEL_dados_incorrectos\",\n                    \"description\": \"Imovirtual - An\u00fancio Removido - Dados Incorrectos\"\n                }\n            },\n            \"last_error\": null\n        },\n        {\n            \"uuid\": \"744e7fb5-60d6-4459-b41b-54c5e0eb6220\",\n            \"last_action_status\": \"PUT\",\n            \"last_action_at\": \"2018-06-06T16:35:41.749+0000\",\n            \"custom_fields\": {\n                \"id\": \"123456\",\n                \"reference_id\": \"TEST5678\"\n            },\n            \"state\": {\n                \"code\": \"active\",\n                \"visible_in_profile\": \"true\",\n                \"ttl\": \"2018-07-04T16:01:12.000+0000\",\n                \"url\": \"https:\/\/www.imovirtual.com\/anuncio\/apartamento-moderno-em-cabanelas-IDGj2t.html\",\n                \"created_at\": \"2018-06-06T17:32:24.000+0000\",\n                \"activated_at\": null,\n                \"modified_at\": \"2018-06-06T17:35:41.000+0000\",\n                \"moderation\": null\n            },\n            \"last_error\": null\n        }\n    ],\n    \"links\": {\n        \"first\": {\n            \"href\": \"http:\/\/api.olxgroup.com\/advert\/v1\/meta\"\n        },\n        \"next\": {\n            \"href\": \"https:\/\/api.olxgroup.com\/advert\/v1\/meta?exclusiveStartUuid=744e7fb5-60d6-4459-b41b-54c5e0eb6220\"\n        }\n    }\n}<\/code><button onclick=\"copyJson('copy_5500')\">Copy<\/button>\nJSON\n{\n    &#8220;transaction_id&#8221;: &#8220;58fda4cf-69a8-11e8-ad43-b36032d0fc62&#8221;,\n    &#8220;message&#8221;: &#8220;Adverts status information&#8221;,\n    &#8220;data&#8221;: [\n        {\n            &#8220;uuid&#8221;: &#8220;81237759-90a9-468c-8c86-3ef1ca9b4b02&#8221;,\n            &#8220;last_action_status&#8221;: &#8220;POSTED&#8221;,\n            &#8220;last_action_at&#8221;: &#8220;2018-06-06T16:13:51.976+0000&#8221;,\n            &#8220;custom_fields&#8221;: {\n            \t&#8220;id&#8221;: &#8220;123456&#8221;,\n            \t&#8220;reference_id&#8221;: &#8220;TEST1234&#8221;\n        \t\t},\n            &#8220;state&#8221;: {\n                &#8220;code&#8221;: &#8220;moderated&#8221;,\n                &#8220;visible_in_profile&#8221;: &#8220;true&#8221;,\n                &#8220;ttl&#8221;: &#8220;2018-07-04 16:01:12&#8221;,\n                &#8220;url&#8221;: &#8220;https:\/\/www.imovirtual.com\/anuncio\/apartamento-moderno-em-cabanelas-IDGiZz.html&#8221;,\n                &#8220;created_at&#8221;: &#8220;2018-06-06 17:13:51&#8221;,\n                &#8220;activated_at&#8221;: &#8220;2018-06-06 17:14:08&#8221;,\n                &#8220;modified_at&#8221;: &#8220;2018-06-06 17:23:40&#8221;,\n                &#8220;moderation&#8221;: {\n                    &#8220;reason&#8221;: &#8220;DEL_dados_incorrectos&#8221;,\n                    &#8220;description&#8221;: &#8220;Imovirtual &#8211; An\u00fancio Removido &#8211; Dados Incorrectos&#8221;\n                }\n            },\n            &#8220;last_error&#8221;: null\n        },\n        {\n            &#8220;uuid&#8221;: &#8220;744e7fb5-60d6-4459-b41b-54c5e0eb6220&#8221;,\n            &#8220;last_action_status&#8221;: &#8220;PUT&#8221;,\n            &#8220;last_action_at&#8221;: &#8220;2018-06-06T16:35:41.749+0000&#8221;,\n            &#8220;custom_fields&#8221;: {\n                &#8220;id&#8221;: &#8220;123456&#8221;,\n                &#8220;reference_id&#8221;: &#8220;TEST5678&#8221;\n            },\n            &#8220;state&#8221;: {\n                &#8220;code&#8221;: &#8220;active&#8221;,\n                &#8220;visible_in_profile&#8221;: &#8220;true&#8221;,\n                &#8220;ttl&#8221;: &#8220;2018-07-04T16:01:12.000+0000&#8221;,\n                &#8220;url&#8221;: &#8220;https:\/\/www.imovirtual.com\/anuncio\/apartamento-moderno-em-cabanelas-IDGj2t.html&#8221;,\n                &#8220;created_at&#8221;: &#8220;2018-06-06T17:32:24.000+0000&#8221;,\n                &#8220;activated_at&#8221;: null,\n                &#8220;modified_at&#8221;: &#8220;2018-06-06T17:35:41.000+0000&#8221;,\n                &#8220;moderation&#8221;: null\n            },\n            &#8220;last_error&#8221;: null\n        }\n    ],\n    &#8220;links&#8221;: {\n        &#8220;first&#8221;: {\n            &#8220;href&#8221;: &#8220;http:\/\/api.olxgroup.com\/advert\/v1\/meta&#8221;\n        },\n        &#8220;next&#8221;: {\n            &#8220;href&#8221;: &#8220;https:\/\/api.olxgroup.com\/advert\/v1\/meta?exclusiveStartUuid=744e7fb5-60d6-4459-b41b-54c5e0eb6220&#8221;\n        }\n    }\n}\nCopied to clipboard\n\tPagination\n<p>When making this request you&#8217;ll get 100 results per page. To get the\u00a0<strong>next<\/strong> 100 results you should get the link that&#8217;s available in the <strong>links<\/strong>\u00a0object of the response. In this object, you&#8217;ll also find a link to the\u00a0<strong>first<\/strong> page. If there are no results at all, the<strong> links<\/strong>\u00a0object will be omitted.<\/p>\n<\/crm><\/access><\/your><\/crm><\/access><\/your><\/advert>\n","protected":false},"excerpt":{"rendered":"<p>Get advert metadata &nbsp; If you\u00a0followed the steps of how to process advert notifications, you know that you can be notified about advert status changes through notifications sent directly to your application&#8217;s webhook\/callback URL. Alternatively, we also provide endpoints where you can get the metadata (which includes the status) of a single or all adverts&#8230;  <a href=\"https:\/\/doc.olxgroup.com\/api\/?p=654\" title=\"Read Get advert metadata\">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":[20],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/654"}],"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=654"}],"version-history":[{"count":0,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions"}],"wp:attachment":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}