OAuth 2.0 Authentication settings are available at interworks.cloud BSS > Setup > Administration > System Options > API Credentials
Management of OAuth 2.0 Keys and of the Application Users is available in the above section.
interworks.cloud BSS API uses the OAuth 2.0 Resource Owner Password Flow in order to properly authorize and authenticate each request.
The Resource Owner Password Flow
The Resource Owner Password Flow is used to authenticate the consumer supposing that already has the application user’s credentials.
In this flow, the application user’s credentials are used by the application to request an access token by calling Request Token URL end point.
Getting the Access Token
Once OAuth 2.0 Authentication is enabled for an organiztion, the system issues 'Client Key' and 'Client Secret'.
By creating an application user, a set of username / password credentials should also be available.
These values could be used to a HTTP POST request to "/oauth/token" endpoint in order to receive an access_token value.
According to OAuth 2.0 specification, the 'Client Key' and 'Client Secret' value can be sent as request parameters. However, interworks.cloud Plarform accept these values only through basic authentication.
The following example demostrates a call for getting an access token using C# code.
C# Get Access Token Example
using (HttpClient httpClient = new HttpClient())
httpClient.BaseAddress = new Uri("http://my.interworkscloud.com/");
var authorizationHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes("23230e67-6c95-4f83-a176-d969b95ee601:HCHlt6XPXxOveEx4QjECVB4ChgKiLJF65U7qy/xe46k="));
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authorizationHeader);
var form = new Dictionary<string, string>
HttpResponseMessage response = httpClient.PostAsync("bsssmapi/oauth/token", new FormUrlEncodedContent(form)).Result;
string access_token = response.Content.ReadAsStringAsync().Result
The .zip file that you download contains a Visual Studio solution with a .NET Console Application that performs calls for receiving a access token and getting the synchronization options of an account.
Sample Application for JAVA Client
To get the code for the sample application, download the following file
The .zip file that you download contains a solution with a JAVA Application that performs calls for receiving a access token and getting the synchronization options of an account.