Oracle CRM On Demand REST API Developer's Guide > Using the Oracle CRM On Demand REST API >

Converting Oracle CRM On Demand Leads


You can use the Oracle CRM On Demand REST API to create Account, Contact, and Opportunity resources, or copy lead information to existing resources by converting the Lead resource to an Opportunity resource.

The following details are for a request to convert a Lead resource to an Opportunity resource and create new Account and Contact records for the Lead resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L
  • HTTP Method: POST
  • Content-Type: application/vnd.oracle.adf.resource+json
  • Request body:

{"actions": {
   "name": "convertLead",
   "parameters": [
     {"AccountName": "lead6"},
     {"ContactFirstName": "Lead6"},
     {"ContactLastName": "Rest"},
     {"OpportunityName": "lead6"},
     {"PotentialRevenue": 100000},
     {"EstimatedCloseDate": "2014-05-08T00:00:00Z"},
     {"NextStep": "ddddd"},
     {"Description": "ffffff"}
   ]
 }
}

The following are the details for the response to a successful request and the links to the newly-created account, contact, and opportunity resources:

  • HTTP Code: 201
  • Content-Type: application/vnd.oracle.adf.resource+json
  • Location: https://<host>/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L
  • Response body:

{
    "LeadFirstName": "lead 6",
    "LeadLastName": "REST",
    "AccountName": "lead6",
    "ContactFullName": "Lead6 Rest",
    "OpportunityName": "lead6",
    "links": {
       "self": {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L"
       },
       "canonical": {
          "rel": "canonical",
          "href": "/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L"
       },
       "AccountName": {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22WT7M"
       },
       "ContactFullName": {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Contacts/1QA2-22WT7N"
       },
       "OpportunityName": {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Opportunities/1QA2-22WT7P"
       },
       "Activities": {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L/child/Activities"
       },
       "CustomObjects4": {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L/child/CustomObjects4"
       },
       "DealRegistrations": {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Leads/1QA2-22WT7L/child/DealRegistrations"
       }
   }
}

Oracle CRM On Demand REST API Developer's Guide, Release 32 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.