Curl Loading Data "Unauthorized" Error


I’ve triple checked my Curl command, so I’m fairly certain it’s correct, however, I continually get an “unauthorized” error when I run it in my terminal. (I’m the only person on the project at this moment, so it’s not like I am lacking any permissions) Any ideas what I may be doing wrong?



Could you please post the curl command you are using?


This is the “template” I’m going off of:
curl -v -H “Content-Type: text/csv” -X PUT --data-binary @PATHtoFile
ENVIRONMENT/import/1/TENANT/TAG/CANONICALNAME/File.csv -u ‘Username’: ‘Password’

Do you want to see exactly what I wrote?


Make sure your ENVIRONMENT has https://, not http://?
Or maybe there is a character in username/password that is not being escaped properly? You could always authenticate using a header instead: -H "Authorization: c3authtoken", which you can retrieve from the c3auth cookie after you’ve logged into the C3 static console


Just to clarify - this c3authtoken is supposed to be a string approx 150 chars long? (I tried running it with the authtoken, and it didn’t run, it just opened up extra lines starting with carrots) (I’m sorry, I’m not very familiar with curl-ing)


Yes, that’s the auth token you’re looking for.

The extra lines starting with angle brackets means you have a syntax error in your command, and a single command was not finished. (the same as if you typed echo "Hello, and hit enter/return, the shell would be waiting for a closing double quote character")