Logging in
From DreamFactory
Toddappleton (Talk | contribs) |
Toddappleton (Talk | contribs) |
||
Line 19: | Line 19: | ||
cURL: | cURL: | ||
− | <pre>curl -i -k -3 -X POST " | + | <pre>curl -i -k -3 -X POST "https://foo.com/api/v2/system/admin/session" -d '{ "email" : "admin@example.com", "password" : "secret" }' -H "Content-Type: application/json"</pre> |
Note: Set remember_me=true to get a JWT (token) that can be refreshed forever (until logout) without authentication.'' | Note: Set remember_me=true to get a JWT (token) that can be refreshed forever (until logout) without authentication.'' | ||
Line 43: | Line 43: | ||
cURL: | cURL: | ||
− | <pre>curl -i -k -3 -X POST " | + | <pre>curl -i -k -3 -X POST "https://foo.com/api/v2/user/session" -d '{ "email" : "user@example.com", "password" : "secret" }' -H "Content-Type: application/json"</pre> |
Note: Set remember_me=true to get a JWT (token) that can be refreshed forever (until logout) without authentication.'' | Note: Set remember_me=true to get a JWT (token) that can be refreshed forever (until logout) without authentication.'' |
Revision as of 19:41, 30 June 2016
Logging in as an Admin
The Admin login API endpoint is api/v2/system/admin/session
Request URL:
POST https://foo.com/api/v2/system/admin/session
Request body:
{ "email": "admin@example.com", "password": "secret", "remember_me": false }
cURL:
curl -i -k -3 -X POST "https://foo.com/api/v2/system/admin/session" -d '{ "email" : "admin@example.com", "password" : "secret" }' -H "Content-Type: application/json"
Note: Set remember_me=true to get a JWT (token) that can be refreshed forever (until logout) without authentication.
Logging in as a User (non-admin)
The non-admin login API endpoint is api/v2/user/session
Request URL:
POST https://foo.com/api/v2/user/session
Request body:
{ "email": "user@example.com", "password": "secret", "remember_me": false }
cURL:
curl -i -k -3 -X POST "https://foo.com/api/v2/user/session" -d '{ "email" : "user@example.com", "password" : "secret" }' -H "Content-Type: application/json"
Note: Set remember_me=true to get a JWT (token) that can be refreshed forever (until logout) without authentication.