Using the search API doesn't return new creations
I have a job that runs and creates files and folders based on data users put into our external system. However, I need to check if the folder exists first so if it doesn't, I can create the folder and assign the folder id as the file's parent and if it does, I can do the same for the already existing folder. The problem is, in my testing, I create a folder through the api, then hit https://api.box.com/2.0/search?query=&type=folder to query it and nothing comes back. After about 30 seconds to a minute, I can query again and the folder data comes back correctly. This will be a problem if a user adds multiple files to the folder within that 30 seconds to one minute. Am I missing something here?
-
I just looked at the documentation again and saw where new items are only available to search after 10 minutes. Is there a way around this? Maybe a way to use an external id for lookup? There doesn't seem to be much point in an integration if we can't tie objects to our external ids and query them immediately.
-
Hello,
Why do you need the search API for what you are doing?
Send the API call to create the folder. If that name doesn't yet exist, the folder will be created, the API call will succeed, and it will send you a response. That response will contain the ID of the newly created folder.
If the name is already in use, the error response should contain info (including the ID) of the folder that already exists.
-
Hello ,
only as an extra piece of knowledge... metadata indexing time is not only on creation time but also on removal. I mean, the 10 minutes period needed for the documents to be indexed when you add metadata also happens when you remove metadata.
So, you can remove metadata from a file but you will find it when you search for it during that window of time.
Regards,
投稿コメントは受け付けていません。
コメント
6件のコメント