Delayed API Response
David PL
Registered Users Posts: 80 Big grins
Hello,
I'm working on the upload functionality of our software application. We are implementing the software to check the API response to ensure every file was successfully uploaded and to obtain the ImageID and ImageKey for each file. I ran into the following issue:
When uploading very large files (such as videos), the API does not provide a response (i.e., to indicate success and provide the ImageID and ImageKey for the uploaded file). I suspect it may be that the API is waiting until the SM servers fully process the video before it sends a response. However, this delay can be very significant to the point that I cannot set the timeout of my POST call long enough. I am hoping it would be possible for the API to return a more timely response for large files to indicate success along with ImageID and ImageKey.
Thank you
I'm working on the upload functionality of our software application. We are implementing the software to check the API response to ensure every file was successfully uploaded and to obtain the ImageID and ImageKey for each file. I ran into the following issue:
When uploading very large files (such as videos), the API does not provide a response (i.e., to indicate success and provide the ImageID and ImageKey for the uploaded file). I suspect it may be that the API is waiting until the SM servers fully process the video before it sends a response. However, this delay can be very significant to the point that I cannot set the timeout of my POST call long enough. I am hoping it would be possible for the API to return a more timely response for large files to indicate success along with ImageID and ImageKey.
Thank you
0
Comments
The response is returned as soon as the file is copied to S3. What size files are you testing with ? Which upload endpoint are you using ?
Cheers,
David
SmugMug API Developer
My Photos
Just to give an update on this, increasing the timeout to 300 seconds seems to have solved this issue. The delay occurred when uploading ~150MB video files using the 1.2.0 endpoint. With photo uploads the API response is usually within a few seconds, but its understandable the response would be significantly longer for large video files given the additional time to copy the file on the server-side after upload.
Thanks again.