Data api authentication token
Taku AMANO edited this page Jul 10, 2013
·
2 revisions
Create new access token related to current session.
In order to create new access token, in the case of a web browser, it is necessary to create session via authentication endpoints beforehand.
In the case of other than a browser, it is necessary to send a sessionId that is retrieved via authentication endpoints in MTAuth request header.
MTAuth sessionId={retrieved sessionId}
This method accepts POST only.
POST https://your-host/your-mt-api.cgi/v1/token
Not available.
Not available.
Parameter | Type | Description |
---|---|---|
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. |
Parameter | Type | Description |
---|---|---|
accessToken | string | Access token |
expiresIn | unsigned integer | This access token will be invalidated automatically after the number of seconds specified here. |
Code | Description |
---|---|
200 | no error |
POST /mt-api.cgi/v1/token
Host: www.example.com
X-MT-Authorization: MTAuth=xxxxxxxxxxxxxxxxxxxxxxxx
HTTP/1.0 200 OK
Content-Type: application/json
Content-length: ...