List and relist item

  • vaccarisrl
    14 messages
    Italy
    I try to explain my system...

    The item is published on delcampe by api. Then I got the notification: "Seller_Item_Add" with the id_item and the personal_reference, so I can connect my id to delcampe id.

    When the item sell end, I got the notification: "Seller_Item_Close_Unsold", so I resend the item again and I should got another "Seller_Item_Add" with the new id_item, and so on...

    But... doesn't work.

    For the same item (with the same personal_reference that is unique), I got many notifications with different Datetime (timestamp). I've tried to use "notificationDelete" to delete the notifications already received, but "notificationDelete" require a notification id that isn't linked to the "Seller_Item_Close_Unsold" or "Seller_Item_Add". More, using "notificationDelete" is also changed the notification status on or off.

    So, how I can delete the notification relative to the item added and process the next one?

    In the documentation I read:

    "To update a notification to the latest version, you have to disable the older one (by calling the resource NotificationDelete) and set the new one (by calling POST /notification/settings). Doing so, you will have the newest version set automatically."

    But how I can do this correctly and how I can manage multiple items concurrently?

    Thanks.
  • @benjaminl
    Administrator
    88 messages
    Belgium
    Dear Vaccarisrl,

    I think the answer to your question is: you cannot delete notifications from our system.
    You can only disable them.

    So, for me, the best way to proceed is following steps:
    1. retrieve the current status of your notifications settings with this call: GET /notification/settings
    2. call the DELETE /notification/ with the proper id you want only for settings that are enabled.

    That said, I'm not sure to properly understand what you want to do.
    When a sale is over, instead of resending the same item, can't you just restart it?
    You can do this by making a call to the PUT item/<id> service and specify an action parameter with the value "restart".
    Link (https)

    For your notification problem, here is a suggestion:
    when you add notifications ( Link (https) you cannot specify the item id you want to notify, you will receive all the notifications whatsoever.
    So, what you can do is, when you receive a notification, apply a specific treatment according to the item id contained by the notification.

    I hope this answer is what you're seeking.
    Do not hesitate if you need anything else.

    Best regards
  • vaccarisrl
    14 messages
    Italy
    Ok, I've tried to get notifications settings:

    GET /notification/settings
    For example for the Curl_Default type I got:

    [id_notification] => 133827
    [id_user] => 64xxxx
    [channel] => curl
    [type] => Curl_Default
    [destination] => Link (https)
    [active] => 1

    [id_notification] => 133889
    [id_user] => 64xxxx
    [channel] => curl
    [type] => Curl_Default
    [destination] => Link (https)
    [active] => 1

    [id_notification] => 133904
    [id_user] => 64xxxx
    [channel] => curl
    [type] => Curl_Default
    [destination] => Link (https)
    [active] => 1

    [id_notification] => 133919
    [id_user] => 64xxxx
    [channel] => curl
    [type] => Curl_Default
    [destination] => Link (https)
    [active] => 1

    [id_notification] => 133928
    [id_user] => 64xxxx
    [channel] => curl
    [type] => Curl_Default
    [destination] => Link (https)
    [active] => 1

    So, why for the same notification type I've 5 different notifications with different id? What id_notification refers to?

    Thanks...
  • @thomas
    Administrator
    29 messages
    Belgium
    Dear vaccarisrl,

    I think there is a misunderstanding of how notifications work. Notifications in our api are used to set a destination to send notifications. It is not a notification itself.

    In this sense the notificationDelete will not delete notifications but will delete the notification's destination.

    The notifications received are just http calls with xml in the POST data.

    I can see that all your notification's type have 5 copies. Should I disable them ?

    I hope to have been clear.

    Don't hesitate to come back to us if you have any questions on the behavior of notification.

    Best regards
  • vaccarisrl
    14 messages
    Italy
    Yes, you can disable duplicate notifications as they refer all to the same url. Probably I misunderstood how notifications work, but on the documentations it isn't really clear ;)

    So I don't need to activate and deactivate the notification every times server received one notification?

    Or I need to delete/deactivate whenever the server receive one notification to disable the old one and receive the new notification?

    Thanks.
  • @benjaminl
    Administrator
    88 messages
    Belgium
    Dear Vaccarisrl,

    I'll try to clarify this notification system ;):

    First of all, there is a notable difference between 'notification' and 'notification setting'.
    The first one refers to a simple message you will receive. Each notification type has his own structure and data send to you.
    The second one refers to the activation/deactivation of specific notification to a specific URL.

    I'll try to explain this with an example:

    Let's say you want to receive 'Seller_Item_Add' notifications, you will have to call POST notification/settings and specify:
    I want to receive "Curl_Seller_Item_Add" notification type on " Link (http) ".
    Then, you want to receive 'Seller_Item_Close_Unsold' notifications, you will have to call POST notification/settings again and this time, specify: "Curl_Seller_Item_Close_Unsold" as notificationType and your URL " Link (http) ".

    Now, each time one of your items will trigger one of those two notifications you will receive a call to the URL you gave.
    Those settings work as flags: now you posted those settings, you asked our system to send those notifications until the end of time or until you disabled one of them.
    You don't have to do anything more.

    Please note that I used the same URL twice, but this is not mandatory, you can use any URL you want.

    If one of your URLs change, first you have to disable the old one by calling the DELETE notification/{notification_id}.
    Then you can call the POST notification/settings with the new URL for the same notificationType as before.

    To answer your first question:
    Q: "So I don't need to activate and deactivate the notification every times server received one notification?"
    R: no, you don't to do that. As I explained before, you can leave those settings as long as you want.

    Question n°2:
    Q: "I need to delete/deactivate whenever the server receives one notification to disable the old one and receive the new notification?"
    R: You don't need to do anything about those settings between two notifications. The system won't ignore them.
  • @benjaminl
    Administrator
    88 messages
    Belgium
    That said,

    I think your problem is you don't receive all the notifications.

    I can see in our database that you posted five times five different notification types:
    - Curl_Seller_Item_Close_Manually
    - Curl_Default
    - Curl_Seller_Item_Close_Sold
    - Curl_Seller_Item_Add
    - Curl_Seller_Item_Close_Unsold

    First of all: do you want me to remove completely the duplicated notification settings?

    Second of all: if you want to restart a sale, you have to use this call: PUT item/{delcampe_item_id} ( Link (https) ) and don't forget to add '$postData['item']['action'] = 'restart';' parameter, other wise it will manipulate the different informations you specified for your item.

    All that said, if you want me to investigate your case further, I will need the code you're currently using in order to see what's going on.

    I hope all those pieces of information will help you to understand a bit better our documentation.

    If this is not clear enough, feel free to ask more questions :)

    Best regards

    Benjamin - Technical Team Member
  • vaccarisrl
    14 messages
    Italy
    Ok, now is a little more clear ;)

    Yes, please remove duplicated notification settings.

    Then I've another question, why sometimes I got: "Max number of notification by type reach"?

    What means this error?

    Thanks...
  • @benjaminl
    Administrator
    88 messages
    Belgium
    Good morning Vaccarisrl,

    I just clean you notification settings that were inactive.
    You have one left: Curl_Seller_Item_Close_Unsold.

    The error you mentioned is related to the fact you added 5 URLs for the notification type.
    That's mean that, for each notification type, you can only have max 5 URLs related to it.

    Be careful: that limit includes the inactive settings as well. So I suggest you to think through before add notification settings.

    I hope my answer will help you.

    Have a nice day.

    Benjamin
    Technical Team Member
    Delcampe

Join the collectors community

Register Login