How To use REST API inside Sales Cloud

Similar documents
it is

Interface Functional Design C4C.I.002

We are ready to serve Latest Testing Trends, Are you ready to learn? New Batch Details

Creating a REST API which exposes an existing SOAP Service with IBM API Management

WP Voting Plugin - Ohiowebtech Video Extension - Youtube Documentation

AEM Forms: Rest API Integration as a Datasource

D&B Optimizer for Microsoft Installation Guide

Healthcare Database Connector

BaasBox. Open Source Backend as a Service. Otto Hylli

vrealize Operations Manager Management Pack for vrealize Hyperic Release Notes

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Partner Web Services. GetMyPrice Service Manual

vrealize Operations Management Pack for vrealize Hyperic Release Notes

Welcome to Database Exporter for SharePoint

Healthcare Database Connector

Healthcare Database Connector

Configuring Microsoft ADFS for Oracle Fusion Expenses Mobile Single Sign-On

Oracle CPQ Cloud. What s New in 2016 R2

ExtraHop 7.3 ExtraHop Trace REST API Guide

OpenShift Dedicated 3 Release Notes

AuraPlayer Server Manager User Guide

Accessing the Progress OpenEdge AppServer. From Progress Rollbase. Using Object Script

SDN Community Contribution

Oracle Big Data Cloud Service, Oracle Storage Cloud Service, Oracle Database Cloud Service

EMSS REST API v Getting Started. February 14, 2017

Steps A. Identify version number B. Access configuration page C. Basic settings D. Advance settings E. Front end experience settings F.

ControlPoint. Native Installation Guide. February 05,

EMARSYS FOR MAGENTO 2

Mintigo Marketo Integration Setup Guide. Version

Oracle. Sales Cloud Configuring Sales for B2C. Release 13 (update 18A)

Cloud Elements CRM Hub Provisioning and Usage Guide

ADF Mobile Code Corner

esignlive for Microsoft Dynamics CRM

1Z Oracle WebLogic Server 12c - Administration I Exam Summary Syllabus Questions

VMware AirWatch Integration with OpenTrust CMS Mobile 2.0

How to Use ADFS to Implement Single Sign-On for an ASP.NET MVC Application

CloudShell Sandbox Plugin

VMware AirWatch Integration with RSA PKI Guide

Question: 1 Which item must be enabled on the client side to allow users to complete certification in offline mode?

Oracle Forms and Oracle APEX The Odd Couple

Contents Overview... 5 Downloading Primavera Gateway... 5 Primavera Gateway On-Premises Installation Prerequisites... 6

Ninox API. Ninox API Page 1 of 15. Ninox Version Document version 1.0.0

Five9 Adapter for Oracle

Red Hat 3Scale 2-saas

Sage CRM Connector for Sage X3 version 4.2 Troubleshooting Guide. Updated: November 2017

VMware AirWatch Integration with SecureAuth PKI Guide

Shopitem API A technical guide to the REST API for managing updates of shopitems

Oracle. Sales Cloud Integrating with JD Edwards EnterpriseOne. Release 13 (update 18A)

D&B Optimizer for Microsoft Installation Guide Setup for Optimizer for Microsoft Dynamics. VERSION: 2.3 PUBLICATION DATE: February, 2019

CRM F1 for Microsoft Dynamics

Integrating Salesforce and SharePoint Netwoven Inc.

Xignite CloudStreaming overview

Server-side Development using Python and SQL

Orchestrator Guide Release 9.2

Gateway File Provider Setup Guide

Fragility of API Interoperability

1Z Oracle Identity Governance Suite 11g PS3 Implementation Essentials Exam Summary Syllabus Questions

Building E-Business Suite Interfaces using BPEL. Asif Hussain Innowave Technology

Akana API Platform: Upgrade Guide

Contents Overview... 5 Upgrading Primavera Gateway... 7 Using Gateway Configuration Utilities... 9

REST API for Sales Cloud Industry Solutions

Adobe Document Cloud esign Services. for Salesforce Version 17 Installation and Customization Guide

Installation Guide for. nopmobile Connector Plugin & nopmobile App

Cloud Help for Community Managers...3. Release Notes System Requirements Administering Jive for Office... 6

