Hey
Wondering about the API documentation for this one, as I’d like to get a Shortcut, or Drafts action, going.
Asking for a friend. And I mean it
Hey
Wondering about the API documentation for this one, as I’d like to get a Shortcut, or Drafts action, going.
Asking for a friend. And I mean it
I haven’t added anything to the official documentation because I was just getting ready to completely overhaul that (more info on that soon). But I don’t want to keep anyone waiting, so here’s a quick explanation of the upload endpoint (which is what I imagine most people care about):
POST https://api.omg.lol/address/:address/pics/upload
Authorization: Bearer Token (API Key)
POST payload can consist of:
data:
URI
pic
key containing base64-encoded binary image dataYou’ll receive a response like this:
{
"request": {
"status_code": 200,
"success": true
},
"response": {
"message": "Your picture has been uploaded.",
"id": "64120bb50a8c7",
"size": 9445,
"mime": "image/png",
"url": "https://cdn.some.pics/adam/64120bb50a8c7.png"
}
}
Unfortunately I don’t yet have a way to set a description in the same call (I’ll set it up soon, though). Until then, you can make a second call to set the description like this:
POST https://api.omg.lol/address/:address/pics/:id
(:id
is the same ID returned value above)
{"description": "Your picture description here"}
Hope this helps!
Yay! Thanks, it helps, a lot. Now let’s see if I can get it to work
Is there an API for accessing all photos posted to some.pics yet?
There wasn’t, but there is now!
GET https://api.omg.lol/pics
Let me know if you have any feedback on the response!
Thanks! How about a list instead of dictionary?
Sorry, I’m forever messing that up. Should be better now!
No worries! Thanks, looks great!
I’m getting a 413 error for payloads greater than 3MB on the endpoint. I’ve tested a 5.33MB and a 3.8MB in all three payload types (raw, uri, and json). Smaller files <=3MB seem to work fine. Uploading larger files via web interface works without issue.
I was expecting files <=8MB to be accepted like the web interface. Am I doing something wrong or is there a restriction I missed?
I don’t think you’re doing anything wrong — I’m going to dig into some logs and try to see what’s going on with this. Stay tuned!