Saturday, 27 October 2018

Oracle Integration Cloud: CRUD Operation (Delete) using Salesforce Adapter (Part-5)

This article in the continuation of the series in which we are performing CRUD operation.

In this fifth and last part of the series, we'll demonstrate how the Delete employees details from SFDC  using Salesforce adapter in Integration Cloud.

Use Case: Expose a REST API in Integration Cloud which will Delete the employee details from SFDC

Others part of the Series

                                                                                                  



The integration will look like POST completion


Let's get started and complete the DELETE operation
  • Create an Integration and Select the App Driven Orchestration pattern
  • Provide the integration name as DeleteEmployee
  • Drop or Select the REST connection on the integration canvas as a Trigger point
  • Provide the information as below and click the Next button
    • What do you want to call your endpoint: DeleteEmployee
    • What is the endpoint's relative resource URI?: /employees/{employeeid}
    • What action do you want to perform on this endpoint: DELETE
  • Click the Next button without any change here
  • Drop an SFDC adapter just below the REST adapter
  • Enter below information and click the Next button
    • What do you want to call your endpoint?: RemoveEmployee
    • Check the Standard applications delivered by Salesforce.com checkbox
  •  Enter below information and click the Next button
    • Select CRUD, delete operation from the Operation Type drop down
    • Search the SFDC object(employee) and move the Employee__c object to the selected pane
  •  Edit the ModifyEmployee mapper and map the element as below
    • TemplateParameter (employeeid) --> ids
  • Integration is completed now. Save and Activate the integration
  • Let's test the integration via the POSTMAN tool. Enter the REST endpoint URL and Submit button
  • Open SFDC custom object and see the Employee should be deleted

Oracle Integration Cloud: CRUD Operation (Update) using Salesforce Adapter (Part-4)

This article in the continuation of the series in which we are performing CRUD operation.

In this fourth part of the series, we'll demonstrate the Update employees details using Salesforce adapter in Integration Cloud.

Use Case: Expose a REST API in Integration Cloud which will update the employee details in SFDC

Others part of the Series

                                                                                                  


The integration will look like POST completion


Let's get started and complete the PUT operation
  • Create an Integration and Select the App Driven Orchestration pattern
  • Provide the integration name as UpdateEmployee
  • Drop or Select the REST connection on the integration canvas as a Trigger point
  • Provide the information as below and click the Next button
    • What do you want to call your endpoint: UpdateEmployees
    • What is the endpoint's relative resource URI?: /employees/{employeeid}
    • What action do you want to perform on this endpoint: PUT
    • Check the checkbox Configure  a request payload for this endpoint
  • Click the Next button without any change here
  • On the Request page, enter below information and click the Next button
    • Select JSON Sample from the request payload format drop-down, click << inline >> link and enter below sample JSON payload
{
         "EmployeeName""",

         "EmployeeEmailId""",

         "EmployeeAge"11,

         "EmployeeQualification"""

}

  • Drop an SFDC adapter just below the REST adapter
  • Enter below information and click the Next button
    • What do you want to call your endpoint?: ModifyEmployee
    • Check the Standard applications delivered by Salesforce.com checkbox
  • Enter below information and click the Next button
    • Select CRUD, update operation from the Operation Type drop down
    • Search the SFDC object(employee) and move the Employee__c object to the selected pane
  • Edit the ModifyEmployee mapper and map the element as below
    • TemplateParameter (employeeid) --> id
    • EmployeeName --> Employee_Age__c
    • EmployeeEmailId --> Employee_Email_id__c
    • EmployeeName --> Employee_Name__c
    • EmployeeQualification --> Employee_Qualification__c
  • Integration is completed now. Save and Activate the integration
  • Let's test the integration via the POSTMAN tool. Enter the REST endpoint URL and enter below request payload and Submit
{
         "EmployeeName""Ankur_updated",

         "EmployeeEmailId""ankur@gmail.com",

         "EmployeeAge"30,

         "EmployeeQualification""MCA"

}

  • Open SFDC custom object and see the Employee should be updated


Oracle Integration Cloud: CRUD Operation (Get by Id) using Salesforce Adapter (Part-3)

In the previous blog of the series, we have showcased how to Insert details into SFDC using Oracle Integration Cloud Salesforce Adapter.

