Sitemap

Multiple VERBs in REST

3 min readOct 22, 2024

--

We are going to see how to use multiple HTTP verbs and resources configured for the REST trigger (also called an invoke) of an integration. A single REST trigger can be configured to have multiple HTTP verbs such as GET, PUT, POST, PATCH, and DELETE.

In this example, we are going to see how use the same integration which can work for GetObjects, GetObject, PostObjects, PatchObject.

  1. Create an Integration “Test Multi Verbs”
  2. Selet the Trigger connection “Trigger_Rest”.

What do you want to call your endpoint? TriggerMultiVerbs

Select the check box Select to configure multiple resources or verbs. (maximum 11).

3. Give the below values:

Provide an Operation Name: getObjects

What is the endPoint relative URI? /getObjects

What Action do you want to perform on the endpoint? GET

Check box: Configure the endpoint to receive the response.

getObjects Configuration

Provide inline Json for a sample response:

{
"Phones" : [ {
"id" : "1",
"ObjName" : "Google Pixel 6 Pro",
"data" : {
"ObjColor" : "Cloudy White",
"Size" : "128 GB"
}
}, {
"id" : "5",
"ObjName" : "Samsung Galaxy Z Fold2",
"data" : {
"Cost" : 689.99,
"ObjColor" : "Brown"
}
} ]
}

4. Select Add another Operation and click on Continue.

Adding Operation getObject:

5. Provide an Operation Name: getFewObjects

What is the endPoint relative URI? /getSpecificPhones

What Action do you want to perform on the endpoint? GET

Check boxes:

Add and review parameters for this endpoint

Configure the endpoint to receive the response.

Click Continue and Add a request parameter “PhoneId”

Get Manikanta kumar K’s stories in your inbox

Join Medium for free to get updates from this writer.

Provide inline Json for a sample response:

[
{
"id": "3",
"PhoneName": "Apple iPhone 12 Pro Max",
"data": {
"Phone Color": "Cloudy White",
"Phone Size": 512
}
},
{
"id": "5",
"PhoneName": "Samsung Galaxy Z Fold2",
"data": {
"Cost": 689.99,
"Phone Color": "Brown"
}
},
{
"id": "10",
"PhoneName": "Apple iPad Mini 5th Gen",
"data": {
"Capacity": "64 GB",
"Display size": 7.9
}
}
]

5. Select Add another Operation and click on Continue.

Adding Operation CreateObject:

6. Provide an Operation Name: AddNewPhone

What is the endPoint relative URI? /AddPhone

AddObject Configuration

What Action do you want to perform on the endpoint? POST

Check boxes:

Configure a request payload for this endpoint.

Configure the endpoint to receive the response.

Click Continue and Add a request parameter “PhoneId”.

Configure request with the below JSON:

{
"name" : "Apple MacBook Pro 16",
"data" : {
"year" : 2019,
"price" : 1849.99,
"CPU model" : "Intel Core i9",
"Hard disk size" : "1 TB"
}
}

Configure response with the below JSON:

{
"PhoneId": "7",
"Phone Name": "Apple MacBook Pro 16",
"data": {
"Manufactured year": 2019,
"Cost": 1849.99,
"Processor": "Intel Core i9",
"Memory Size": "1 TB"
},
"Launched On": "2022-11-21T20:06:23.986Z"
}

Check the operations’ summary and click on Finish.

Add the required REST invocations in each branch and provide the mappings.

The whole integration looks as below:

Each branch needs a business Identifier. Provide the business Identifier on clicking the dots for every Pick and save the integration.

Testing:

On activating the integration, click the Run

Select the operation to be tested and click on Run.

--

--

Manikanta kumar K
Manikanta kumar K

Written by Manikanta kumar K

17+ Years of experience in IT industry | Oracle Cloud Integration Specialist | OCI | Certified OCI Architect, Developer, Operations Professional