Skip to content

DataAPI SDK english MT.DataAPI Endpoint method authenticate

Taku AMANO edited this page Jul 5, 2013 · 4 revisions

authenticate

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

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

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