Skip to main content

API Sources

API Sources refer to enosix extended Open API Specification (OAS) files that define user-readable interfaces to SAP data. These files specify the endpoints created by Link for enosix RIOs configured in SAP.

Http

OAS files can be provided to Link via HTTP URLs. Link will request the OAS file from the provided URL and create the endpoints to serve the SAP data.

Example

APISources__1__Name: http_oas
APISources__1__Http__Url: https://[Url]/LargeOAS.yaml

Fields

PropertyRequiredDescription
NameYesThe name of the APISource. This is used to reference the APISource in other sections of the configuration
HTTP:URLYesThe HTTP section is used to configure an OAS file that is hosted on an unauthenticated URL

Salesforce External Service

Link can retrieve OAS files served by Salesforce. This allows Link to use the same file to create its endpoints that Salesforce is using to build out models and make the requests to Link.

Example

APISources__2__Name: salesforce_oas
APISources__2__Salesforce__ExternalServiceName: enosix
APISources__2__Salesforce__OrgUrl: https://[MyDomain].scratch.my.salesforce.com

Fields

PropertyRequiredDescription
NameYesThe name of the APISource. This is used to reference the APISource in other sections of the configuration.
Salesforce:ExternalServiceNameYesThe name of the Salesforce External Service
Salesforce:OrgUrlYesThe URL of the Salesforce Org. This must be the domain containing my.salesforce.com)
Salesforce:ClientIdNoThe Client Id of the Salesforce Connected App. Will default to value for enosix app
Salesforce:ClientSecretNoThe Client Secret of the Salesforce Connected App. Will default to value for enosix app

Using the Enosix App

Inside your Salesforce org, you will need to do the following:

  1. Set up a Named External Credentials in Salesforce. This will be the method Salesforce uses to authenticate with SAP.

  2. Create a Named Credential in Salesforce that uses the Named External Credentials created in step 1.

  3. Create an external service in Salesforce. When it asks for a Service Schema, provide the OAS schema that was generated in JSON format, as well as the Named Credential created earlier. On step 2 of the external service wizard, select all operations from the schema.

  4. Install the enosix app if it is not already installed.

  5. Under Manage Connected Apps, edit the newly created connected app, and choose a Run As user for the Client Credentials section who has access to the external service created in step 3.

Using a Custom Connected App

  1. Set up a Named External Credentials in Salesforce. This will be the method Salesforce uses to authenticate with SAP.

  2. Create a Named Credential in Salesforce that uses the Named External Credentials created in step 1.

  3. Create an external service in Salesforce. When it asks for a Service Schema, provide the OAS schema that was generated in JSON format, as well as the Named Credential created earlier. On step 2 of the external service wizard, select all operations from the schema.

  4. Create a new connected app under App Manager.

  5. In this new connected app, enable OAuth settings, and provide a dummy callback URL (such as http://localhost:8080), which will not be used for this app.

  6. Under Manage Connected Apps, edit the newly created connected app, and choose a Run As user for the Client Credentials section who has access to the external service created in step 3.

  7. Ensure the (api) scope is selected, and make sure the Client Credentials Flow is enabled.

  8. Click Manage Consumer Details, and take note of the Consumer Key and Consumer Secret, as well as the current domain. These are the Client Id, Client Secret and OrgUrl used to configure Link.