‎04-12-2021 09:21 AM - edited ‎07-22-2021 03:23 PM
Hi!
Where can I get “itemReferenceId" for the items that I want to fetch the details for via the API? Looked in the IM but nothing there.
Thanks,
Artur
Hello, Artur. Thank you for reaching out to us via our community platform. Please make sure to review the API docs on the Developer Website as well.
To answer your question, this is the location for the FIRST item in the json response. It is the itemIdentificationInformation section near the top of each item. If you are looking at document json formatted (so it is not all on 1 line), depending on the font size, it will be at the bottom of the first page, or if you page down once it should be visible
Hello, I have written a system that loops through a list of GLNs and fetches all the GLN's items. Then it compares the newly fetched items to my database of items saved from the last fetch. Changed items are updated, new ones are added.
This system may be a lot of unnecessary work, so I am considering using the lastModifiedDate (from and to) in the fetch request. With this I can request only items from a GLN that have been modified since the system last run. However there are scenarios that would easily miss item data like this:
Similarly a GLN that we receive item data from publishes a new item to us that has an old lastModifiedDate. This item would not be sent to us if we used the lastModifiedDate in the fetch request.
This problem is much bigger when fetching items from the "public" GDSN where the fetch returns millions of items. If an item is added to the public network with an old lastModifiedDate we would not retrieve it if we used the lastModifiedDate in the fetch request.
Is there a solution here that doesn't require a full GLN fetch?
Thank you for reaching out to our customer community. Welcome.
I'll discuss this with our API escalation teams and circle back with an update later today.
Thank you DanV.
It's been a week, do you have any updates?
Hi @tduncan
Apologies for the delay. You would need to pull all items on the first fetch then after, depending on how often you pull data, fetch deltas using lastmodifieddate>= previous date (delta fetch on 04/25 would use lastmodifieddate>=04/24, delta fetch on 04/26 would use lastmodifieddate>= 04/25, etc) if pulling deltas daily, or if skipping days in between delta fetch you would use the lastmodifieddate>= date of last fetch.
Hi @DanV , thanks for getting back to me.
That doesn't address the problem I described in the original post. Perhaps an example would help:
Nestle publishes 3 items to me, GTINs 1, 2, & 3 for simplicity, all with lastModifiedDates of 04/01. I fetch them successfully using lastModifiedDate>=previous date. Things break when Nestle publishes an old item to me with an older lastModifiedDate. Today Nestle publishes GTIN 4 with a lastModifiedDate of 01/01. When Nestle publishes that item on 04/26, and I fetch >=04/25, I don't receive GTIN 4 because it's lastModifiedDate is earlier. I will never receive GTIN 4 using this algorithm until Nestle modifies GTIN 4 in the future.
Does that help clarify the problem? Given the above, I conclude that I must always fetch all items (which is quite a lot in the public case) and filter out the new/updated ones. Is there a better way?
Hello @tduncan and welcome back to the customer community!
Thank you for sharing the above details to help clarify the problem. I will escalate this to our API team for further discussion and you should receive a ticket number via email shortly.