Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hubic, Swift and CURL
Get Endpoint:
curl -H "Authorization: Bearer <AUTHCODE>" https://api.hubic.com/1.0/account/credentials
returns:
{"token":"<AUTHTOKEN>","endpoint":"https://lb1.hubic.ovh.net/v1/<AUTHURL>","expires":"2015-04-01T23:01:08+02:00"}
Get List of files:
curl -H "X-Auth-Token: <AUTHTOKEN>" https://lb1.hubic.ovh.net/v1/<AUTHURL>/default?format=json -i -X GET
LOTS OF JSON HERE!!!
to upload a file:
time curl -i https://lb1.hubic.ovh.net/v1/<AUTHURL>/default/<filename> -X PUT -H "X-Auth-Token: <AUTHTOKEN>" -T <FILENAME>
Should return 201 result
Finally, download a file:
curl -H "X-Auth-Token: <AUTHTOKEN>" https://lb1.hubic.ovh.net/v1/<AUTHURL>/default/<filelocation> -i -X GET -o <output>
@netomx
Copy link

netomx commented Dec 18, 2015

downloading a file doesn't work, as listing the file doesn't give you the location. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment