Authentication
Before starting to query data, you must ensure you are authenticated with the system.
You can authenticate using the following endpoint:
https://[subdomain].manageworkonline.com/awt/login
To authenticate follow the steps:
1. Perfrom a POST request to the endpoint:
- Make sure the Content-Type header is set to application/json
- The request Body should be in the following format:
{
"Username":"[yourusername]",
"Password":"[yourpassword]"
}
2. If the authentication is successful the Response will be:
{
"Success": true,
"ErrorMessage": null,
"Data": null
}
3. The request will also return a Cookie: ASP.NET_SessionId, copy the cookie value and add it to any subsequent requests via the following header Authorization, for example like so:
Authorization: Basic [CookieValue]
Example
The following example is in javascript, using jQuery:
function login(success){
$.ajax({
type: "POST",
url: 'https://[subdomain].manageworkonline.com/awt/login',
crossDomain: true,
data: JSON.stringify({
Username: [yourusername],
Password: [yourpassword]
}),
success: success,
dataType: "json"
});
}
Post your comment on this topic.