Composer Help. Web Request Common Block

HTML Mashups A mashup that embeds an HTML or JavaScript based Web page directly on a screen.

D&B360 Administration and Installation Guide

Registering at the PNC Developer Portal

Cloud Identity Minder Authentication WebService Usage Guidelines

Coveo Platform 7.0. Atlassian Confluence Connector Guide

Crestron Virtual Control REST API

Oracle Sales Cloud Using Simplified SOAP Web Services for Account, Household, and Contact

Web Services Using Standard Oracle EBS

not use this documentation except in compliance with the License.

Bambu API Documentation

Murphy s Magic Download API

WebEOC SOAP API WebEOC SOAP API May 8,

Gateway File Provider Setup Guide

Logi Ad Hoc Reporting System Administration Guide

Workspace ONE UEM Integration with OpenTrust CMS Mobile 2. VMware Workspace ONE UEM 1811

Oracle APEX 18.1 New Features

Nolij Transfer 6 Migration Planning & Preparation. Danielle Whitney Services Product Manager

Trusted Login Connector (Hosted SSO)

Logi Ad Hoc Reporting System Administration Guide

Assignment 2. Start: 15 October 2010 End: 29 October 2010 VSWOT. Server. Spot1 Spot2 Spot3 Spot4. WS-* Spots

CAWS CONTINUOUS SECURITY VALIDATION PLATFORM API GUIDE VERSION 3.0

Insbridge Enterprise Rating Design Time Reporting Document

plugin deployment guide

Query To View Table Structure In Sql Server 2008

OAM 2FA Value-Added Module (VAM) Deployment Guide

Logi Ad Hoc Management Console Overview

1Z Oracle SOA Suite 12c Essentials Exam Summary Syllabus Questions

RingCentral for Microsoft Dynamics CRM. Installation & User Guide

Building Satellite Rollbase Applciation for an existing OpenEdge application

Release Notes

Introduction... 5 Configuring Single Sign-On... 7 Prerequisites for Configuring Single Sign-On... 7 Installing Oracle HTTP Server...

ADF Code Corner. 65. Active Data Service Sample Twitter Client. Abstract: twitter.com/adfcodecorner

ADF Code Corner. 90. Filtering ADF bound lists. Abstract: twitter.com/adfcodecorner

Informatica ActiveVOS

Getting Started with ORE - 1

Transcription:

How To use REST API inside Sales Cloud by : radu.marinache@oracle.com

Opportunity REST WS GET POST PATCH Using a 3th party REST API webservice inside Sales Cloud

Abstract The following document presents the usage of a REST API inside Sales Cloud in groovy scripting. The document will take as example Opportunity REST Api and present GET, POST and PATCH operations and also will take a free public 3th party REST API and show its usage inside sales Cloud. Opportunity REST WS WS Documentation: http://docs.oracle.com/cloud/farel11/salescs_gs/faaps/op-salesapi-resources-11.1.11-opportu nities-%7boptynumber%7d-get.html#examples GET Next we need to Register the Ws and its operation that we want to use inside sales cloud. 1 - Go to Navigator 2 -Application Composer 3- Sales 4- Web Services 5 - Click Create Web Service Reference 6 - Select REST from the popup

7 - Set Variable Name something suggestive. 8 - URL: https://crm POD /salesapi/resources/latest/opportunities/##optynumber## 9 - Select Invoke with basic authentication 10 - create your Credential Key(Should be your admin user, since Ws are used across the environment so it should be a user with a lot of access) 11 - Select GET Method 12 - Format JSON 13 - Select Schema URL 14 - Select Response Payload Code Sample and you need to provide an respons example that you can get from the official RESt documentation in Oracle Docs

Example of Response: { "PrimaryOrganizationId" : 204, "CurrencyCode" : "USD", "SalesMethodId" : 100000012430001, "SalesStageId" : 100000012430007, "Name" : "Major Server Upgrade", "OptyId" : 300100111705686, "OptyNumber" : "CDRM_332708", "OwnerResourcePartyId" : 3807 } 15 - Save and Close Now you can use this REST GET WS operation into your script. In this example I will call the WS from a action button on opportunity and display the response in a custom field on the opportunity page.

