Publish Advert

Event flow name: publish_advert

This flow group events related to advert publish operations. For each operation/request made, there’s a success and an error event. For each event, you will find the code of the advert. These codes represent the status of the advert on the target site. See more on Advert Status Codes.

Further below you can see notification examples for each one of the events described.

POST

Event Type Description Code Next Available Operations
advert_posted_success Advert was successfully created and published active PUT DELETE DEACTIVATE
advert_posted_error Advert was NOT successfully created or published unpaid empty code POST


Follow examples of notifications sent for each event type described above:

advert_posted_success


{
  "destination": "*****************************",
  "timestamp": 1602838954660,
  "event_timestamp": 1602838954660,
  "transaction_id": "bdc2a547-da40-4deb-8c77-3bb174036ac5",
  "object_id": "ea17f17b-9671-4487-9043-ee9026c066a2",
  "flow": "publish_advert",
  "data": {
    "activated_at": null,
    "code": "active",
    "created_at": "2020-10-13T13:52:53.000+0000",
    "modified_at": "2020-10-16T09:02:34.000+0000",
    "ttl": "2020-11-12T14:52:56.000+0000",
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_posted_success"
}

advert_posted_error

This example shows the message for a posting request when the client doesn’t have a package or available insertions. There are different messages, for example, depending on the validation errors. These validation messages come directly from the site. More validation rules can be applied. Check out Advert payload and validation rules.


{
  "destination": "*****************************",
  "timestamp": 1602843883820,
  "event_timestamp": 1602843883820,
  "transaction_id": "ccaa0505-2c7c-45eb-8e68-3ba6e39f4b2f",
  "object_id": "58270dbb-c623-4ed9-9ab0-d1bd13e2a056",
  "flow": "publish_advert",
  "error_message": "Adding the ad failed.",
  "data": {
    "detail": "Adding the ad failed.",
    "title": "AdvertsPostingException",
    "validation": [
      {
        "detail": "Marca has an invalid value",
        "field": "urn:concept:marca",
        "title": "Error"
      }
    ]
  },
  "event_type": "advert_posted_error"
}

PUT

Event Type Description Code Next Available Operations
advert_put_success Advert was successfully updated, and remains published active PUT DELETE DEACTIVATE
Advert was successfully updated, but is temporarily unpublished, due to package expiration outdated_by_package PUT DELETE
advert_put_error Advert was NOT successfully updated, but remains published active PUT DELETE DEACTIVATE
Advert was NOT successfully updated, was not even created unpaid empty code POST
Advert was NOT successfully updated, and remains unpublished moderated outdated removed_by_moderated (No operation allowed)
removed_by_user POST or ACTIVATE (depending on the last operation)
outdated_by_package PUT DELETE


Follow examples of notifications sent for each event type described above:

advert_put_success


{
  "destination": "*****************************",
  "timestamp": 1602846166856,
  "event_timestamp": 1602846166856,
  "transaction_id": "3232cdc9-e14e-478a-88db-b9886cfd6710",
  "object_id": "ea17f17b-9671-4487-9043-ee9026c066a2",
  "flow": "publish_advert",
  "data": {
    "activated_at": null,
    "code": "active",
    "created_at": "2020-10-13T13:52:53.000+0000",
    "modified_at": "2020-10-16T11:02:45.000+0000",
    "ttl": "2020-11-12T14:52:56.000+0000",
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_put_success"
}

advert_put_error

This example shows the message for an updating request for an advert that was not successfully created/posted. In this case, the advert in fact doesn’t exist.


{
  "destination": "*****************************",
  "timestamp": 1602844812080,
  "event_timestamp": 1602844812080,
  "transaction_id": "e98edb18-6450-4b3e-a0fa-d8d89b58bdfb",
  "object_id": "58270dbb-c623-4ed9-9ab0-d1bd13e2a056",
  "flow": "publish_advert",
  "error_message": "Advert with specified external identifer 58270dbb-c623-4ed9-9ab0-d1bd13e2a056 not found for the user.",
  "data": {
    "detail": "Advert with specified external identifer 58270dbb-c623-4ed9-9ab0-d1bd13e2a056 not found for the user.",
    "title": "NotFoundException",
    "validation": null
  },
  "event_type": "advert_put_error"
}

DELETE

Event Type Description Code Next Available Operations
advert_deleted_success Advert was successfully deleted, and was unpublished removed_by_user (no longer visible in profile) POST
advert_deleted_error Advert was NOT successfully deleted, and remains published active PUT DELETE DEACTIVATE
Advert was NOT successfully deleted, was not even created unpaid empty code POST
Advert was NOT successfully deleted, and remains unpublished(these adverts were already deleted previously) moderated outdated removed_by_moderated (No operation allowed)
removed_by_user POST or ACTIVATE (depending on the last operation)
outdated_by_package PUT DELETE


Follow examples of notifications sent for each event type described above:

advert_deleted_success


{
  "destination": "********************************************",
  "timestamp": 1603205952227,
  "event_timestamp": 1603205952544,
  "transaction_id": "82fa2904-6ea4-4221-876e-da15079aa195",
  "object_id": "866ba664-5b73-4659-b6e4-405fd6ae7c7d",
  "flow": "publish_advert",
  "data": {
    "activated_at": "2020-10-20T08:28:24.000+0000",
    "recorded_at": "2020-10-20T14:59:12.227+0000",
    "code": "removed_by_user",
    "moderation": {
      "reason": null,
      "description": null
    },
    "created_at": "2020-10-16T14:27:10.000+0000",
    "modified_at": "2020-10-20T14:59:09.000+0000",
    "ttl": "2020-11-15T15:27:14.000+0000",
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_deleted_success"
}

advert_deleted_error

This example shows the message for a delete request for an advert that was previously deleted.


{
  "destination": "*********************************************",
  "timestamp": 1603205989662,
  "event_timestamp": 1603205989662,
  "transaction_id": "8747611e-13bb-4d68-8ea6-50e7a616dcb1",
  "object_id": "866ba664-5b73-4659-b6e4-405fd6ae7c7d",
  "flow": "publish_advert",
  "error_message": "You can't delete a previously deleted advert",
  "data": {
    "activated_at": "2020-10-20T08:28:24.000+0000",
    "recorded_at": "2020-10-20T14:59:12.487+0000",
    "code": "removed_by_user",
    "moderation": {
      "reason": null,
      "description": null
    },
    "created_at": "2020-10-16T14:27:10.000+0000",
    "detail": "You can't delete a previously deleted advert",
    "title": "ForbiddenException",
    "modified_at": "2020-10-20T14:59:12.000+0000",
    "ttl": "2020-10-20T14:59:12.000+0000",
    "validation": null,
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_deleted_error"
}

DEACTIVATE

Event Type Description Code Next Available Operations
advert_deactivate_success Advert was successfully deactivated, and was unpublished removed_by_user (still visible in profile) ACTIVATE DELETE
advert_deactivated_error Advert was NOT successfully deactivated, and remains published active PUT DELETE DEACTIVATE
Advert was NOT successfully deactivated, was not even created unpaid empty code POST
Advert was NOT successfully deactivated, and remains unpublished(these adverts were already deleted previously) moderated outdated removed_by_moderator (No operation allowed)
removed_by_user POST or ACTIVATE (depending on the last operation)
outdated_by_package PUT DELETE


Follow examples of notifications sent for each event type described above:

advert_deactivated_success


{
  "destination": "**************************************",
  "timestamp": 1603205791027,
  "event_timestamp": 1603205791883,
  "transaction_id": "4da1b040-058b-4b55-9f7d-b3639d1cabdb",
  "object_id": "866ba664-5b73-4659-b6e4-405fd6ae7c7d",
  "flow": "publish_advert",
  "data": {
    "activated_at": "2020-10-20T08:28:24.000+0000",
    "recorded_at": "2020-10-20T14:56:31.027+0000",
    "code": "removed_by_user",
    "moderation": {
      "reason": null,
      "description": null
    },
    "created_at": "2020-10-16T14:27:10.000+0000",
    "modified_at": "2020-10-20T14:56:27.000+0000",
    "ttl": "2020-11-15T15:27:14.000+0000",
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_deactivated_success"
}

advert_deactivated_error

This example shows the message for a deactivation request for an advert that was already removed by a delete operation, so no longer active or even published.


{
  "destination": "**********************************",
  "timestamp": 1603205822480,
  "event_timestamp": 1603205822480,
  "transaction_id": "dede5024-c42c-4007-ba57-7cfaa0a08cfa",
  "object_id": "866ba664-5b73-4659-b6e4-405fd6ae7c7d",
  "flow": "publish_advert",
  "error_message": "The advert must be active",
  "data": {
    "activated_at": "2020-10-20T08:28:24.000+0000",
    "recorded_at": "2020-10-20T14:56:31.027+0000",
    "code": "removed_by_user",
    "moderation": {
      "reason": null,
      "description": null
    },
    "created_at": "2020-10-16T14:27:10.000+0000",
    "detail": "The advert must be active",
    "title": "BadRequestException",
    "modified_at": "2020-10-20T14:56:27.000+0000",
    "ttl": "2020-11-15T15:27:14.000+0000",
    "validation": null,
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_deactivated_error"
}

ACTIVATE

Event Type Description Code Next Available Operations
advert_activate_success Advert was successfully activated, and published active PUT DELETE DEACTIVATE
advert_activate_error Advert was NOT successfully activated, and remains already published active PUT DELETE DEACTIVATE
Advert was NOT successfully activated, was not even created unpaid empty code POST
Advert was NOT successfully activated, and remains unpublished moderated outdated removed_by_moderated (No operation allowed)
removed_by_user POST or ACTIVATE (depending on the last operation)
outdated_by_package PUT DELETE


Follow examples of notifications sent for each event type described above:

advert_activated_success


{
  "destination": "****************************************",
  "timestamp": 1603205866623,
  "event_timestamp": 1603205867449,
  "transaction_id": "aff420de-08fe-4d6c-b5c1-798320946236",
  "object_id": "866ba664-5b73-4659-b6e4-405fd6ae7c7d",
  "flow": "publish_advert",
  "data": {
    "activated_at": "2020-10-20T08:28:24.000+0000",
    "recorded_at": "2020-10-20T14:57:46.623+0000",
    "code": "active",
    "moderation": {
      "reason": null,
      "description": null
    },
    "created_at": "2020-10-16T14:27:10.000+0000",
    "modified_at": "2020-10-20T14:57:43.000+0000",
    "ttl": "2020-11-15T15:27:14.000+0000",
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_activated_success"
}

advert_activated_error

This example shows the message for an activation request for an advert that was removed by a delete operation. So, no activation is possible, since the advert has definitely been removed, not temporarily as a deactivation. Activation is possible only after a Deactivation request.


{
  "destination": "**********************************************",
  "timestamp": 1603205897436,
  "event_timestamp": 1603205897436,
  "transaction_id": "3c46bab0-1fb8-4c31-8069-8a5b8bf0fc7d",
  "object_id": "866ba664-5b73-4659-b6e4-405fd6ae7c7d",
  "flow": "publish_advert",
  "error_message": "This advert is already active",
  "data": {
    "activated_at": "2020-10-20T08:28:24.000+0000",
    "recorded_at": "2020-10-20T14:57:46.623+0000",
    "code": "active",
    "moderation": {
      "reason": null,
      "description": null
    },
    "created_at": "2020-10-16T14:27:10.000+0000",
    "detail": "This advert is already active",
    "title": "BadRequestException",
    "modified_at": "2020-10-20T14:57:43.000+0000",
    "ttl": "2020-11-15T15:27:14.000+0000",
    "validation": null,
    "url": "https://www.olx.ro/d/oferta/qatest-mercury-parte-de-carro-de-ganda-mercedes-stg-urnsiteolxro-IDbi3Mq.html"
  },
  "event_type": "advert_activated_error"
}

Image Error

For POST, PUT and ACTIVATE request, the image will be added or updated to our DB, if any changes are identified on the new request. So, for each image that when an error, as a partner you will receive a notification like the one below, per image with error.

advert_image_error

The advert image was NOT successfully inserted due to non-compliance with validation rules.


{
  "destination": "https://myawesomeapp.com/webhooks",
  "timestamp": 1524148443449,
  "event_timestamp": 1531735505952,
  "transaction_id": "b5c3207c-43dc-11e8-a4a3-69e0c5b11f9f",
  "object_id": "5e606bdb-3efd-45d2-8cd5-bbb75506aaee",
  "flow": "publish_advert",
  "error_message": "width (128) is lower than the minimum of width (300) and height (128) is lower than the minimum of height (300)",
  "data": {
    "detail": "width (128) is lower than the minimum of width (300) and height (128) is lower than the minimum of height (300)",
    "title": "Dimensions not appropriate for image http://someurl.com/some-image.jpg"
  },
  "event_type": "advert_image_error"
}

Check out the most common errors you can receive related to publishing an advert here: Troubleshooting .