Bug: Integration Field - Custom API: missing some results

Hello,

I have built an integration field using a custom api and have reached the point where Prismic has successfully crawled every page of my results. However, when I go to search inside my new integration field, I notice that certain items are missing. The pattern I seem to have found is that Prismic is missing any item with a similar ID to an existing item in the results. For example I have 2 items with the following ID's, but am only seeing Item 1 when searching:

Item 1: "id": "id:L2VGptXKxF4AAAAAAAADVw"
Item 2: "id": "id:L2VGptXKxF4AAAAAAAADvw"

You can see the ID's are almost the same - only that the second-to-last character has different casing. These ID's are associated with Dropbox files I am trying to search/reference in my content, so the ID's are generated on their end and cannot be changed.

Any help with investigating this issue would be greatly appreciated - whether it be a bug or an error on my end.

Thanks,
Dillon

Hey Dillon, welcome to the Prismic community!

I'm not sure what the issue might be. If you want we can try and debug this together. If you could show me a screen recording of the bug it'll be helpful.

Or if it's more complicated you can share with me the access to your project so I can do some checks on my side. For that I'll need a private dm the following information:

  1. Your repo URL
  2. The files of the relevant documents on your dropbox

Thanks

Hello!

I've been having a similar problem. I successfully implemented my API and was making some tests. Initially, it was supposed to return 3 values, one of them being 1234567890987654321. It worked.
Yesterday I've deleted one of those values and changed 1234567890987654321 to 1234567890.
Today, I'm still receiving the original 3 values instead of the current 2.
Maybe there's some cache problem? Or maybe there's some config I was supposed to do missing.

Appreciate any help.
Thanks!

@dmjoyce92 For your case, It's important to note that The integration for Custom APIs is not case sensitive, so that is why the two ids that you are providing to the products are found to be virtually identical by the Integration field.

You'll need to do something like hashing the response for this value (since you cannot modify it yourself) for the product to re-appear.

Hey @ariadne.hostins !

This probably happened because you weren't seeing the most up to date version of your API. The content refresh currently happens every 30 minutes, but this is likely to change in the future.

You can see the last re-sync time in your epo settings > integration fields

1 Like

Hello @dmjoyce92, I've reviewed your Integration and found that the problem comes from the pagination. So, right now your API has too many items for one page (233) and the limit number of entry for each page is 50.

The page number for the API must be passed as a parameter in the url as shown here.

?page=2 

The first page of results will be ?page=1 and so on.

Hi Paulina,

Thanks for the tip, we hashed all the incoming Dropbox file ID's before and updated the ID field in our endpoint results. All the results are loading in now as expected. Thank you so much for your help!

1 Like

Hi Paulina, yes that is my understanding as well. By default I set my endpoint to return all 200+ results, but then restricted it to 50 when viewing each page; i.e. appending the ?page=# querystring to the URL. One other thing I thought to be worth sharing is that the results_size field should always show the total number of results in the API - even when viewing an individual page. So if I were looking at page 1 for example, the results array would only contain the first 50 objects, but the results_size property needed to be set to my total number of results (200+). I assume this is so the crawler knows how many pages it needs to follow before completing. Anyway I have it figured out now, and hope this helps the community going forward

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.