Get advert metadata

If you followed 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'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.

❗️

Temporary Solution

Using the GET advert metadata endpoint is only a temporary solution to be used during the integration phase or to get information if you lost them for technical reasons.

This request should not be used for final integration. To "get" the status of all adverts or operation 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.

Get metadata of a single advert

Endpoint: GET https://api.olxgroup.com/advert/v1/<ADVERT UUID>/meta

For a single advert you can do the following:

curl --location --request GET 'https://api.olxgroup.com/advert/v1/<ADVERT UUID>/meta'\
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <YOUR API KEY>' \
--header 'Authorization: Bearer <ACCESS TOKEN>' \
--header 'User-Agent: <CRM NAME>'

Here's an example of the response:

{
    "transaction_id": "06ba5533-69b2-11e8-9341-6312550b19ed",
    "message": "Advert status information",
    "data": {
        "uuid": "f7695d17-8ee2-4409-89ac-74c673630edb",
        "last_action_status": "POSTED",
        "last_action_at": "2018-06-06T17:21:05.537+0000",
        "custom_fields": {
            "id": "123456",
            "reference_id": "TEST1234"
        },
        "state": {
            "code": "new",
            "visible_in_profile": "true",
            "ttl": "2018-07-04 16:01:12",
            "url": "https://www.imovirtual.com/anuncio/apartamento-muito-moderno-em-cabanelas-IDGj9u.html",
            "created_at": "2018-06-06 18:21:05",
            "activated_at": null,
            "modified_at": "2018-06-06 18:21:39",
            "moderation": {
                "reason": null,
                "description": null
            }
        },
        "last_error": null
    }
}

Get metadata of all adverts

Endpoint: GET https://api.olxgroup.com/advert/v1/meta

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't want to make a single API call for each one. The following endpoint returns the metadata for all adverts for a given user:

curl --location --request GET 'https://api.olxgroup.com/advert/v1/meta'\
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <YOUR API KEY>' \
--header 'Authorization: Bearer <ACCESS TOKEN>' \
--header 'User-Agent: <CRM NAME>'

Here's an example of what you'll get:

{
    "transaction_id": "58fda4cf-69a8-11e8-ad43-b36032d0fc62",
    "message": "Adverts status information",
    "data": [
        {
            "uuid": "81237759-90a9-468c-8c86-3ef1ca9b4b02",
            "last_action_status": "POSTED",
            "last_action_at": "2018-06-06T16:13:51.976+0000",
            "custom_fields": {
            	"id": "123456",
            	"reference_id": "TEST1234"
        		},
            "state": {
                "code": "moderated",
                "visible_in_profile": "true",
                "ttl": "2018-07-04 16:01:12",
                "url": "https://www.imovirtual.com/anuncio/apartamento-moderno-em-cabanelas-IDGiZz.html",
                "created_at": "2018-06-06 17:13:51",
                "activated_at": "2018-06-06 17:14:08",
                "modified_at": "2018-06-06 17:23:40",
                "moderation": {
                    "reason": "DEL_dados_incorrectos",
                    "description": "Imovirtual - Anúncio Removido - Dados Incorrectos"
                }
            },
            "last_error": null
        },
        {
            "uuid": "744e7fb5-60d6-4459-b41b-54c5e0eb6220",
            "last_action_status": "PUT",
            "last_action_at": "2018-06-06T16:35:41.749+0000",
            "custom_fields": {
                "id": "123456",
                "reference_id": "TEST5678"
            },
            "state": {
                "code": "active",
                "visible_in_profile": "true",
                "ttl": "2018-07-04T16:01:12.000+0000",
                "url": "https://www.imovirtual.com/anuncio/apartamento-moderno-em-cabanelas-IDGj2t.html",
                "created_at": "2018-06-06T17:32:24.000+0000",
                "activated_at": null,
                "modified_at": "2018-06-06T17:35:41.000+0000",
                "moderation": null
            },
            "last_error": null
        }
    ],
    "links": {
        "first": {
            "href": "http://api.olxgroup.com/advert/v1/meta"
        },
        "next": {
            "href": "https://api.olxgroup.com/advert/v1/meta?exclusiveStartUuid=744e7fb5-60d6-4459-b41b-54c5e0eb6220"
        }
    }
}

Pagination

When making this request you'll get 100 results per page. To get the next 100 results you should get the link that's available in the links object of the response. In this object, you'll also find a link to the first page. If there are no results at all, the links object will be omitted.