Code: def OptyNumber = OptyNumber def x = adf. webservices. GET_Opportunity. GET ( OptyNumber) setattribute ( 'A_Rez_c', x) The result is:

As you can see we have a response POST Will create a new Opportunity by just specifying the Name

Payload Code Sample Example: { "Name" : "Major Application Upgrade"} Response Code Sample { BudgetAvailableDate : null, BudgetedFlag : false, PrimaryOrganizationId : 204, ChampionFlag : false, CreatedBy : "SALES_ADMIN", CreationDate : "2015-06-04T03:08:27-07:00", CurrencyCode : "USD", SalesMethodId : 100000012430001, SalesStageId : 100000012430007, Name : "Major Application Upgrade", OptyId : 300100111705686 } Using it in the Action Button code:

Code: def opty = adf. webservices. POST_Opportunity try{ // Create new Opportunity object by passing Oportunity name // Set Content-Type request header def Name =[ Name : 'TesNewOptyREST'] def httpheaders =[ 'Content-Type' : 'application/vnd.oracle.adf.resourceitem+json'] opty. requesthttpheaders = httpheaders def newopty = opty. POST ( Name) } catch ( Exception e ){ println ( "Headers:" + opty. responsehttpheaders) println ( "-----------------------------------------------------") println ( "Status:" + opty. statuscode) println ( "-----------------------------------------------------") println ( "Error:" + e) println ( "-----------------------------------------------------") }

As you can see a New Opportunity was Created when AA button was pressed PATCH Will use Opportunity Patch Operation to update the Name of the Opportunity Opened.

Payload Code Sample Example: { "Name" : "Major Application Upgrade"} Response Code Sample { BudgetAvailableDate : null, BudgetedFlag : false, PrimaryOrganizationId : 204, ChampionFlag : false, CreatedBy : "SALES_ADMIN", CreationDate : "2015-06-04T03:08:27-07:00", CurrencyCode : "USD", SalesMethodId : 100000012430001, SalesStageId : 100000012430007, Name : "Major Application Upgrade", OptyId : 300100111705686 } Code in the Action Button:

def opty = adf. webservices. PATCH_Opportunity try{ // Create new Opportunity object by passing Oportunity name // Set Content-Type request header def OptyNumber = OptyNumber def Name =[ Name : 'PATCH_NEW_NAME'] def httpheaders =[ 'Content-Type' : 'application/vnd.oracle.adf.resourceitem+json'] opty. requesthttpheaders = httpheaders def newopty = opty. PATCH ( OptyNumber, Name) } catch ( Exception e ){ println ( "Headers:" + opty. responsehttpheaders) println ( "-----------------------------------------------------") println ( "Status:" + opty. statuscode) println ( "-----------------------------------------------------") println ( "Error:" + e) println ( "-----------------------------------------------------") } The Result

As you can see name changed, which means opportunity was updated via PATCH REST Operation Using a 3th party REST API webservice inside Sales Cloud For this example I will be using a REST WS that is public and free that will get a country code and return the name of the country and few informations about that country. The REST WS used is this one: URL: http://services.groupkt.com/country/get/iso2code/##countryname## You can find it free at this address : http://www.groupkt.com/post/c9b0ccb9/country-and-other-related-rest-webservices.htm As before you must register this Ws in Sales Cloud, but unlike the previous examples you will chose none for authentication as it is public and free and does not require authentication for it to be used. This Webservice also supports only GET Operation, so that is what we will use.

You can sue as Response Payload Code Sample the following: { "RestResponse" : { "messages" : [ "More webservices are available at http://www.groupkt.com/post/f2129b88/services.htm", "Country found matching code [IN]." ], "result" : { "name" : "India", "alpha2_code" : "IN", "alpha3_code" : "IND" } }} Next I will use this in the same Action Button as before. However the Setup will be that I will type a Country code in a Custom Text field and Return the result in a Long Text Field for that country code.

def CountryCode = CountryCode_c def getcountryinfo = adf. webservices. CountryRestful. GET ( CountryCode) setattribute ( 'A_Rez_c', getcountryinfo) So it gets the country code from field CountryCode_c and feeds it into the webservice, the response will populate the field A_Rez_c The result is as below: