0

I have sent the following request to Vimeo:

curl -X POST https://api.vimeo.com/me/videos -H "Authorization: bearer XXXXXX" -H 'Accept:application/vnd.vimeo.*+json;version=3.4' -H 'Content-Type:application/json' -d '{"upload":{"approach":"tus","size":"999999"}}'

I have tried every combination of single quote, double quotes, space, no space in the request. But the only valid response I can get is the following values in the form parameters:

    "complete_uri": null,
    "approach": "post",
    "size": null,
    "redirect_url": null,
    "link": null
},
"transcode": {
    "status": "in_progress"
}

Where am I going wrong?

Magzy
  • 73
  • 9
crecy
  • 29
  • 4

1 Answers1

0

I think this is your answer: https://stackoverflow.com/a/15828662/3704546

tldr, using curl in Windows you'll need to use double-quotes and escape them in the data with \. So your request should look like this:

curl -X POST https://api.vimeo.com/me/videos -H "Authorization: bearer XXXXXX" -H "Accept:application/vnd.vimeo.*+json;version=3.4" -H "Content-Type:application/json" -d "{\"upload\":{\"approach\":\"tus\",\"size\":\"999999\"}}"
Tommy Penner
  • 2,910
  • 1
  • 11
  • 16
  • 1
    Brilliant. Many thanks. In fact, the link you gave provided the answer. Single quotes are apparently a no no with curl in Windows. Here is the code that works: – crecy Apr 01 '20 at 17:51
  • 1
    curl -X POST https://api.vimeo.com/me/videos -H "Authorization: bearer XXXXXXX" -H "Accept:application/vnd.vimeo.*+json;version=3.4" -H "Content-Type:application/json" -d "{\"upload\":{\"approach\":\"tus\",\"size\":\"999999\"}}" – crecy Apr 01 '20 at 17:52
  • @crecy Yes! That was it, thanks for clarifying. I knew Windows was an either/or situation with types of quote characters. – Tommy Penner Apr 03 '20 at 17:55