Pre-requisite #
- Create Metadata Provider
- Create Repository
- Create Message Type as hierarchical g message type Name is MsTAccount and message type name is MsTContact
- MsTAccount is parent of MsTContact
- Create Istructure for both message type are MsTAccount and MsTContact
Step2
- Create Integration
- Create two Interfaces are Inbound interface & Outbound interface
Note: In this case, the inbound interface role is requested data and Outbound interface role is response data.
- Do mapping for inbound interface
- Add message type for Outbound interface then do mapping
- Go to the outbound interface & copy its ID then navigate to Inbound interface detail and past outbound interface’s ID into ‘Response Interface’ field
Step3
- Go to Soap UI application
- Change Method = POST then enter API IntegrateSynchronous (/services/apexrest/skyvvasolutions/IntegrateSynchronous) into Resource field
- Define data in Request page to call data to salesforce
- See the result of outbound response JSON data payload
Note: All data response based on data External Id and with Operation type Upsert and Update so data can response when data update by a process like External Id.
How Response using message type for API IntegrateSynchronous works #
In this case, we use REST Service API IntegrateSynchronous to import or request data into salesforce and sender system will get back response data after data import or request successfully.
Step1
- Go to Salesforce Org.
- Create MetaData Provider
- Click & Go to Related Tab
- Create Istructure Repository
- Click on New Button
- Create Name & Select Repository from Type picklist
- Create Message Type as hierarchical
- Create Message Type Name & Select Plain structure from Type picklist
- MsTAccount & MsTContact message type name
- Save
- Go to Related Tab and click on New
- Create Message Type Name & Select Plain structure from Type picklist
- MsTAccount is parent to MsTContact
- Save
- Create Message Type Name & Select Plain structure from Type picklist
- MsTContact is child to MsTAccount
- Save
- Go to the Details page
- Click on New Istructure button
Create I structures of message type for MsTAccount & MsTContact
- For MsTAccount
- Create IStructure Name
- Create Billing City Istructure BillingCity
- Create Billing Country Istructure BillingCountry
- Create Billing State Istructure BillingState
- Save
- For MsTContact
- Create First Name Istructure FirstName
- Create Last Name Istructure LastName
- Create Email Istructure
- Save
Go back to Repository
- Click on Related Tab
- See all Message Type which user created
- Scroll Down to Istructure Section
- Click on view all
- See all Istructure which user just created Manually
- See how hierarchical Message Type look in Tree
Step2
- Create Integration
- Create 1st Interface
- OutboundResponse
- Search
- MeTaData Provider
- Repository
- Source/Target Message Type
- Click on Open Mapping
- Map the target fields according to MsTAccount & MsContact to the Salesforce Source sObject
- Save
- Create 2nd Interface
- InboundRequest
- Save
- Click on Open Mapping Button
- Map the fields
- Select Id & Save
- Go to the outbound interface and copy its ID
- Navigate to Inbound interface detail and pass outbound interface’s ID into ‘Response Interface’ field & Save
What is REST API? #
REST is basically an architectural style of the web services that work as a channel of communication between different computers or systems on the internet. The term REST API is something else. Those application programming interfaces that are backed by the architectural style of REST architectural system are called REST APIs.
REST API compliant web services, database systems, and computer systems permit requesting systems to get robust access and redefine representations of web-based resources by deploying a predefined set of stateless protocols and standard operations. By these protocols and operations and redeploying the manageable and updatable components without causing the effect on the system, REST API systems deliver fast performance, reliability, and more progression.
Explaining an API IntegrateSynchronous #
This feature is created to allow user call Skyvva Services by REST Api from their system.
- Click on REST Project
- Enter Endpoint URL Instance
- Go to Soap UI application
- Great you create REST Project 1
- Expand URL
- Right-click on Request
- Click on Clone Request
- Change Method = POST
- URL: https://akashtest-dev-ed.my.salesforce.com
- RESOURCE: /services/apexrest/skyvvasolutions/IntegrateSynchronous
- Media type by default application/JSON where we post. (JSON is the format)
- Header its some tricky although it’s easy
- Click on Header
- Add header name eg. Authorization
- The bearer is a keyword after press space key
- Paste your sessionID
- Press enter key
- Define data in Request page to call data to salesforce
- Paste this code under Media type section
- Submit
- Here is the result of outbound response JSON data payload
Great code pass successfully
- Go to Salesforce Org
- Click on Message Monitoring Tab
- Select your Integration
- Click on the search button
- Green flag status reflects your integration is successfully achieved with the help of SoapUI.
- Click on Account Tab
- See the records