One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Aadi12
2 years agoExplorer | Level 4
Error, When using Batch Operation
hello,
When I use batch operation like Create folder in batch
The operation perform but it show this kind of error
Indivisual operation like Create folder, Copy File is working fine and give the JSON also but in Batch operation this error
Cannot convert to JSON, detail: Invalid tag: required Tag.COMPLETE, but was Tag.ASYNC_JOB_ID (through reference chain: com.dropbox.core.v2.files.CreateFolderBatchLaunch["completeValue"])
- Aadi12Explorer | Level 4
Yes, I make Custom Snap Using API
- Greg-DB
Dropbox Staff
Aadi12 It looks like you're using the Dropbox Java SDK to create some folders. When using createFolderBatch or createFolderBatchBuilder functionality, the resulting CreateFolderBatchLaunch may indicate either "launch an asynchronous job or complete synchronously". That being the case, you'll need to check which type it is before attempting to use it as that type.
The error you're getting indicates that you're calling CreateFolderBatchLaunch.getCompleteValue on an object that isn't tagged as "complete". You should call CreateFolderBatchLaunch.isComplete first; only if that returns true should you then use CreateFolderBatchLaunch.getCompleteValue.
You should likewise use CreateFolderBatchLaunch.isAsyncJobId to check if it is instead an async job ID, and if so then use CreateFolderBatchLaunch.getAsyncJobIdValue to get the value and use createFolderBatchCheck to check on the job.
For example, if you're doing something like this:
CreateFolderBatchLaunch createFolderBatchLaunch = client.files().createFolderBatch(foldersToCreate);
Then just doing this would be incorrect, since you're not checking if the object is actually "complete" first:
System.out.println(createFolderBatchLaunch.getCompleteValue());
Instead, you need to do something like this:
if (createFolderBatchLaunch.isComplete()) { System.out.println(createFolderBatchLaunch.getCompleteValue()); // handle completed operation as desired... } else if (createFolderBatchLaunch.isAsyncJobId()) { System.out.println(createFolderBatchLaunch.getAsyncJobIdValue()); // use createFolderBatchCheck to poll for the job status... } else { // fallback behavior... }
- Aadi12Explorer | Level 4
Thank you !. Error have resolved
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 10 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!