Authentication - accountsIQ/API-Wiki GitHub Wiki

Our SOAP API supports two versions of authentication: Make sure that your API endpoint matched the version of authentication you are using

  • Version 2.0 – This is the current standard and should be used for all new integrations.
  • Version 1.1 – This version is only supported for existing integrations and will not be used for new integrations. Documentation still available, see below

Note

Version 1.1 is only supported for existing integrations. It will no longer be used for any newly created integrations. To set up new integrations, please refer to the documentation for Version 2.0

Creating an Integrations Application and Inviting a Developer to the Developer Portal

Using the Developer Portal and New API Endpoint

Version 2.0

To get authenticated you will need a Client Id and Client Secret

Getting the Token

C#

Integration_2_0 ws = new Integration_2_0();
var token = ws.TokenGet(<clientId>, <clientSecret>);

 if (tokenGetResponse != null && tokenGetResponse.Result != null)
 {
     this.AccessToken = tokenGetResponse.Result.AccessToken;
     this.RefreshToken = tokenGetResponse.Result.RefreshToken;
 }
 else
 {
     throw new Exception("TokenGet Failed! Could not get an Access Token");
 }

Using the Token

Before you can call a method, you need to set the Token and the Entity ID in the header.

C#

// Set the header to take the token and the entity ID
ws.AiqSoapHeaderValue = new AiqSoapHeader { AccessToken = this.AccessToken, Entity = this.CompanyID };

// Note each method in Version 2.0 has a token as its first parameter. This is here for compatibility and should be left blank, as the token is already set in the header
var result = ws.GetCurrencies(string.Empty);

Refreshing the Token

When you token expires, you will need to refresh it by calling TokenRefresh

C#

...
ws.TokenRefresh(clientId, clientSecret, this.RefreshToken);

 if (tokenRefreshResponse != null && tokenRefreshResponse.Result != null)
 {
     this.AccessToken = tokenRefreshResponse.Result.AccessToken;
     this.RefreshToken = tokenRefreshResponse.Result.RefreshToken;
 }
 else
 {
     throw new Exception("TokenRefresh Failed!");
 }

More on Version 2.0

Learn how to create an Integration Application and invite a developer to the Developer Portal

Learn how to use the Developer Portal and the new API Authentication Endpoints

Version 1.1

To get authenticated simple call the Login method. You will need the CompanyIDny Id, a Partner Id and User Key

C#

Integration_1_1.Integration_1_1 ws = new Integration_1_1.Integration_1_1();
String auth = ws.Login(companyID, partnerKey, userKey);

if (auth != null)
{
  // ...
}

Refreshing the Token

You simple call the same Login Method as above.

More on Version 1.1

Authentication 1.1

See Also

More on Authentication

⚠️ **GitHub.com Fallback** ⚠️