-
Notifications
You must be signed in to change notification settings - Fork 9
Data api authentication authentication
Taku AMANO edited this page Jul 18, 2013
·
5 revisions
Create new session and access token. This is like login.
This method accepts POST only.
POST https://your-host/your-mt-api.cgi/v1/authentication
Not available.
Not available.
| Parameter | Type | Description |
|---|---|---|
| username | string | The username to authenticate. |
| password | string | The password of the user. |
| remember | boolean | If true (generally, "1" is specified.), a new session will be created as a persistent session. If you want to specify false, you can pass "" or "0" to this parameter. |
| clientId | string | This is not required if you specify session id via "X-MT-Authorization" request header. You can create new access token if you have a session id related to this clientId, although you do not have an access token. |
| mtDataApiLoginMagicToken | string | This is not required if you authenticate except via browser. If this parameter is passed and valid the MT will set cookie in order to start a session. |
| Parameter | Type | Description |
|---|---|---|
| sessionId | string | Session ID. This value is included only when mtDataApiLoginMagicToken is not passed. If mtDataApiLoginMagicToken is passed (and is valid value), sessionId is stored in httponly-cookie. |
| accessToken | string | Access token |
| expiresIn | unsigned integer | This access token will be invalidated automatically after the number of seconds specified here. |
| remember | boolean | If true, a new session has been created as a persistent session. |
| Code | Description |
|---|---|
| 200 | no error |
| 401 | Invalid login |
POST /mt-api.cgi/v1/authentication
Host: www.example.com
HTTP/1.0 200 OK
Content-Type: application/json
Content-length: ...