Skip to content

Data api authentication token

Taku AMANO edited this page Jul 10, 2013 · 2 revisions

Authentication: token

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}

Request

HTTP Request

This method accepts POST only.

POST https://your-host/your-mt-api.cgi/v1/token

Parameters

Method Parameters

Not available.

Query Parameters

Not available.

Request Body

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.

Response

Parameter Type Description
accessToken string Access token
expiresIn unsigned integer This access token will be invalidated automatically after the number of seconds specified here.

Status Code

Code Description
200 no error

Example

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: ...
Clone this wiki locally