Closed SviMik closed 3 years ago
@SviMik may I know how do you upload the images? with a script?
I wrote my own uploading program using your API documentation and some examples I found on the Internet.
@SviMik could you post the code you wrote?I want to know the order you call the API, and how you handle the errors?
Sure: https://gist.github.com/SviMik/296eee288dcc101b8b60b81bc0ac3f90
The code is large, so you may want to look into specific functions: openstreetcam_new_sequence
, openstreetcam_upload
and openstreetcam_close_sequence
called from thread_ul
. There are 10 attempts to create a sequence with 5 second pause between attempts, same with uploading image and closing the sequence. Don't mind the threading, the whole OSC interaction happens from a single thread.
I'm using curl, so I'm checking for CURLE_OK return code and the HTTP code to be 200. The error handling works fine, and just repeating the exactly same request works, so I'm more concerned about OSC backend and why it gives such weird errors messages.
@SviMik when you use openstreetcam_new_sequence to create sequence_id, what is the param platformVersion value?
Here is some info about the params: obdInfo: 0 or 1 platformName: string, len(1, 100) platformVersion: string, 1<= value <= 25
When you request the URL /1.0/sequence with files in it, you must make sure that the contents of the file corresponding to metedata are not empty.
@SviMik If it's convenient, could you help to post the curl /1.0/sequence and /1.0/photo ?
I use platformVersion to store my own track ID (haven't found any auxiliary field that can be used for that purpose), for example, 8WTWJPm0eTikBSE8tlOzVg
. It is text and is within the 1<= value <= 25 limitation. Other than that the code is pretty self-explanatory, obdInfo is always 0
and platformName is always photosync
.
An example of /1.0/sequence:
obdInfo=0&platformName=photosync&platformVersion=8WTWJPm0eTikBSE8tlOzVg&access_token=redacted
Do you think there's an error in my requests? I mean, if there was, then repeating the same request again wouldn't succeed, would it?
Sorry, I think I made a mistake. The param platformVersion type is string, and the value length is [1, 25].
@SviMik Hi bro, I have a question about your account. Is your account username sanchi ?
No, my account is svimik. But other people use my uploader too.
@SviMik When request /1.0/sequence, could you help to add param validation? Could you please help to validate the param platformVersion, which length is [1, 25]. And I have a question about the request /1.0/sequence. When you request /1.0/sequence, will you upload a file called meteData in the request parameters?
platformVersion is limited by %.25s
on line 657. No, I do not upload metadata file, only images.
@SviMik , are you still suffering from this issue? If not, could we close this ticket?
No matter how many servers I use, I'm able to upload only 250k images per day, or 5MB/s in total. Judging by the fact that creating a sequence takes sometimes up to 14 seconds it is likely that the problem is the database server performance rather than bandwidth.
Sometimes I receive errors from the API, here is my collection:
While this error sounds like I did something wrong with the auth, in fact just repeating the exact same request again succeeds:
I know these messages aren't particularly useful, but sometimes the API just gives a 502 or 504 error: