AlexKucera
AlexKucera

@manton I am trying to upload an image via the API, but am getting back “No verified site could be found for token.”

curl -XPOST -H 'Authorization:: Bearer 12345' -d '--form file="/Users/user/myfile.png"' 'https://micro.blog/micropub/media'

Where did I go wrong?

|
Embed
Progress spinner
AlexKucera
AlexKucera

@manton @AlexKucera I found a typo. The double :: in Authorization. But now I get:

> Error while processing the request. Please try again or email help@micro.blog. Check the news blog for updates.

|
Embed
Progress spinner
manton
manton

@AlexKucera I don’t think that -d is right… Can you try with -F "file=@/Users/user/myfile.png"?

|
Embed
Progress spinner
AlexKucera
AlexKucera

@manton while I am also testing with curl this is for an iOS shortcut. No arguments to adjust there.

|
Embed
Progress spinner
AlexKucera
AlexKucera

@AlexKucera @manton fixed the curl:

curl -X POST \
    -H 'Authorization: Bearer 12345' \
    -F 'file=@/Users/user/myimage.png' \
    'https://micro.blog/micropub/media'

still working on the iOS shortcut

|
Embed
Progress spinner
AlexKucera
AlexKucera

@AlexKucera @manton fixed the iOS Shortcut. The key was to use the “Form” type in the Request Body dropdown.

|
Embed
Progress spinner
manton
manton

@AlexKucera Great, glad that’s working! We need to improve the error messages for this.

|
Embed
Progress spinner