Unable to get API session token

I followed the Authorizing instructions at https://github.com/metabase/metabase/wiki/Using-the-REST-API

However I keep getting a 400 error: username value must be a non-blank string. Here is the curl command I’m using. Am I missing something here? Majority of our accounts are via google auth but we created a separate account with the same domain with a username/password for API access.

curl -X POST
-H “Content-Type: application/json”
-d ‘{“username”: “email@email.com”, “password”: “mypassword”}’

Hi @cshort-easyagile

Which version of Metabase?
The example you posted on Github used email instead of username - so have you changed that and still getting the same error?

Can you wrap commands in ``` to avoid the forum from messing with the quote formats?
And since you’re not ending the lines with \, are you doing something else to have the command on one line?

This should work fine:

curl -X POST -H "Content-Type: application/json" -d '{"username": "email@email.com", "password": "mypassword"}' https://url/api/session

Otherwise, which version of curl? And have you tried to use Wireshark/tcpdump to see what you’re actually sending is correct?

Thanks I got it working now, I was originally using the Python requests package and was using the data parameter rather than json.