The API Service Connection is a configuration within your API Service and determines how you connect to it.

API Service Connection allows you to create multiple connections to a single vendor as different users. It uses the same set of mappings across all the associated Connections. Each Connection is tied to a single API Service. For example, if you want to use a different connection other than the default Connection, you would configure a new API Service Connection.

Adding a New API Service Connection

From the API Service Detail:

  1. [Click] .
  2. [Enter] the appropriate information. See the table below for the appropriate workflow.
  3. [Click]  once the information is entered.

 

Authentication TypeInformation to be Entered
Basic
  • Connection Name
  • User Name
  • Password
OAuth1A
  • Connection Name
  • Client ID
  • Client Secret
  • Scope
  • Request Token URL
  • Login Dialog URL
  • Authorization Code URL
  • HTTP Method to Get Token
OAuth2
  • Connection Name
  • Client ID
  • Client Secret
  • Scope
  • Login Dialog URL
  • Authorization Code URL
  • HTTP Method to Get Token
  • Refresh Token URL
  • The API Service Connection workflow depends on what Authentication Type you choose when initially creating your API Service. See Authentication Types for more information on supported Auth Types.
  • Required fields are marked with an asterisk ( * ).
  • A login button appears in the top right-hand corner of the API Service Detail when using OAuth1A or 2. This is to facilitate the required authentication process before any API calls are made.

API Service Connection Config

Fonteva automatically creates a set of API Service Connection Config objects depending on what Authentication Type you chose when setting up your API Service. These objects are accessed by clicking on the global API Service Connection listed (APIServiceName.Global) on the API Service Detail screen under the API Service Connection header.

Authentication TypeConfigs Created
BasicBecause Basic Auth relies on simple Username and Password, no API Service Connection Configs are created by default.
OAuth1A
  • TokenURL
  • AuthCodeURL
  • RequestTokenURL
  • HTTPMethodGetToken
OAuth2
  • TokenURL
  • AuthCodeURL
  • RefreshTokenURL

Editing these Configs and/or creating new Configs allow you to override the default steps within the Authentication process depending on the vendor you're connecting to. 

Creating a New API Service Connection Config

From the API Service Connection Detail:

  1. [Click] .
  2. [Enter] the following information:
    • Name: The name of the custom configuration
    • Value: The value of the custom configuration
  3. [Click] .

Additional Options

You can use API Service Connection Configs to set artificial limits in your Fonteva App

  • Callout_Last_24_Hours - This object counts the callouts made by a user over a 24 hour period.
  • Callout_Daily_Limit - This object restricts the number of calls that can be made by a specific service.
  • Callouts_Lifetime - This object counts the number of callouts made by a specific user from the time the API Service was created.

For example, If you wanted to configure a limit of 50 callouts by a particular API Service, from the API Service Connection Detail:

  1. [Click] .
  2. Name: [Enter] Callout_Daily_Limit.
  3. Value: [Enter] the maximum number of callouts for this API Service. E.G. 50
  4. [Click] .

Scenario: API Service Connection Configs Used with Twitter

 

framework.Api.ServiceConnectionConfig connectionConfig = new
framework.Api.ServiceConnectionConfig();
connectionConfig.apiServiceConnection = serviceConnection.configId;
connectionConfig.name = 'AUTHTYPECONFIG';
connectionConfig.value =
framework.VendorAuthenticationservice.AuthType.OAuth1A.name();
 
framework.Config.push(connectionConfig);


connectionConfig = new framework.Api.ServiceConnectionConfig();
connectionConfig.apiServiceConnection = serviceConnection.configId;
connectionConfig.name = 'HTTPMETHODGETTOKEN';
connectionConfig.value = 'POST';


framework.Config.push(connectionConfig);


connectionConfig = new framework.Api.ServiceConnectionConfig();
connectionConfig.apiServiceConnection = serviceConnection.configId;
connectionConfig.name =
framework.VendorAuthenticationservice.OAuth1AURLS.AuthCodeURL.name();
connectionConfig.value = 'https://api.twitter.com/oauth/access_token';


framework.Config.push(connectionConfig);


connectionConfig = new framework.Api.ServiceConnectionConfig();
connectionConfig.apiServiceConnection = serviceConnection.configId;
connectionConfig.name =
framework.VendorAuthenticationservice.OAuth1AURLS.TokenURL.name();
connectionConfig.value = 'https://api.twitter.com/oauth/authorize';


framework.Config.push(connectionConfig);


connectionConfig = new framework.Api.ServiceConnectionConfig();
connectionConfig.apiServiceConnection = serviceConnection.configId;
connectionConfig.name =
framework.VendorAuthenticationservice.OAuth1AURLS.RequestTokenURL.name();
connectionConfig.value = 'https://api.twitter.com/oauth/request_token';


framework.Config.push(connectionConfig);
JAVA