Logging in

From DreamFactory
Jump to: navigation, search
(Created page with "### Tutorial ### Log in as an Admin The Admin login API is api/v2/system/admin/session #### API Endpoint <pre>POST https://your-url/api/v2/system/admin/session</pre> <sour...")
Line 7: Line 7:
 
#### API Endpoint
 
#### API Endpoint
  
<pre>POST https://your-url/api/v2/system/admin/session</pre>
+
<pre>POST https://{url}/api/v2/system/admin/session</pre>
 +
Request body:
 
<source lang="JavaScript">
 
<source lang="JavaScript">
 
{
 
{
Line 18: Line 19:
 
#### Example - Logging in as an Admin
 
#### Example - Logging in as an Admin
  
<pre>POST https://your-url/api/v2/system/admin/session</pre>
+
* Request body:
 
<source lang="JavaScript">
 
<source lang="JavaScript">
 
{
 
{
Line 26: Line 27:
 
}
 
}
 
</source>
 
</source>
 +
* Request URL:
 +
<pre>POST https://foo.com/api/v2/system/admin/session</pre>
  
Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication.  
+
> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._
  
 
### Log in as an User (non-admin)
 
### Log in as an User (non-admin)
Line 35: Line 38:
 
#### API Endpoint
 
#### API Endpoint
  
<pre>POST https://your-url/api/v2/user/session</pre>
+
<pre>POST https://{url}api/v2/user/session</pre>
 +
Request body:
 
<source lang="JavaScript">
 
<source lang="JavaScript">
 
{
 
{
Line 46: Line 50:
 
#### Example - Logging in as an User (non-admin)
 
#### Example - Logging in as an User (non-admin)
  
<pre>POST https://your-url/api/v2/user/session</pre>
+
* Request body:
 
<source lang="JavaScript">
 
<source lang="JavaScript">
 
{
 
{
Line 54: Line 58:
 
}
 
}
 
</source>
 
</source>
 +
* Request URL:
 +
<pre>POST https://foo.com/api/v2/user/session</pre>
  
Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication.
+
> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._

Revision as of 21:56, 13 October 2015

      1. Tutorial
      1. Log in as an Admin

The Admin login API is api/v2/system/admin/session

        1. API Endpoint
POST https://{url}/api/v2/system/admin/session

Request body:

{
  "email": "user_email",
  "password": "password",
  "remember_me": bool
}
        1. Example - Logging in as an Admin
  • Request body:
{
  "email": "[email protected]",
  "password": "secret",
  "remember_me": false
}
  • Request URL:
POST https://foo.com/api/v2/system/admin/session

> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._

      1. Log in as an User (non-admin)

The User login API is api/v2/user/session

        1. API Endpoint
POST https://{url}api/v2/user/session

Request body:

{
  "email": "user_email",
  "password": "password",
  "remember_me": bool
}
        1. Example - Logging in as an User (non-admin)
  • Request body:
{
  "email": "[email protected]",
  "password": "secret",
  "remember_me": false
}
  • Request URL:
POST https://foo.com/api/v2/user/session

> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._