How To Use REST API To Create Opportunity And Opportunity Contact (Doc ID 2223822.1)

Last updated on JANUARY 17, 2017

Applies to:

Oracle Fusion Sales Cloud Service - Version 11.1.11.1.0 and later
Information in this document applies to any platform.

Goal

On : 11.1.11.1.0 version, Opportunities

REST API to create Opportunity and Opportunity Contact

When tried to create Opportunity using REST API together with the contact information. It returns error.

URL: https://[HOSTNAME]/salesApi/resources/11.1.11/opportunities/

Method: POST

Body:
{
"Name" : "opp test API user",
"OptyNumber" : "A000001",
"Venue_c" : "CP416F",
"Organiser_c" : "abc",
"EventYear_c" : "2016",
"PerformanceCode_c" : "16XXXXXX",
"Interest_List_Opportunity_c": "Classica Music/Orchestra,Chamber Music,Vocal,Cabaret,Early Music",
"OpportunityContact":[{ "PartyName":"Test User", "EmailAddress":"email@abc.com"}]
}


Return the following results:

Attribute EmailAddress in view object OpportunityEO_OpportunityContact_OpportunityVOToOpportunityContactVO_OpportunityContactVO cannot be set.Attribute EmailAddress in view object OpportunityEO_OpportunityContact_OpportunityVOToOpportunityContactVO_OpportunityContactVO cannot be set.


Questions:
1. Can we create a new Contact for the Opportunity we created using REST API whether the contact exists or not exist in the Contact in Sales Cloud?
2. How to create Opportunity and Opportunity Contact together in REST API or need to create them one by one?
 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms