We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Keith B.7
10 years agoHelpful | Level 7
-uploadSessionStartUrl: example?
Apologies for the barrage of questions - it's only because I'm updating a large class to use API 2. Is there an example of how to use -uploadSessionStartUrl: anywhere? (A Google search brings up ...
Keith B.7
10 years agoHelpful | Level 7
Great, thank you. Okay, so from your answer, I've tracked through the various classes again and mostly got there. So:
1. Once -uploadSessionBatchFinish: completes, its response callback gives you aDBASYNCLaunchEmptyResult object.
2. You can use the .asyncJobId of that empty result object to invoke -uploadSessionBatchFinishCheck:
3. -uploadSessionBatchFinishCheck:'s response callback gives you a DBFILESUploadSessionFinishBatchJobStatus object.
4. You can use the .isComplete property to check the job is finished (or .isInProgress to check it's still in progres).
5. *IF* it is complete, you can call .compete on the job status object to get a UploadSessionFinishBatchResult object.
6. The batch result object has an .entries array. You can then iterate through that to get a DBFILESUploadSessionFinishBatchResultEntry for each upload.
7. For each result entry you check .isSuccess or .isFailure. If .isSuccess, the .success property gives you your meta-data object; if .isFailure, the .failure object gives you the upload error for that file.
Phew! That took a bit of following the chain in the headers.
So, now, only a couple of things elude me:
1. Is there any notification for when the job status changes from .isInProgress to .isComplete? If I call -uploadSessionBatchFinishCheck: from inside the -uploadSessionBatchFinish: response call back, the status is always .isInProgress. So how do I get access to it when it is complete? Am I just supposed to poll every, say, 0.2 seconds or so to check the status? Or is there some way of polling or receiving notifications built into the frameworks?
2. What if the aDBASYNCLaunchEmptyResult object returns .isComplete? In that case, there's no way of getting the .asyncJobId, so I can't call -uploadSessionBatchFinishCheck:, so how do I get the meta-data results in that case?
Many, many thanks for all your patient and informative answers to my many, many questions, by the way!
Thanks and all the best,
Keith
Greg-DB
Dropbox Community Moderator
10 years agoNo problem, and yes, it looks like you have this right.
1. No, you'll just need to poll occasionally.
2. The complete result from finish batch itself is actually not currently used, and is just there for flexibility in the future. We may update that in the future to use that result and include the metadata there, but for now you won't get that.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!