Tutorials

  1. Home
  2. Docs
  3. Tutorials
  4. 57. How to use the searchService to build the interface to query data from Salesforce?

57. How to use the searchService to build the interface to query data from Salesforce?

Learning Object :-

This unit describe about:-

  1. What is searchService?
  2. How to use the searchService to build the interface to query data from salesforce.

1. What is searchService api?

The searchService api is working as the query method of http request. We have integration and interface configuration where we mapped object as per our requirements. So when we use search service api, we actually query the data we have mapped for our interface. So it will return the data of the object as per mapping of interface. We can use the REST api SearchService or the soap API.

In this tutorial we used postman application where Request payload means the body we have pass through postman and endpoint url is the url we have pasted on postman and in response we will get JSON data as parent and child by using searchService API.

 

2. How to use the searchService to build the interface to query data from salesforce?

The procedure is given below :-

Pre-Requisite :-

  1. Create Metadeta provider.
  2. Create Istructure Repository.
  3. Create Message type  e.g AccountMT is the parent of ContactMT.
  4.  Create Integration.

 

  1. Create Outbound Interface then select Status is Deployed and Operation Type with Query (As shown in the picture given below).

2. Add Metadata Provider, Istructure Repository, Message Type for interface(As shown in the picture given below).

 

3. Do tree mapping field Salesforce object map with Message Type step by step with the level (As shown in the picture given below):-

4. Navigate to Postman application.

5.Create new request and new folder.

6.Change method GET to POST and enter Salesforce classic URL with /services/apexrest/skyvvasolutions/SearchService  (shown in the picture given in point 8).

7.Click Body tab => click raw tab => select JSON (application/json) in picklist => Create rest body
Body is shown below in the picture.

9. Click Send button to get response data .

10. Here is the result of responded Json data.

Was this article helpful to you? Yes No

How can we help?