Curl. Bad request. No token or api key provided. On login


Any ideas why this does not work?

DreamFactory 2.4.2 RHEL 6.8

curl -i -k -X POST https://host/api/v2/mongodb/user/session -d ‘{ “email” : "", “password” : “password” }’ -H 'Content-Type: application/json’
HTTP/1.1 400 Bad Request
Date: Fri, 03 Feb 2017 23:38:02 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Vary: Cookie
X-Powered-By: PHP/7.0.15
Cache-Control: no-cache
Content-Length: 92
Connection: close
Content-Type: application/json

{“error”:{“context”:null,“message”:“Bad request. No token or api key provided.”,“code”:400}}+ exit

For refn - this does.

curl -s -k
++ local ‘RESULT={“resource”:[{“name”:"_schema"},{“name”:"_table"}]}’


because you’re not logging in with that call.
you’re accessing the mongodb service and trying to append user/session to the end of it. Mongodb service requires an api key and/or session token to operate.
If you want to use sessions, you need to POST user/session first. Then take the session token and use it in your subsequent calls (which will need both a token and an api key)