The API is an SSL only. You must be a verified user with the proper security role to make API requests. You can authorize against the API using an OAuth access token.
To obtain a token, you will need to post your username and password to https://api.supportbench.net/oauth/token with a grant type of password.
var credentials = {grant_type: "password",username: "[email protected]",password: "123456789"};
$.ajax({
type: "post",
url: "https://api.supportbench.net/oauth/token",
data: credentials,
contentType: 'application/x-www-form-urlencoded',
success: function (result) {
alert(r.access_token);
}
});
Storing your new token
There are several ways to store your token for use. Each token expires after 7 days of being issued, so that token will need to be renewed every 7 days.
- HTML5 Web Storage (localStorage/sessionStorage)
- Cookies
- Code behind
We highly suggest using cookies if you are using local storage to avoid XSS vulnerabilities or server side storage (PHP, .NET, Ruby, etc..).