Skip to content

DataAPI SDK english MT.DataAPI Endpoint method authenticate

Taku AMANO edited this page Aug 28, 2013 · 4 revisions

Notice

This method is deprecated when useing web browser. When useing web browser, the recommended authentication steps is redirecting to URL acquired by the getAuthorizationUrl method.

authenticate

Create a new session and access token. This is like login.

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

Parameters

Name Type Required Description
callback Function no

Returns

XMLHttpRequest: A XMLHttpRequest object

Example

api.authenticate({
  username: "USERNAME",
  password: "PASSWORD",
  remember: true
}, function(response) {
  if (response.error) {
    // Handle error
    return;
  }

  api.storeTokenData(response);
  api.listEntries(blogId, function(response) {
    // Do stuff
  });
});
Clone this wiki locally