Authentication#

Obtaining Credentials#

To access the API, you will need the following credentials:

  • clientId: Your client ID.

  • clientSecret: Your client secret.

These are provided when you register.

SOLO Sandbox Information#

  • Endpoint for Access Token: {{baseurl}}/connect/token

  • Base URL: {{baseurl}}/api/v1/

  • Endpoint Access Example: {{baseurl}}/api/v1/Dividend/GetList?customerIssuerId=1127

Quick Start - Programmatically#

See below for how authentication should work in different languages.

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;

namespace SoloApiExamples
{
    public class TokenRetrieval
    {
        public static async Task<string> GetAuthTokenAsync()
        {
            var clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
            var clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
            var tokenEndpoint = "{{baseurl}}/connect/token";

            using (var client = new HttpClient())
            {
                var requestData = new Dictionary<string, string>
                {
                    { "grant_type", "client_credentials" },
                    { "client_id", clientId },
                    { "client_secret", clientSecret }
                };

                var requestContent = new FormUrlEncodedContent(requestData);
                var response = await client.PostAsync(tokenEndpoint, requestContent);

                if (response.IsSuccessStatusCode)
                {
                    var jsonContent = await response.Content.ReadAsStringAsync();
                    var tokenData = JsonSerializer.Deserialize<Dictionary<string, string>>(jsonContent);
                    return tokenData["access_token"];
                }
                else
                {
                    var errorContent = await response.Content.ReadAsStringAsync();
                    throw new ApplicationException($"Failed to retrieve token: {errorContent}");
                }
            }
        }
    }
}

See also

For additional details, see the authentication code examples above.

Quick Start - Postman#

You can also use the following steps to quickly get started with the API in Postman:

  1. Create a new environment.

  2. Add the following variables to the environment:

    • baseurl: The base URL of the API.

    • clientId: Your client ID.

    • clientSecret: Your client secret.

    • access_token: Your access token.

  3. Change the values for the variables to be the following:

    • baseurl: {{baseurl}}.

    • clientId: Your client ID.

    • clientSecret: Your client secret.

    • access_token: Your access token.

    Note

    You can obtain your access token by following the steps in the Requesting an Access Token in Postman section.

  4. Click “Save.”

  5. Change environment to the environment you just created.

  6. Create New Collection.

  7. Set up an Access Token in Postman.

Note

You can obtain your access token by following the steps in either the Requesting an Access Token in Postman - Bearer Token section, or the Requesting an Access Token in Postman - OAuth2.0 Token section.

  1. Click “Save.”

Note

You should now be authorized.

Requesting an Access Token in Postman#

Requesting an Access Token in Postman - Bearer Token#

  1. Create a New Request.

  2. Set the Request Method to POST.

  3. Set the Request URL to {{baseurl}}/connect/token.

  4. Click on the “Body” tab.

  5. Change the “Body” type to “x-www-form-urlencoded.”

  6. Add the following key/value pairs to the body:

    • grant_type: client_credentials.

    • client_id: {{clientId}}.

    • client_secret: {{clientSecret}}.

    • scope: access_token.

  7. Click on the “Authorization” tab.

  8. Select “Bearer Token” if you already have a token.

  9. Select “Save.”

  10. Select “Send.”

Note

You should now have an access token.

Requesting an Access Token in Postman - OAuth 2.0#

  1. Create a New Request.

  2. Set the Request Method to POST.

  3. Set the Request URL to {{base_url}}/connect/token.

  4. Click on the “Authorization” tab.

  5. Select “OAuth 2.0” if you already have a token.

  6. Check the following:

    • Add authorization data to: Request Headers.

    • Token: {{access_token}}.

    • Header Prefix: Bearer.

    • Grant Type: Client Credentials.

    • Access Token URL: {{baseurl}}/connect/token.

    • Client ID: {{clientId}}.

    • Client Secret: {{clientsecret}}.

    • Scope: access_token.

    • Client Authentication: Send as Basic Auth header.

  7. Click “Get New Access Token.”

  8. Select “Proceed.”

  9. Change Token Name (if desired).

  10. Select “Use Token.”

  11. Select “Send.”

Note

You should now have an access token.

Example Request With Access Token#

Once you have an access_token, you can use it to make authenticated requests to the API.

Include it in the Authorization header as a Bearer token.

  1. Create a New Request.

  2. Set Request Url to the endpoint you want to call.

    Example:

    GET {{baseurl}}/api/v1/Shareholder/Details
    
  3. Set Request Method to correct method.

  4. Select the “Authorization” tab.

    • Type: Bearer Token.

    • Token: {{access_token}}.

  5. Select the “Headers” tab, and add the following header:

    • Content-Type: application/json.

  6. Select “Params” tab, and add any required parameters.

    Example:

    CustomerShareholderId: 102322
    
  7. Select “Save.”

  8. Select “Send.”

Note

You can also copy the request url below and paste it into the request url field in Postman.

Request URL:

{{baseurl}}/api/v1/Shareholder/Details?CustomerShareholderId=102322

SOLO Header Requirements#

When making API requests, SOLO may require you to include additional headers:

  • Authorization: The access token. Required for all requests.

Note

Typically, this is automatically populated by the API client.

  • Content-Type: application/json. Required for POST and PUT requests.