-
Couldn't load subscription status.
- Fork 5
DataAPI SDK english MT.DataAPI Endpoint method authenticate
Taku AMANO edited this page Aug 28, 2013
·
4 revisions
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.
Create a new session and access token. This is like login.
POST https://your-host/your-mt-api.cgi/v1/authentication Detail
| Name | Type | Required | Description |
|---|---|---|---|
| callback | Function | no |
XMLHttpRequest: A XMLHttpRequest object
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
});
});