- This line was added.
- This line was removed.
- Formatting was changed.
|NOTE: You must be using Design Studio (not Cloud Studio) to use an OData API with Salesforce Connect.|
These steps describe how to set up and configure API Manager to expose data in an easy-to-consume, secure form so that Salesforce Connect (formerly Salesforce Lightning Connect) will consume and display the data in real-time. This example will expose and display data from an SAP source via the OData 2.0 protocol.
Note: Salesforce Connect (formerly Salesforce Lightning Connect) requires the OData 2.0 protocol.
Step 4: Set up Salesforce Connect
- Log in to the Jitterbit Harmony Web Management Console.
- Create a new environment specifically for the API. The new environment will allow you to work completely independently from any other project that already exists or any new projects created in the future.
- Select Menu.
- Select Environments in the drop-down menu.
- Select the Image Removed button in the upper right corner of the Environments page.
- The Add Environment pop-up displays.
Image RemovedEnter the Name you would like to use for the environment in the Name field. The name assigned to the newenvironment will become the URL prefix for the API you create (e.g. development, test, sandbox, production, etc.). Take care not to use any special characters and keep it short for ease of use.
- The new environment is now available for use and is listed on the Environments page.
- The next step is to create a new project and a new operation in Design Studio under the new environment you just created.
- Log in to the Jitterbit Design Studio.
- Select the New Project tab at the bottom of the screen.
- Enter the Name you would like to use in the Project Name field. The project name for this example is JohnAPIDemo.
- Select the appropriate Organization from the drop-down list.
- Select the new environment you just created in the Environment drop-down list.
- Click the Image Removed button.
- Click on the Image Removed icon in the main toolbar at the top of the Design Studio screen.
- Select the API Entity Operation radio button from the list of options.
- Select the Create a new Jitterbit Entity radio button.
- Click the Next button at the bottom of the pop-up window.
- Select the appropriate radio button to choose the Source you want to work with. For this example, select the SAP radio button.
- Click the Next button at the bottom of the pop-up window to continue.
- If you need to, click the Back button to return to a previous screen and make changes or click the Cancel button to exit the Create a Jitterbit Entity Wizard entirely.
- Click the Available SAP Endpoints drop-down arrow.
- Select either Create New or select an existing endpoint from the drop-down list. For this example, Create New was selected.
- Enter the appropriate credentials for your source SAP system in the Host, Login, System number and Client fields.
- Click on the Password button, Enter the password and Press Return.
- Click on the Image Removed button to ensure that your credentials are valid. The Testing Connection pop-up window displays followed by the Success pop-up window once the connection is successful.
- Click Next to continue.
- Enter characters in the Name Contains field to filter the query. In this example we entered KNA to filter on customer tables. Leave the Name Contains field blank to view all available objects or tables.
- Select the Object Type from the drop-down list. In this example Tables Only is selected.
- Click on the Image Removed button to display the list of available objects or tables.
- Click on the Name of the Object or Table in the list to create the required data set. In this example, the KNA1 table is selected which contains the customer master information.
- Click Next to continue.
- Enter partial/full field names in the Find field to display the list of fields available in a particular category. Leave the Find field blank to display all fields available in the previously selected object or table.
- Click on the associated checkbox to Select each field to include in the data set.
- You can enter multiple field names in the Find field and select multiple fields from each resulting list.
- Click the Always show selected fields checkbox to continue to display all previously selected fields as you cycle through multiple field lists.
- In this example we entered City, Address, Name, Country, and Customer in the Find field and selected multiple fields from each list.
- Click Next to continue.
- Jitterbit created a new Entity based on the previous selections.
- Enter the Name you would like to use in the Entity Name field. In this example we named the entity Customers.
- Note: The Entity Name must be a single word. Customers that access the API will be able to see the name as well.
- Click the associated checkbox to Select one field as the Primary field to be the unique key that identifies the entity or the new object.
- In this example the Customer field is selected as the unique key.
- Note: If the returned data includes duplicate records with the same primary value or records without primary values, such data may be skipped at run-time.
- Click Next to continue.
- Jitterbit creates a pass through operation by default.
- Click the Request Transformation and/or the Response Transformation checkbox if custom mapping is required. In that case, Click Next and the Entity Wizard will display request and/or response structures allowing you to continue mapping the fields appropriately.
- In this example we have opted for the basic pass through operation and did not check either checkbox.
- Click Finish.
- Jitterbit creates and saves the entity and the operation. The entity and operation are now available to use.
- The Operations tab and Jitterbit Entities tab display in Design Studio.
- Click on the Jitterbit Entities tab to review your new entity:
- The Entity may be revised in the future by adding or removing fields, changing the Primary field to be used as the unique key that identifies the entity, or changing the endpoint the entity connects to.
- Select the Operations tab.
- To complete the operation, Click on the Image Removed icon in the toolbar in the upper right corner of the screen. The operation is deployed to the environment created specifically for this API in previous steps outlined above.
- The next step to create your API is to go back to the Web Management Console to expose the operation and entity as an OData 2.0 API (Salesforce Connect requires the OData 2.0 protocol.)
- Log in to Jitterbit Harmony or Click the Image Removed icon on the Design Studio main toolbar.
Assigned Jitterbit Entities
- Click on the Method Type drop-down arrow.
- Select the Method from the drop-down list. For this example the Get method is selected.
- Click on the Entity (Project) drop-down arrow.
- Select the Entity created specifically for this API in the steps outlined above. For this example the Customers (JohnAPIDemo) entity is selected.
- Click the API Operation drop-down arrow.
- Select the Operation created specifically for this API in the steps outlined above. For this example the Customers operation is selected. When a GET request hits the API, the Customers operation will run.
- Click the Assign button to save the entries and assign the Method, Entity and Operation to the API.
- By default, anonymous access to each API is enabled, which allows all public access.
- For this example, authentication profiles are not assigned to the API and anonymous access is enabled.
- See Harmony API Security to review the levels of security available in API Manager and determine the level of security you would like to set up for API access.
- Click the Timeout up and/or down arrows to set the timeout value desired, or leave the default value of 30 seconds.
- See Harmony API Security to review the SSL and Debug Until settings and determine the level of security you would like to set up for access to the API.
- Click the Add button at the bottom of the page.
- Your OData 2.0 API is now complete and publicly available.
- Continue to Step 4 only if the API will be used with Salesforce Connect.
Image RemovedCopy the full URLof your new API (top-right corner) into memory (Ctrl+C or Cmd+C) in preparation to set up Salesforce.
Create New External Data Source and External Object
- If you have access to the External Objects and External Data Sources, Select Develop and then Select External Data Sources (https://login.salesforce.com/0XC?setupid=ExternalDataSource&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DDevToolsIntegrate). If you do not have access to such features, make sure to contact your Salesforce representative.
- Click the New External Data Source button.
WARNING: It is imperative to set up a level of security for any API prior to going live.
- Click the Identity Type drop-down arrow and Select Named Principal if you do have profiles assigned to the API and if you want to use a central name for all of your Salesforce users.
- Click the Authentication Protocol drop-down arrow.
- Select Password Authentication from the list if you do have security profiles assigned.
- Enter the appropriate username and password.
- Click the Save button.
- Click the Validate and Sync button to check the URL, validate the format is acceptable and automatically create a new External Object in Salesforce.
- Salesforce external objects are almost like any other custom object, except the data is not stored in Salesforce. The data is retrieved in real-time from the data source set. The external object supports APIs and other customization. When using the external object, remember to always provide a filter/criteria for the data. (Go to https://help.salesforce.com/apex/HTViewHelpDoc?id=platform_connect_considerations_compatibility.htm&language=en_US for additional information about Salesforce external objects.)
Create a New Tab in Salesforce
- Select Build.
- Select Create.
- Select Tabs.
- Click the New button in the Custom Object Tabs section.
- Click the Object drop-down arrow.
- Select the new external object you just created. In this example Customers is selected.
- Customize the tab as desired.
- Click Next.
- Click Save.
- Click on the new tab (in this example Customers).
- Click on Create New View
- Customize the View as desired.
- Click Save.
- In this example, the view is set to display all customers where Country = US.
- The data is retrieved in real-time and is not being stored in Salesforce. You can drill down for more detail or change filters again as needed. API Manager will continue to service the requests in real-time and work together with Salesforce Connect to provide access to the data.