In this third part of the series, we'll demonstrate the Get employees details by Id using Salesforce adapter in Integration Cloud.

Use Case: Expose a REST API in Integration Cloud which will fetch the employee details based on the 18 digits SFDC Id from Salesforce

Others part of the Series

                                                                                                  


The integration will look like POST completion

Let's get started and complete the GET operation
  • Create an Integration and Select the App Driven Orchestration pattern
  • Provide the integration name as GetEmployees
  • Drop or Select the REST connection on the integration canvas as a Trigger point
  • Provide the information as below and click the Next button
    • What do you want to call your endpoint: GetEmployee
    • What is the endpoint's relative resource URI?: /employees/{employeeid}
    • What action do you want to perform on this endpoint: GET
    • Check the checkbox Configure this endpoint to receive the response
  • On the Response page, enter below information and click the Next button
    • Select JSON Sample from the request payload format drop-down, click <<inline>> link and enter below sample JSON payload
{
   "Employees"[
      {
         "EmployeeName""",
         "EmployeeEmailId""",
         "EmployeeAge"11,
         "EmployeeQualification"""
      },
      {
         "EmployeeName""",
         "EmployeeEmailId""",
         "EmployeeAge"11,
         "EmployeeQualification"""
      }
   ]
}




  • Drop an SFDC adapter just below the REST adapter

    • Enter below information and click the Next button
      • What do you want to call your endpoint?: FetchEmployees
      • Check the Standard applications delivered by Salesforce.com checkbox
    • Enter below information and click the Next button
      • Select CRUD, retrieve operation from the Operation Type drop down
      • Search Object (employee) and move the Employee__c SFDC object to the selected pane
    • Click the Next button
    • Edit the FetchEmployees mapper and map the fields as below
      • employeeid --> ids
      • Edit the fieldList element and enter below fields
    Employee_Age__c,Employee_Email_id__c,Employee_Name__c,Employee_Qualification__c

    • Edit the GetEmployee mapper
    • Map the fields from the source (SFDC) to target(REST)


    • Integration is completed now. Save and Activate the integration
    • Let's test the integration. Since this is the GET operation, so the service can be tested via browser also. Enter the REST endpoint URL and submit
    Ist Test

    https://oicinstance-test.integration.ocp.oraclecloud.com/ic/api/integration/v1/flows/rest/GETEMPLOYEES/1.0/employees/a006F000036ZutsQAC

    2nd Test:

    https://oicinstance-test.integration.ocp.oraclecloud.com/ic/api/integration/v1/flows/rest/GETEMPLOYEES/1.0/employees/a006F000036ZuttQAC




    Oracle Integration Cloud: CRUD Operation (GET) using Salesforce Adapter (Part-2)

    In the previous blog of the series, we have showcased how to Insert details into SFDC using Oracle Integration Cloud Salesforce Adapter.

    In this second part of the series, we'll demonstrate the Get employees details using Salesforce adapter in Integration Cloud.

    Use Case: Expose a REST API in Integration Cloud which will fetch the employee details from SFDC

    Others part of the Series

                                                                                                      


    The integration will look like POST completion

    Let's get started and complete the GET operation
    • Create an Integration and Select the App Driven Orchestration pattern
    • Provide the integration name as GetAllEmployee
    • Drop or Select the REST connection on the integration canvas as a Trigger point
    • Provide the information as below and click the Next button
      • What do you want to call your endpoint: GetEmployees
      • What is the endpoint's relative resource URI?: /employees
      • What action do you want to perform on this endpoint: GET
      • Check the checkbox Configure this endpoint to receive the response
    • On the Response page, enter below information and click the Next button
      • Select JSON Sample from the request payload format drop-down, click <<inline>> link and enter below sample JSON payload
    {
       "Employees"[
          {
             "EmployeeName""",
             "EmployeeEmailId""",
             "EmployeeAge"11,
             "EmployeeQualification"""
          },
          {
             "EmployeeName""",
             "EmployeeEmailId""",
             "EmployeeAge"11,
             "EmployeeQualification"""
          }
       ]
    }

    • Drop an SFDC adapter just below the REST adapter
    • Enter below information and click the Next button
      • What do you want to call your endpoint?: FetchEmployees
      • Check the Standard applications delivered by Salesforce.com checkbox
    • Enter below information and click the Next button
      • Select SOQL, query operation from the Operation Type drop down
      • Enter below Salesforce Object Query Language(SOQL) and click the Refresh button to validate
    select Employee_Age__c,Employee_Email_id__c, Employee_Name__c, Employee_Qualification__c from Employee__c

    • Edit GetEmployee mapper and map the required elements
    • Integration is completed now. Save and Activate the integration
    • Let's test the integration. Since this is the GET operation, so the service can be tested via browser also. Enter the REST endpoint URL and submit

    Oracle Integration Cloud: CRUD Operation (Create) using Salesforce Adapter (Part-1)

    We are writing a series of five blogs which will help to perform Create, Read, Update, Delete (CRUD) operation in SFDC using Oracle Integration Cloud Salesforce Adapter. 

    In the first part of the series, a Create Operation will be executed which will show how to insert data into Salesforce with few steps.

    To complete this series, below are the pre-requisite that needs to be completed
    • Oracle Integration Cloud Subscription
    • Salesforce cloud Subscription
    • An SFDC custom object with name Employee__c with below elements
      • Employee_Age__c
      • Employee_Email_id__c
      • Employee_Name__c
      • Employee_Qualification__c
    Other parts of the series

    Use Case: Expose an Integration Cloud REST service which will insert the employee details into Salesforce

    Let's get started and achieve the use case

    The overall integration will look like as shown in the below screenshot

    • Create an Integration and select App Driven Orchestration pattern
    • Enter Integration name as CreateEmployees
    • Select or Drag the REST adapter on the integration canvas as a Trigger
    • Enter information as below and click the Next button
      • What do you want to call your endpoint: CreateEmployee
      • What is the endpoint's relative resource URI?: /employees
      • What action do you want to perform on the endpoint: POST
      • Check the checkbox: Configure a request payload to this endpoint
      • Check the checkbox: Configure this endpoint to receive the response
    • On the Request page, enter below information and click the Next button
      • Select JSON Sample from the request payload format drop-down, click << inline >> link and enter below sample JSON payload
    {
       "Employees": [
          {
             "EmployeeName": "",
             "EmployeeEmailId": "",
             "EmployeeAge": 11,
             "EmployeeQualification": ""
          },
          {
             "EmployeeName": "",
             "EmployeeEmailId": "",
             "EmployeeAge": 11,
             "EmployeeQualification": ""
          }
       ]
    }

    • On the Response page, enter below information and click the Next button
      • Select JSON Sample from the request payload format drop-down, click <<inline>> link and enter below sample JSON payload
    { "status": "success" }

    • Drop an SFDC adapter just below the REST adapter
    • Enter below information and click the Next button
      • What do you want to call your endpoint?: InsertEmployee
      • Check the Standard applications delivered by Salesforce.com checkbox
    • Enter below information and click the Next button
      • Select CRUD, create operation from the Operation Type drop down
      • Search the SFDC object(employee) and move the Employee__c object to the selected pane
    • Simply click the Next button
    • Click the Done button
    • Edit the InsertEmployee mapper and map the required field from source (REST) to Target (SFDC)

    • Edit the CreateEmloyee mapper and map the SFDC response status element with the REST service response status element
    • Integration is completed now. Save and Activate the integration
    • Let's test the integration via the POSTMAN tool. Enter the REST endpoint URL and enter below request payload
    {
       "Employees": [
          {
             "EmployeeName": "Ankur",
             "EmployeeEmailId": "ankur@gmail.com",
             "EmployeeAge": 28,
             "EmployeeQualification": "MCA"
          },
          {
             "EmployeeName": "Joseph",
             "EmployeeEmailId": "Joseph@yahoo.com",
             "EmployeeAge": 58,
             "EmployeeQualification": "MBBS"
          },
          {
             "EmployeeName": "Simple",
             "EmployeeEmailId": "simple@gmail.com",
             "EmployeeAge": 65,
             "EmployeeQualification": "PHD"
          }
       ]
    }

    • Open the SFDC custom Object Employee__c and see the requested data should be inserted into the Object