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
Property | Required | Description |
---|---|---|
Name | Yes | The name of the APISource. This is used to reference the APISource in other sections of the configuration |
HTTP:URL | Yes | The 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
Property | Required | Description |
---|---|---|
Name | Yes | The name of the APISource. This is used to reference the APISource in other sections of the configuration. |
Salesforce:ExternalServiceName | Yes | The name of the Salesforce External Service |
Salesforce:OrgUrl | Yes | The URL of the Salesforce Org. This must be the domain containing my.salesforce.com ) |
Salesforce:ClientId | No | The Client Id of the Salesforce Connected App. Will default to value for enosix app |
Salesforce:ClientSecret | No | The 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:
-
Set up a Named External Credentials in Salesforce. This will be the method Salesforce uses to authenticate with SAP.
-
Create a Named Credential in Salesforce that uses the Named External Credentials created in step 1.
-
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.
-
Install the enosix app if it is not already installed.
-
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
-
Set up a Named External Credentials in Salesforce. This will be the method Salesforce uses to authenticate with SAP.
-
Create a Named Credential in Salesforce that uses the Named External Credentials created in step 1.
-
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.
-
Create a new connected app under App Manager.
-
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. -
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. -
Ensure the
(api)
scope is selected, and make sure the Client Credentials Flow is enabled. -
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.