4Using the Oracle CRM On Demand REST API

About Using the Oracle CRM On Demand REST API with Oracle CRM On Demand

Each topic in this chapter provides examples demonstrating how to use the Oracle CRM On Demand REST API calls to interact with Oracle CRM On Demand resources. For more information about supported Oracle CRM On Demand resources, see Oracle CRM On Demand REST API Supported Resources.

Top-level and child Oracle CRM On Demand resources include fields. Field names used in the fields URL parameter, request, or response body are Web service integration tags. For more information regarding supported fields and Web service integration tags, please refer to the Oracle Web Services On Demand Guide.

Each REST API call in this chapter uses the following format:

  • An example request, which includes the following information:

    • URL. The location of the Oracle CRM On Demand REST API resource on the Oracle CRM On Demand Server. For more information about the Oracle CRM On Demand REST API URL format, see Oracle CRM On Demand REST API URL Format.

    • HTTP Method. The HTTP method used to call the Oracle CRM On Demand REST API to interact with the Oracle CRM On Demand Server. For more information about supported HTTP Methods, see Supported HTTP Methods.

    • Content-Type. The part of the HTTP header that indicates the media type of the data that is sent by the Oracle CRM On Demand REST API HTTP methods. For more information about supported HTTP headers, see Supported HTTP and Oracle CRM On Demand Header Fields.

    • Request Body. The code example for the Oracle CRM On Demand REST API request.

  • An example response, which includes the following information:

    • HTTP Code. The HTTP status code returned to indicate whether the request was successful or if there was an error. For more information about supported HTTP codes, see Standard HTTP Status Codes. For information about error formats, see Error Response Format.

    • Content-Type. The part of the HTTP header that indicates the media type of the data that is returned by the Oracle CRM On Demand REST API HTTP methods. For more information about supported HTTP headers, see Supported HTTP and Oracle CRM On Demand Header Fields.

    • Location. The header that indicates the location of a new resource created on the Oracle CRM On Demand Server.

    • Response Body. The code example for the Oracle CRM On Demand REST API response.

Getting a List of Available Oracle CRM On Demand Versions

The Oracle CRM On Demand REST API supports multiple versions of Oracle CRM On Demand. You can use the versions request to return either a list of supported versions of Oracle CRM On Demand or get a description of a specific version of Oracle CRM On Demand.

Version Attributes

The following table contains the attributes that are returned in the response to version requests.

Table Version Attributes

Version Attribute Description

version

Indicates the version number.

isLatest

Indicates whether the version is the latest version of Oracle CRM On Demand. Values are either true or false.

lifecycle

Indicates whether the version of Oracle CRM On Demand is active or deprecated.

Getting A Specific Oracle CRM On Demand Version Description

The following details are for a request to get a description of a specific version of Oracle CRM On Demand from the Oracle CRM On Demand Server:

  • URL: /OnDemand/user/Rest/028/versions

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.description+json

  • Response body:

{
     "versions": [
       {
           "version": "028",
           "lifecycle": "active",
           "isLatest": true,
           "catalog": {
           "links": {
              "self": {
               "rel": "self",
               "href": "/OnDemand/user/Rest/028/describe"
              },
              "canonical": {
               "rel": "canonical",
               "href": "/OnDemand/user/Rest/028/describe"
              }
            }
              },
              "links": {
               "self": {
                "rel": "self",
                "href": "/OnDemand/user/Rest/028/versions"
               },
                "canonical": {
                   "rel": "canonical",
                   "href": "/OnDemand/user/Rest/028/versions"
                },
                "predecessor-version": {
                   "rel": "predecessor-version",
                   "href": "/OnDemand/user/Rest/latest/versions"
                },
                "current": {
                   "rel": "current",
                   "href": "/OnDemand/user/Rest/028/versions"
                }
            }
        }
    ]

}

Getting a List of All Oracle CRM On Demand Versions

The following details are for a request to get a list of supported Oracle CRM On Demand versions from the Oracle CRM On Demand Server:

  • URL: /OnDemand/user/Rest/versions

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.description+json

  • Response body:

{
  "versions": [
    {
     "version": "026",
       "lifecycle": "deprecated",
       "catalog": {
       "links": {
         "self": {
           "rel": "self",
           "href": "/OnDemand/user/Rest/latest/describe"
          },
          "canonical": {
           "rel": "canonical",
           "href": "/OnDemand/user/Rest/latest/describe"
          }
         }
          }
          "links": {
           "self": {
           "rel": "self",
           "href": "/OnDemand/user/Rest/latest/versions"
          },
          "canonical": {
           "rel": "canonical",
           "href": "/OnDemand/user/Rest/latest/versions"
          },
          "successor-version": {
           "rel": "successor-version",
           "href": "/OnDemand/user/Rest/027/versions"
          },
          "current": {
           "rel": "current",
           "href": "/OnDemand/user/Rest/027/versions"
          }
        }
      },
        {
         "version": "028",
         "lifecycle": "active",
         "isLatest": true,
          "catalog": {
          "links": {
          "self": {
           "rel": "self",
           "href": "/OnDemand/user/Rest/028/describe"
          },
          "canonical": {
           "rel": "canonical",
           "href": "/OnDemand/user/Rest/028/describe"
          }
        }
         },
         "links": {
          "self": {
           "rel": "self",
           "href": "/OnDemand/user/Rest/028/versions"
         },
         "canonical": {
           "rel": "canonical",
           "href": "/OnDemand/user/Rest/028/versions"
         },
         "predecessor-version": {
           "rel": "predecessor-version",
           "href": "/OnDemand/user/Rest/latest/versions"
         },
         "current": {
           "rel": "current",
           "href": "/OnDemand/user/Rest/028/versions"
          }
        }
      }
    ],
    "links": {
     "self": {
      "rel": "self",
      "href": "/OnDemand/user/Rest/versions"
     },
     "canonical": {
       "rel": "canonical",
       "href": "/OnDemand/user/Rest/versions"
     },
     "current": {
       "rel": "current",
       "href": "/OnDemand/user/Rest/028/versions"
      }
    }
}

Creating Oracle CRM On Demand Resources

The Oracle CRM On Demand REST API supports the ability to create top-level and child resources on the Oracle CRM On Demand Server.

Note: The Oracle CRM On Demand REST API supports creating only one resource in each request.

Creating Oracle CRM On Demand Top-Level Resources

You can create Oracle CRM On Demand top-level resources by sending an HTTP POST request to the resource's URL.

The following details are for a request to create an Accounts resource on the Oracle CRM On Demand Server:

  • URL: OnDemand/user/Rest/latest/Accounts

  • HTTP Method: POST

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
  "Accounts": [
    { 
       "AccountName": "test post",
       "Location": "Hometown",
       "AccountType": "Customer",
       "PublicCompany": true,
       "Region": "West",
       "MarketShare": 3,
       "NumberEmployees": 1,
       "OptimizedCustomNumber0":99
    }
  ]
}

The following are the details for the response to a successful request:

  • HTTP Code: 201

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Location: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX

  • Response body:

{
  "Accounts": [
    {
       "Region": "West",
       "PublicCompany": true,
       "OptimizedCustomNumber0": 99,
       "MarketShare": 3,
       "Location": "Hometown",
       "AccountName": "test post",
       "NumberEmployees": 1,
       "AccountType": "Customer",
       "links":    {
          "self":       {
           "rel": "self",
           "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX"
          },
          "canonical":       {
            "rel": "canonical",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX"
          },
          "Opportunity":             {
             "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX/child/Opportunities"
          }
       }
    }
  ]

}

Creating Oracle CRM On Demand Child Resources

You can create Oracle CRM On Demand child resources by sending an HTTP POST request to the resource's URL.

The following details are for a request to create a child Activities resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22P076/child/Activities

  • HTTP Method: POST

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
   "Activities": [
    {
      "Activity": "Task",
      "Subject": "Task1"           
    }
  ]
}

The following are the details for the response to a successful request:

  • HTTP Code: 201

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Location: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22P076/child/Activities/1QA2-22U11G

  • Response body:

{
  "Activities": [
    {
       "Activity": "Task",
       "Subject": "Task1",
       "links": {
         "self": {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22P076/child/Activities/1QA2-22U11G"
          },
       "canonical": {
          "rel": "canonical",
          "href": "/OnDemand/user/Rest/latest/Activities/1QA2-22U11G"
          },
       "parent": {
          "rel": "parent",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22P076"
          },
       "CustomObjects15": {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Activities/1QA2-22U11G/child/CustomObjects15"
          }
       }
    }
  ]
}

Retrieving Oracle CRM On Demand Resources

The Oracle CRM On Demand REST API supports the ability to retrieve top-level and child resources from the Oracle CRM On Demand Server.

Retrieving Oracle CRM On Demand Top-Level Resources

You can retrieve Oracle CRM On Demand top-level resources by sending an HTTP GET request to the resource's URL.

The following details are for a request to retrieve an Accounts resource on the Oracle CRM On Demand Server:

  • URL: /OnDemand/user/Rest/latest/Accounts/1QA2-21SEFY?fields=AccountName,Location

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts": [
    {
       "AccountName": "test get",
       "Location": "HomeTown",
       "links":    {
         "self": {
         "rel": "self",
         "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFY"
         },
       "canonical": {
          "rel": "canonical",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFY"
         }
       "Opportunities": {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFY/child/Opportunities"
          }
       }
     }
  ]
}

Retrieving Oracle CRM On Demand Child Resources

You can retrieve Oracle CRM On Demand child resources by sending an HTTP GET request to the resource's URL.

The following details are for a request to retrieve a child Opportunities resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-LXMA3/child/Opportunities/1QA2-22HIFC?fields=OpportunityName

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Location: https://<host>/OnDemand/user/Rest/latest/Accounts/ZSXV-2345/child/Opportunities

  • Response body:

{
  "Opportunities": [
    {
       "OpportunityName": "ENAME3",
       "links": {
          "self": {
          "rel": "self",
          "href": "/Accounts/ZSXV-2345/child/Opportunities/ABCD-1234"
          },
       "canonical": {
          "rel": "canonical",
          "href": "/Opportunities/ABCD-1234"
          },
       "parent": {
          "rel": "parent",
          "href": "/Accounts/ZSXV-2345"
          }
       "CustomObjects15": {
         "rel": "child",
         "href": "/OnDemand/user/Rest/latest/Opportunities/ABCD-1234/child/CustomObjects15"
         }
       }
    }
  ]

}

Updating Oracle CRM On Demand Resources

The Oracle CRM On Demand REST API supports the ability to update top-level and child resources on the Oracle CRM On Demand Server.

Updating Oracle CRM On Demand Top-Level Resources

You can update Oracle CRM On Demand top-level resources by sending an HTTP PATCH request to the resource's URL.

The following details are for a request to update an Accounts resource on the Oracle CRM On Demand Server:

  • URL: OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX

  • HTTP Method: PATCH

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
  "Accounts": [
     {
       "AccountName": "test put",
       "Location": "Hometown2",
       "AccountType": "Customer",
       "PublicCompany": false,
       "Region": "East",
       "MarketShare": 30,
       "NumberEmployees": 10,
       "OptimizedCustomNumber0":99
     }
  ]
}

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts": [
    {
       "Region": "East",
       "PublicCompany": false,
       "OptimizedCustomNumber0": 99,
       "MarketShare": 30,
       "Location": "Hometown2",
       "AccountName": "test put",
       "NumberEmployees": 10,
       "AccountType": "Customer",
       "links":    {
          "self":       {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX"
          },
       "canonical":       {
          "rel": "canonical",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX"
          },
        "Opportunities":             {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21SEFX/child/Opportunities"
         }
       }
     }
  ]
}

Updating Oracle CRM On Demand Child Resources

You can update Oracle CRM On Demand child resources by sending an HTTP PATCH request to the resource's URL.

The following details are for a request to update a child Activities resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22P076/child/Activities/1QA2-22U11G

  • HTTP Method: PATCH

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
   "Activities": [
    {
       "Subject": "New Task Subject"           
    }
  ]

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Location: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22P076/child/Activities/1QA2-22U11G

  • Response body:

{
  "Activities": [
    {
       "Subject": "New Task Subject",
       "links": {
          "self": {
          "rel": "self",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22P076/child/Activities/1QA2-22U11G"
           },
       "canonical": {
          "rel": "canonical",
          "href": "/OnDemand/user/Rest/latest/Activities/1QA2-22U11G"
          },
       "parent": {
          "rel": "parent",
          "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22P076"
          },
       "CustomObjects15": {
          "rel": "child",
          "href": "/OnDemand/user/Rest/latest/Activities/1QA2-22U11G/child/CustomObjects15"
          }
       }
    }
  ]
}

Deleting Oracle CRM On Demand Resources

The Oracle CRM On Demand REST API supports the ability to delete top-level and child resources on the Oracle CRM On Demand Server.

Note: User and Product resources do not support the delete operation.

Deleting Oracle CRM On Demand Top-Level Resources

You can delete Oracle CRM On Demand top-level resources by sending an HTTP DELETE request to the resource's URL.

The following details are for a request to delete an Accounts resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-21UI43

  • HTTP Method: DELETE

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 204

  • Content-Type: None

  • Response body: None

Deleting Oracle CRM On Demand Child Resources

You can delete Oracle CRM On Demand child resources by sending an HTTP DELETE request to the resource's URL.

The following details are for a request to delete a child Opportunities resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-LXMA3/child/Opportunities/1QA2-22HIFC

  • HTTP Method: DELETE

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 204

  • Content-Type: None

  • Response body: None

About Collection Resources

REST API collection resources provide access to lists of Oracle CRM On Demand resources. For example, you can use a collection resource to request a list of Accounts. The Oracle CRM On Demand REST API collection resources include Oracle CRM On Demand top-level and child resources. For more information about Oracle CRM On Demand REST API supported resources, see Oracle CRM On Demand REST API Supported Resources.

To acquire a collection resource list, you submit an HTTP GET request to the Oracle CRM On Demand collection resource URL. Oracle CRM On Demand collection resources can be paged, sorted, and queried.

Retrieving Oracle CRM On Demand REST API Collection Lists

The Oracle CRM On Demand REST API supports the ability to retrieve collection lists for top-level and child resources on the Oracle CRM On Demand Server.

Retrieving a Collection Top-Level Resource List

You can retrieve Oracle CRM On Demand collection top-level resources by sending an HTTP GET request to the collection resource's URL.

The following details are for a request to retrieve a list of Accounts resources on the Oracle CRM On Demand Server. The example includes the limit and offset paging parameters to limit the collection resource list. For more information about paging collection resources, see Paging Collection Resources.

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts?fields=AccountName,Location&limit=2&offset=0

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts":    [
    {
       "AccountName": "ACME Computer Parts",
       "Location": "Hometown",
          "links":          {
              "self":             {
               "rel": "self",
               "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBR"
             },
            "canonical":             {
               "rel": "canonical",
               "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBR"
             },
             "Opportunity":             {
               "rel": "child",
               "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBR/child/Opportunities"
             },
         }
       },
    {
       "AccountName": "Big Industry Inc.",
       "Location": "Capital City",
            "links":          {
            "self":             {
               "rel": "self",
               "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY"
             },
             "canonical":             {
               "rel": "canonical",
               "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY"
             }
            "Opportunities":             {
               "rel": "child",
                "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY/child/Opportunities"
            },
          }
        }
     ],
  "links": {"self":    {
     "rel": "self",
     "href": "/OnDemand/user/Rest/latest/Accounts"
  }},
     "_contextInfo":    {
     "limit": 2,
     "offset": 0
  }
}

Retrieving a Collection Child Resource List

You can retrieve Oracle CRM On Demand collection child resources by sending an HTTP GET request to the collection resource's URL.

The following details are for a request to retrieve a list of child Opportunities resources on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY/child/Opportunities?fields=OpportunityName,SalesStage&limit=2&offset=0

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Opportunities":    [
    {
       "OpportunityName": "2500 Barebones with Graphics Upgrade",
       "SalesStage": "Qualified Lead",
       "links":          {
          "self":             {
            "rel": "self",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY/child/Opportunities/1QA2-21ATCX"
          },
          "canonical":             {
            "rel": "canonical",
            "href": "/OnDemand/user/Rest/latest/Opportunities/1QA2-21ATCX"
          },
          "parent":             {
            "rel": "parent",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY"
          }
          "Leads":             {
            "rel": "child",
            "href": "/OnDemand/user/Rest/latest/Opportunities/1QA2-21ATCX/child/Leads"
          }
      }
     },
     {
       "OpportunityName": "insert account -opp by rest",
       "SalesStage": "Qualified Lead",
       "links":          {
          "self":             {
            "rel": "self",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY/child/Opportunities/1QA2-21YFHJ"
          },
          "canonical":             {
            "rel": "canonical",
            "href": "/OnDemand/user/Rest/latest/Opportunities/1QA2-21YFHJ"
          },
          "parent":             {
            "rel": "parent",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY"
          },
          "Leads":             {
            "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Opportunities/1QA2-21YFHJ/child/Leads"
          }
       }
     }
  ],
    "links": {"self":    {
       "rel": "self",
       "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBY/child/Opportunities"
      }
    },
     "_contextInfo":    {
       "limit": 2,
       "offset": 0
     }
}

Using the Finder Parameter for Predefined Queries and Customized Lists

Oracle CRM On Demand REST API supports the retrieval of predefined queries and custom list resources by using the finder parameter.

The finder parameter is supported only for top-level objects. Each managed list includes filter criteria, display fields, and a sort field. The fields and orderBy parameters can be used to override the display fields and sort used by the managed list. For more information about sorting collection resources, see Sorting Collection Resources.

You can also use the q parameter along with the finder parameter in the URL to further filter your list of Oracle CRM On Demand resources.

In the example below, the q parameter is used to retrieve PSKDemo02 and A.C. Networks accounts on the Oracle CRM On Demand Server. For more information about using the q parameter to query resource collections, see Querying a Collection Resource.

https://<host>/OnDemand/user/Rest/latest/Accounts?q=AccountName='PSKDemo02' OR 'A. 
C. Networks';Reference = false&limit=5&offset=0

The following details are for a request to retrieve a list of Accounts using the finder parameter on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts?finder=My Accounts&limit=5&offset=0

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts": [
    {
       "AccountName": "A. C. Networks",
       "Location": "11431",
       "Priority": "",
       "AccountType": "Service Company",
       "Industry": "",
       "Reference": false,
       "Owner": "restuser",
       "links": {
          "self": {
            "rel": "self",
            "href": "/OnDemand/user/Rest/latest/Accounts/1-FDFUZ"
          },
          "canonical": {
            "rel": "canonical",
            "href": "/OnDemand/user/Rest/latest/Accounts/1-FDFUZ"
          },
          "Owner": {
             "rel": "self",
             "href": "/OnDemand/user/Rest/latest/Users/1QA2-22B4TF"
          },
        }
     },
     {
       "AccountName": "PSKDemo02",
       "Location": "",
       "Priority": "",
       "AccountType": "",
       "Industry": "",
       "Reference": false,
       "Owner": "restuser",
       "links": {
          "self": {
             "rel": "self",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI"
          },
          "canonical": {
             "rel": "canonical",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI"
          },
          "Owner": {
             "rel": "self",
             "href": "/OnDemand/user/Rest/latest/Users/1QA2-22B4TF"
          },
          "AccountNotes": {
              "rel": "child",
              "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/AccountNotes"
          },
          "Accounts": {
              "rel": "child",
              "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/Accounts"
          },
          "Leads": {
              "rel": "child",
              "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/Leads"
          },
          "AccountPartners": {
              "rel": "child",
              "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/AccountPartners"
          },
          "Opportunities": {
             "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/Opportunities"
          },
          "AccountTeams": {
             "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/AccountTeams"
          },
          "AccountCompetitors": {
             "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/AccountCompetitors"
          },
          "ServiceRequests": {
             "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/ServiceRequests"
          },
          "Activities": {
             "rel": "child",
             "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/Activities"
          },
         "CustomObjects8": {
            "rel": "child",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/CustomObjects8"
         },
         "AccountAddresses": {
            "rel": "child",
            "href": "/OnDemand/user/Rest/latest/Accounts/1QA2-22EWBI/child/AccountAddresses"
         }
       }
     }
],
  "links": {
     "self": {
       "rel": "self",
       "href": "/OnDemand/user/Rest/latest/Accounts"
     }
},
 "_contextInfo": {
     "limit": 5,
     "offset": 0
  }
}

Querying a Collection Resource

You can search for specific resources in a collection by using query parameters in the URL to specify your search criteria. You can use a combination of different query parameters to filter, page, and sort the query results. Query terms such as AND, OR, LIKE, TRUE, and FALSE, are case insensitive, while all field identifiers and values are case sensitive. For information about special search fields that you can use to avoid the case sensitivity on the regular search fields, see Special Search Fields.

You can query resource collections using the q URL parameter with query expressions to specify search criteria. The maximum supported expression length is 4096 characters.

The following is the query expression syntax:

QUERY EXPRESSION = FIELD EXPRESSION [; FIELD EXPRESSION]
[FIELD EXPRESSION] = <Field> <OPERATOR> <VALUE> [ANDOR CLAUSE]  
[ANDOR CLAUSE] = <AND/OR> <OPERATOR> <VALUE> [ ANDOR CLAUSE] 

The following in an example of a query expression:

 AccountName='PSKDemo02' OR  = 'A. C. Networks'; Reference = false

The previous query expression example is comprised of two field expressions and the two expressions are separated with a semi-colon.

AccountName="PSKDemo02" OR = "A. C. Networks"
Reference = false

The first field expression includes a field (AccountName), an operator (=), a value ("PSKDemo02"), and then an optional ANDOR clause. The ANDOR clause is comprised of either AND or OR (in this example OR), an operator (=), and a value ("A. C. Networks"). Reference is an Account field, where the false value indicates that the account cannot be used as a reference for potential customers or sales representatives to contact.

Supported Query Operators

The following table lists the supported query operators that you can use in query expressions.

Table Supported Query Operators

Operator Description

=

Equals

>

Greater than

<

Less than

>=

Greater than or equal to

<=

Less than or equal to

AND

The Boolean AND operator

OR

The Boolean OR operator

LIKE

The LIKE query operator

Supported Query Characters

A query expression must not contain null values. The following table contains the query characters supported for Oracle CRM On Demand REST API.

Table Supported Query Characters

Query Character Description

" " or

‘ ’

The quotation marks are used to define literals. Literals can be enclosed in either single quotation marks or in double quotation marks.

;

The semi-colon is used to separate multiple expressions. It must not be used at the end of an expression, if there are no further expressions.

\

The backslash is used to escape a special character.

*

The asterisk indicates a wildcard character.

Special Search Fields

Some field names are prefixed with CI_ to denote that they are special fields that provide better search functionality. CI_ fields have all upper case values and can be used for searching.

In the example below, AccountName is returned with capitalization:

/Rest/latest/Accounts/1QA2-22FKWR?fields=Id,CI_AccountName 

LOVLanguageMode Querying

The Oracle CRM On Demand REST API supports using the LOVLanguageMode input argument to query the Oracle CRM On Demand Server. The LOVLanguageMode input argument determines whether query processing for picklist fields occurs using language independent codes (LIC) or language dependent codes (LDC). LIC is the default value.

LOVLanguageMode values are specified in the REST API request as a header field. For more information about supported HTTP and Oracle header fields, see Supported HTTP and Oracle CRM On Demand Header Fields.

If LIC is specified in the REST API request header field, then any values specified in the query must be language independent values. These values are used in the processing of the query and any values returned in the response are language independent values that can be used regardless of a user’s language. If LDC is specified, then Oracle CRM On Demand converts any values that are specified in the query to LIC values before performing the query, and any values returned in the response are in the user's language.

For example, you have a custom picklist field where the English value is: One. In French, the value is: Un. The language independent value is: 'Option 1'. The following REST API request includes an LOVLanguageMode argument specifying a LIC return value for the custom picklist field:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22RT5M?fields=CustomPickList0

  • HTTP Method: GET

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Accept-Language: fr

  • LOVLanguageMode: LIC

  • Request body: None

The following are the details for the response that returns the LIC value for the custom picklist:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts":[
  {
    "CustomPickList0": "Option1",   
  ]
}

The following REST API request includes an LOVLanguageMode argument specifying a French LDC return value for the custom picklist:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22RT5M?fields=CustomPickList0

  • HTTP Method: GET

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Accept-Language: fr

  • LOVLanguageMode: LDC

  • Request body: None

The following are the details for the response that returns a LDC value for the custom picklist:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts":[
  {
    "CustomPickList0": "Un",   
  ]
}

Sample Query Request and Response

The following is a sample query REST API request and response. In this example, this query searches for an Accounts resource where the CustomCurrency0 field has a 10000.50 value.

  • URL: URL https://<host>/OnDemand/user/Rest/latest/Accounts?fields=AccountName,CustomCurrency0&q=CustomCurrency0=10000.50

  • Response body:

{
   "Account": [
     {
        "AccountName": "test",
        "CustomCurrency0": {
           "type": "currency",
           "value": "10000.50",
           "Modifier": "USD"
        },
        "links": {
           "self": {
             "rel": "self",
             "href": "/OnDemand/user/Rest/Account/1QA2-22D3XZ"
           },
           "canonical": {
             "rel": "canonical",
             "href": "/OnDemand/user/Rest/Account/1QA2-22D3XZ"
           },
        }
     }
   ],
     "links": {
        "self": {
           "rel": "self",
           "href": "/OnDemand/user/Rest/Account"
       }
      },
      "_contextInfo": {
        "limit": 100,
        "offset": 0
   }
}

REST API Query Expression Parser Errors

REST API query expression parser errors are returned in the REST API error response when Oracle CRM On Demand is unable to parse a query expression. For more information about Oracle CRM On Demand REST API error response format, see Error Response Format.

The following table contains REST API query expression parser errors.

Table REST API Query Expression Parser Errors

Error Description Error

Indicates an unsupported character.

REST_QUERY_PARSER_UNSUPPORTED_CHAR

Indicates that a field is not searchable.

REST_QUERY_PARSER_FLD_NOT_SEARCHABLE

Indicates an invalid field name.

REST_QUERY_PARSER_INVALID_FIELD

Indicates an invalid operator.

REST_QUERY_PARSER_INVALID_OPERATOR

Indicates that an operator was not found.

REST_QUERY_PARSER_OPERATOR_NOT_FOUND

Indicates an invalid string literal.

REST_QUERY_PARSER_INVALID_STRING

Indicates an unclosed string literal.

REST_QUERY_PARSER_UNCLOSED_STRING

Indicates an unsupported special character escape sequence.

REST_QUERY_PARSER_UNSUPPORTED_ESCAPE_SEQ

Indicates an expression is too long to parse.

REST_QUERY_PARSER_EXPRESSION_TOO_LONG

Indicates that the value was not found.

REST_QUERY_PARSER_VALUE_NOT_FOUND

Indicates that an operator, such as AND or OR, was expected.

REST_QUERY_PARSER_OPERATOR_EXPECTED

Indicates that a delimiter semi-colon is expected.

REST_QUERY_PARSER_SEMICOLON_EXPECTED

Indicates an invalid record type.

REST_QUERY_PARSER_INVALID_RECORD

Indicates where the error occurred.

REST_QUERY_PARSER_AT_POSITION

Indicates an invalid field name.

REST_QUERY_PARSER_INVALID_FLD_NAME

Indicates an invalid Boolean value.

REST_QUERY_PARSER_INVALID_BOOL_VAL

Indicates an invalid wildcard value. This error occurs when a wildcard value is used with an operator other than LIKE.

REST_QUERY_PARSER_UNSUPPORTED_WILDCARD_CHAR

Sorting Collection Resources

When you list Oracle CRM On Demand collection resources, you can sort the collections list using the orderBy URL parameter. The orderBy query parameter value contains the field name, followed by either asc (ascending) or desc (descending) to specify whether the sort results return in either ascending or descending order. If there are multiple field names specified for the orderBy parameter value, then a comma is used to separate the field names.

For example:

https://<host>/user/OnDemand/Rest/latest/
Accounts?orderBy=AccountName:asc,AccountLocation:asc&limit=100&offset=0&fields=Row
Id,AccountName,AccountLocation

Paging Collection Resources

You can use paging URL parameters to limit large collection resource lists by breaking up lists into one or more pages of data. The Oracle CRM On Demand REST API supports paging for Oracle CRM On Demand top-level and child collection resources. For more information about Oracle CRM On Demand REST API supported top-level and child resources, see Oracle CRM On Demand REST API Supported Resources.

The following are optional request query parameters that you can specify to page through query results:

  • offset. Specifies how many results to skip for the first returned result. The default is 0.

  • limit. The maximum number of collection list items returned in a single request. The minimum value is 1, and the maximum value is 100. The default value is 100.

In the example below, the offset and limit parameters in the URL specify that the first 100 resources are returned in the query.

https://<host>/user/OnDemand/Rest/latest/
Accounts?orderBy=AccountName:asc,AccountLocation:asc&limit=100&offset=0&fields=Row
Id,AccountName,AccountLocation

All paged responses contain a lastpage attribute indicating whether or not the last value in the paging collection resources query set has been returned. In the example below, a paged response has the lastpage attribute set to true, indicating that the last value in the paging collection resources query set has been returned.

"_contextInfo": {
  "limit": 100,
  "offset": 0,
  "lastpage" : true
}

Retrieving Metadata about Oracle CRM On Demand Resources

You can use the describe request to return metadata information about Oracle CRM On Demand resources. The metadata information includes additional information about fields, for example, which fields are read-only and which fields are required.

The describe request can be used to show metadata information about:

  • All resources. You can use the describe request to show more information about all supported Oracle CRM On Demand resources, including the actions (create, retrieve, update, and delete) supported for the resource, and links to retrieve the parent and child resources.

An example URL to show all resources:

https://<host>/OnDemand/user/Rest/latest/describe

For more information and a code sample using the describe request to show all resources, see Retrieving Metadata for All Oracle CRM On Demand Resources.

  • A resource. You can use the describe request to show more information about a particular resource, such as Accounts, including information about attachments and custom content.

An example URL to show an Accounts resource:

https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22789P/describe 

For more information and a code sample using the describe request to show a specific resource, see Retrieving Metadata for a Specific Oracle CRM On Demand Resource.

  • A collection. You can use the describe request to show more information about a collection, such as an accounts collection, including the actions (create, retrieve, update, and delete) supported for the resource, and links to retrieve the parent and child resources. The describe request does not return information about attachments or custom content.

An example URL to show an Accounts collection:

https://<host>/OnDemand/user/Rest/latest/Accounts/describe

For more information and a code sample using the describe request to show a collection, see Retrieving Metadata for an Oracle CRM On Demand Collection.

  • A child resource. You can use the describe request to show more information about a child resource.

An example URL to show an Account Notes child resource:

https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-213442/AccountNotes/
describe

For more information and a code sample using the describe request to show a child resource, see Retrieving Metadata for an Oracle CRM On Demand Child Resource.

Describe Fields Parameters

By default, the describe request returns all field values in the REST API response. You can use the fields URL parameter to limit your response output. You can use more than one fields URL parameter as long as values are separated with commas.

You can also use paging parameters with fields URL parameters to manage REST API response output. For more information about paging parameters, see Paging Collection Resources.

The following table contains the fields URL parameter values that you can use with describe requests.

Table Fields URL Parameter Values for Describe Requests

Fields URL Parameter Values Description URL Example

attributes

Returns additional information about field attributes, for example, whether the field is read-only or required or if the field has a custom integration tag.

OnDemand/user/Rest/latest/
describe?fields=attributes

collection.finders

Returns all the finders. Finders refers to managed lists or predefined queries.

OnDemand/user/Rest/latest/
describe?fields=collection.finders

collection.links

Returns the collection links.

OnDemand/user/Rest/latest/describe?fields=collection.links

collection.actions

Returns available actions, such as, GET, POST, PUT, and DELETE.

OnDemand/user/Rest/latest/describe?fields=collection.actions

item.links

Returns item links.

OnDemand/user/Rest/latest/describe?fields=item.links

item.actions

Returns the item actions.

OnDemand/user/Rest/latest/describe?fields=item.actions

children.attributes

Returns the children attributes.

OnDemand/user/Rest/latest/describe?fields=children.attributes

children.collection

Returns the children collections.

OnDemand/user/Rest/latest/describe?fields=children.collection

children.item

Returns the children items.

OnDemand/user/Rest/latest/describe?fields=children.item

children.links

Returns the children links.

OnDemand/user/Rest/latest/describe?fields=childrenlinks

links

Returns all the links.

OnDemand/user/Rest/latest/describe?fields=links

Describe Field Attributes

The following table contains the describe field attributes returned in the REST API response.

Table Describe Field Attributes

Attribute Description

name

Indicates the REST integration tag name.

type

Indicates the field type.

updatable

Indicates whether the field is read-only.

mandatory

Indicates whether the field is required and must contain a value.

queryable

Indicates whether the field is searchable.

title

Indicates the display name.

controlType

Indicates how users select the value for a filter.

The choices are to select the value from a calendar, a drop-down list, or a multiple list of values, or type it into an edit box.

maxLength

Indicates the maximum length of the field.

currencyCode

Indicates the currency code when applicable.

markfortranslation

Indicates whether an administrator needs a translator to enter the field's title in another language.

copyenabled

Indicates which fields can be copied using the Copy button.

optimized

Indicates if the field is optimized to improve performance during searches and when sorting lists.

postdefault

Indicates the field is not prepopulated with the specified value when a user creates a new record, but the field takes the specified default value when the record is saved, if:

  • The user leaves the field blank.

  • The field is hidden from the layout.

  • A value has not been supplied by the integration tools.

fieldvalidation

Indicates whether field validation is performed for a field to ensure that it has a particular value.

fieldvalidationerrormessage

The field validation error message.

casesensitivity

Indicates whether the field is case sensitive. The default value is false.

htmlfieldtag

The name of the HTML field tag.

customwsintegrationtag

The name of the custom integration tag.

Describe Examples

This topic contains examples of using the describe request to return metadata information about supported Oracle CRM On Demand resources. For information about supported Oracle CRM On Demand resources, see Oracle CRM On Demand REST API Supported Resources.

This topic includes the following examples:

Retrieving Metadata for All Oracle CRM On Demand Resources

The following details are for a request to retrieve metadata information for all resources. The example shows accounts along with some of the child resources for accounts such as account addresses, account books, and vehicles. This example uses the fields URL parameter to retrieve links metadata:

  • URL: https://<host>/OnDemand/user/Rest/latest/describe?fields=collection.links,children.links,item.links,links&offset=0&limit=1

    Note: The limit field specifies the maximum number of resource items that are returned. You can set the limit field to a maximum value of 100. The default value is 2.
  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

For more information about the fields URL parameter, see Describe Fields Parameters.

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
     "Resources": {
        "Accounts": {
           "title": "Account",
           "titlePlural": "Accounts",
           "CustomObjectTagName": "Accounts",
            "collection": {
              "links": {
                 "self": {
                    "rel": "self",
                    "href": "/OnDemand/user/Rest/latest/Accounts/"
                    "kind": "collection"
                  },
                 "canonical": {
                    "rel": "canonical",
                    "href": "/OnDemand/user/Rest/latest/Accounts/"
                    "kind": "collection"
                  }
              }
            },
            "item": {
               "links": {
                  "self": {
                     "rel": "self",
                     "href": "/OnDemand/user/Rest/latest/Accounts/{id}"
                     "kind": "item"
                   },
                  "canonical": {
                      "rel": "canonical",
                      "href": "/OnDemand/user/Rest/latest/Accounts/{id}"
                      "kind": "item"
                   },
                  "AccountAddresses": {
                      "rel": "child",
                      "href": "/OnDemand/user/Rest/latest/Accounts/{id}/child/AccountAddresses",
                      "kind": "collection",
                      "cardinality": {
                          "value": "1 to *",
                          "sourceAttributes": "Id",
                          "destinationAttributes": "AccountId"
                      }
                  },
                  "AccountBooks": {
                      "rel": "child",
                      "href": "/OnDemand/user/Rest/latest/Accounts/{id}/child/AccountBooks",
                      "kind": "collection",
                      "cardinality": {
                          "value": "1 to *",
                          "sourceAttributes": "Id",
                          "destinationAttributes": "ObjectId"
                      }
                  }
                  .
                  .
                  .
                  "Vehicles": {
                     "rel": "child",
                     "href": "/OnDemand/user/Rest/latest/Accounts/{id}/child/Vehicles",
                     "kind": "collection",
                     "cardinality": {
                         "value": "1 to *",
                         "sourceAttributes": "Id",
                          "destinationAttributes": "AccountId"
                     }
                  }
               }
            },
            "children": {
               "AccountAddresses": {
                  "title": "Account Address",
                  "titlePlural": "Account Addresses",
                  "CustomObjectTagName": "AccountAddresses",
                  "links": {
                    "describe": {
                        "rel": "describe",
                        "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountAddresses/describe",
                        "kind": "describe"
                    },
                    "canonicalDescribe": {
                         "rel": "canonicalDescribe",
                         "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountAddresses/describe",
                          "kind": "describe"
                    }
                  }
               },
               "AccountBooks": {
                   "title": "Account Book",
                    "titlePlural": "Account Books",
                    "CustomObjectTagName": "AccountBooks",
                    "links": {
                       "describe": {
                           "rel": "describe",
                           "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountBooks/describe",
                           "kind": "describe"
                       },
                       "canonicalDescribe": {
                           "rel": "canonicalDescribe",
                           "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountBooks/describe",
                           "kind": "describe"
                       }
                    }
               },
               .
               .
               .
               "Vehicles": {
                 "title": "Vehicle",
                 "titlePlural": "Vehicles",
                 "CustomObjectTagName": "Vehicles",
                 "links": {
                    "describe": {
                        "rel": "describe",
                        "href": "/OnDemand/user/Rest/latest/Accounts/child/Vehicles/describe",
                        "kind": "describe"
                    },
                    "canonicalDescribe": {
                         "rel": "canonicalDescribe",
                         "href": "/OnDemand/user/Rest/latest/Vehicles/describe",
                         "kind": "describe"
                    }
                 }
               }
            },
            "links": {
               "describe": {
                  "rel": "describe",
                  "href": "/OnDemand/user/Rest/latest/Accounts/describe"
                  "kind": "describe"
               },
               "canonicalDescribe": {
                  "rel": "canonicalDescribe",
                  "href": "/OnDemand/user/Rest/latest/Accounts/describe"
                  "kind": "describe"
               }
            }
         }
    },
    "_contextInfo": {
       "limit": 1,
       "offset": 0,
       "lastpage": false
    }
}
Retrieving All Top-Level Resources

The following details are for a request to retrieve metadata information for all top-level resources for your company. The example uses the fields URL parameter to retrieve links metadata:

  • URL: https://<host>/OnDemand/user/Rest/latest/describe?fields=links&offset=0&limit=100

    Note: The limit field specifies the maximum number of resource items that are returned. You can set the limit field to a maximum value of 100. The default value is 2.
  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

For more information about the fields URL parameter, see Describe Fields Parameters.

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Resources": {
    "Accounts": {
      "title": "Account",
      "titlePlural": "Accounts",
      "CustomObjectTagName": "Accounts",
      "links": {
        "describe": {
          "rel": "describe",
          "href": "/OnDemand/user/Rest/latest/Accounts/describe",
          "kind": "describe"
        },
        "canonicalDescribe": {
          "rel": "canonicalDescribe",
          "href": "/OnDemand/user/Rest/latest/Accounts/describe",
          "kind": "describe"
        }
      }
    },
    "AccreditationRequests": {
      "title": "Accreditation Request",
      "titlePlural": "Accreditation Requests",
      "CustomObjectTagName": "AccreditationRequests",
      "links": {
        "describe": {
          "rel": "describe",
          "href": "/OnDemand/user/Rest/latest/AccreditationRequests/describe",
          "kind": "describe"
        },
        "canonicalDescribe": {
          "rel": "canonicalDescribe",
          "href": "/OnDemand/user/Rest/latest/AccreditationRequests/describe",
          "kind": "describe"
        }
      }
    },
    .
    .
    .
    "Vehicles": {
      "title": "Vehicle",
      "titlePlural": "Vehicles",
      "CustomObjectTagName": "Vehicles",
      "links": {
        "describe": {
          "rel": "describe",
          "href": "/OnDemand/user/Rest/latest/Vehicles/describe",
          "kind": "describe"
        },
        "canonicalDescribe": {
          "rel": "canonicalDescribe",
          "href": "/OnDemand/user/Rest/latest/Vehicles/describe",
          "kind": "describe"
        }
      }
    }
  },
  "_contextInfo": {
    "limit": 100,
    "offset": 0,
    "lastpage": true
  }
}
Retrieving All Child Resources

The following details are for a request to retrieve metadata information all child resources for your company. The example shows some of the child resources for accounts such as account addresses, account books, and some of the child resources for vehicles, such as custom object 10, custom object 11, and vehicle books.The example uses the fields URL parameter to retrieve links metadata:

  • URL: https://<host>/OnDemand/user/Rest/latest/describe?fields=children.links&limit=100

    Note: The limit field specifies the maximum number of resource items that are returned. You can set the limit field to a maximum value of 100. The default value is 2.
  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

For more information about the fields URL parameter, see Describe Fields Parameters.

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Resources": {
    "Accounts": {
    "title": "Account",
    "titlePlural": "Accounts",
    "CustomObjectTagName": "Accounts",
    "children": {
      "AccountAddresses": {
        "title": "Account Address",
        "titlePlural": "Account Addresses",
        "CustomObjectTagName": "AccountAddresses",
        "links": {
          "describe": {
            "rel": "describe",
              "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountAddresses/describe",
              "kind": "describe"
          },
          "canonicalDescribe": {
            "rel": "canonicalDescribe",
            "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountAddresses/describe",
            "kind": "describe"
          }
        }
      },
      "AccountBooks": {
        "title": "Account Book",
        "titlePlural": "Account Books",
        "CustomObjectTagName": "AccountBooks",
        "links": {
          "describe": {
            "rel": "describe",
            "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountBooks/describe",
            "kind": "describe"
          },
          "canonicalDescribe": {
            "rel": "canonicalDescribe",
            "href": "/OnDemand/user/Rest/latest/Accounts/child/AccountBooks/describe",
            "kind": "describe"
          }
        }
    },
    .
    .
    .
    "Vehicles": {
      "title": "Vehicle",
      "titlePlural": "Vehicles",
      "CustomObjectTagName": "Vehicles",
      "children": {
        "CustomObjects10": {
          "title": "Custom Object 10",
          "titlePlural": "Custom Objects 10",
          "CustomObjectTagName": "CustomObjects10",
          "links": {
            "describe": {
              "rel": "describe",
              "href": "/OnDemand/user/Rest/latest/Vehicles/child/CustomObjects10/describe",
              "kind": "describe"
            },
            "canonicalDescribe": {
              "rel": "canonicalDescribe",
              "href": "/OnDemand/user/Rest/latest/CustomObjects10/describe",
              "kind": "describe"
            }
          }
        },
        "CustomObjects11": {
          "title": "Custom Object 11",
          "titlePlural": "Custom Objects 11",
          "CustomObjectTagName": "CustomObjects11",
          "links": {
            "describe": {
              "rel": "describe",
              "href": "/OnDemand/user/Rest/latest/Vehicles/child/CustomObjects11/describe",
              "kind": "describe"
            },
            "canonicalDescribe": {
              "rel": "canonicalDescribe",
              "href": "/OnDemand/user/Rest/latest/CustomObjects11/describe",
              "kind": "describe"
            }
          }
        },
        .
        .
        .
        "VehicleBooks": {
          "title": "Vehicle Book",
          "titlePlural": "Vehicle Books",
          "CustomObjectTagName": "VehicleBooks",
          "links": {
            "describe": {
              "rel": "describe",
              "href": "/OnDemand/user/Rest/latest/Vehicles/child/VehicleBooks/describe",
              "kind": "describe"
            },
            "canonicalDescribe": {
              "rel": "canonicalDescribe",
              "href": "/OnDemand/user/Rest/latest/Vehicles/child/VehicleBooks/describe",
               "kind": "describe"
            }
          }
        }
      }
    }
  },
  "_contextInfo": {
    "limit": 100,
    "offset": 0,
    "lastpage": true
  }
}
Retrieving Child Resources for a Top-Level Resource

The following details are for a request to retrieve metadata information for a given top-level resource object, for example, Business Plan. The example shows some of the child resources for a business plan such as accreditation requests, activities, and plan opportunities. The example uses the fields URL parameter to retrieve links metadata:

  • URL: https://<host>/OnDemand/user/Rest/latest/BusinessPlans/describe?fields=children.links

    Note: The limit field specifies the maximum number of resource items that are returned. You can set the limit field to a maximum value of 100. The default value is 2.
  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

For more information about the fields URL parameter, see Describe Fields Parameters.

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Resources": {
    "BusinessPlans": {
      "title": "Business Plan",
      "titlePlural": "Business Plans",
      "CustomObjectTagName": "BusinessPlans",
      "children": {
        "AccreditationRequests": {
          "title": "Accreditation Request",
          "titlePlural": "Accreditation Requests",
          "CustomObjectTagName": "AccreditationRequests",
            "links": {
              "describe": {
                "rel": "describe",
                "href": "/OnDemand/user/Rest/latest/BusinessPlans/child/AccreditationRequests/describe",
                "kind": "describe"
              },
              "canonicalDescribe": {
                "rel": "canonicalDescribe",
                "href": "/OnDemand/user/Rest/latest/AccreditationRequests/describe",
                "kind": "describe"
              }
            }
        },
        "Activities": {
          "title": "Activity",
          "titlePlural": "Activities",
          "CustomObjectTagName": "Activities",
          "links": {
            "describe": {
              "rel": "describe",
              "href": "/OnDemand/user/Rest/latest/BusinessPlans/child/Activities/describe",
              "kind": "describe"
            },
            "canonicalDescribe": {
              "rel": "canonicalDescribe",
              "href": "/OnDemand/user/Rest/latest/Activities/describe",
              "kind": "describe"
            }
          }
        },
        .
        .
        .
        "PlanOpportunities": {
          "title": "Plan Opportunity",
          "titlePlural": "Plan Opportunities",
          "CustomObjectTagName": "PlanOpportunities",
          "links": {
            "describe": {
              "rel": "describe",
              "href": "/OnDemand/user/Rest/latest/BusinessPlans/child/PlanOpportunities/describe",
              "kind": "describe"
            },
            "canonicalDescribe": {
              "rel": "canonicalDescribe",
              "href": "/OnDemand/user/Rest/latest/PlanOpportunities/describe",
              "kind": "describe"
            }
          }
        }
      }
    }
  },
  "_contextInfo": {
    "limit": 1,
    "offset": 0,
    "lastpage": true
  }
}

Retrieving Metadata for a Specific Oracle CRM On Demand Resource

The following details are for a request to retrieve metadata information for an accounts resource. This example uses the fields URL parameter to retrieve attribute values for the resource and shows metadata for only two of the many fields for account:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/describe?fields=attributes&offset=0&limit=1

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

For more information about describe attributes, see Describe Field Attributes.

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
   "Resources": {
        "Accounts": {
            "title": "Account",
            "titlePlural": "Accounts",
            "CustomObjectTagName": "Accounts",
                "attributes": [
                {
                   "name": "FuriganaName", // default tag name
                   "type": "string", // field type
                   "updatable": true, // readonly = false
                   "mandatory": false, // required = true
                   "queryable": true, // searchable
                   "title": "Furigana Name", // display name
                   "maxLength": 100,
                   "markfortranslation": false,
                   "copyenabled": true,
                   "optimized": false,
                   "postdefault": false,
                   "casesensitivity": false,
                   "htmlfieldtag": "Furigana Name",
                   "customwsintegrationtag": "FuriganaName"
                },
                {
                   "name": "PrimaryGroup",
                   "type": "string",
                   "updatable": false,
                   "mandatory": false,
                   "queryable": true,
                   "title": "Primary Group",
                   "maxLength": 50,
                   "markfortranslation": false,
                   "copyenabled": false,
                   "optimized": false,
                   "postdefault": false,
                   "casesensitivity": false,
                   "htmlfieldtag": "Owner Group Name",
                   "customwsintegrationtag": "PrimaryGroup"
                }
           ]
        }
     },
     "_contextInfo": {
         "limit": 1,
         "offset": 0,
         "lastpage": false
   }
}

Retrieving Metadata for an Oracle CRM On Demand Collection

The following details are for a request to retrieve metadata information about an accounts collection, including the account actions supported and links to parent and child resources:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/describe?fields=collection.actions,links

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{"Resources":
   {"Accounts":
     {
      "title":"MyAccount",
      "titlePlural":"MyAccounts",
      "CustomObjectTagName":"Accounts","collection":
     {
      "actions":[
        {
          "name":"get",
          "method":"GET",
          "responseType":["application/vnd.oracle.adf.resource+json"]},
        {
           "name":"create",
            "method":"POST",
            "responseType":["application/vnd.oracle.adf.resource+json"],
            "requestType":["application/vnd.oracle.adf.resource+json"]
         }
        ]
     },
     "links":
        {
          "describe":
           {
            "rel":"describe",
            "href":"/OnDemand/user/Rest/latest/Accounts/describe"},
           "canonicalDescribe":
           {
             "rel":"canonicalDescribe",
             "href":"/OnDemand/user/Rest/latest/Accounts/describe"}
        }
     }
   },
   "_contextInfo":{
     "limit":1,
     "offset":0,
     "lastpage":true}
}

Retrieving Metadata for an Oracle CRM On Demand Child Resource

The following details are for a request to retrieve metadata information about an Account Notes child resource:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-22789P/child/AccountNotes/describe

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{"Resources":{"AccountNotes":
   {"title":"Account Note",
   "titlePlural":"Account Notes",
   "CustomObjectTagName":"AccountNotes",
   "attributes":[
     {
      "name":"AccountId",
      "type":"string",
      "updatable":true,
      "mandatory":true,
      "queryable":true,
      "title":"MyAccount Id",
      "maxLength":15,
      "markfortranslation":false,
      "copyenabled":false,
      "optimized":false,
      "postdefault":false,
      "casesensitivity":false,
      "htmlfieldtag":"Account Id",
      "wscustomintegrationtag":"AccountId"},
     {
      "name":"Description",
      "type":"string",
      "updatable":true,
      "mandatory":false,
      "queryable":true,
      "title":"Note",
      "maxLength":16350,
      "markfortranslation":false,
      "copyenabled":true,
      "optimized":false,
      "postdefault":false,
      "casesensitivity":false,
      "htmlfieldtag":"Note",
      "wscustomintegrationtag":"Description"},
     {
      "name":"ExternalSystemId",
      "type":"string",
      "updatable":true,
      "mandatory":false,
      "queryable":true,
      "title":"ExternalUniqueID",
      "maxLength":30,
      "markfortranslation":false,
      "copyenabled":true,
      "optimized":false,
      "postdefault":false,
      "casesensitivity":false,
      "htmlfieldtag":"External System Id",
      "wscustomintegrationtag":"ExternalSystemId"},
     {
      "name":"Id",
      "type":"string",
      "updatable":false,
      "mandatory":true,
      "queryable":true,
      "title":"RowId",
      "maxLength":15,
      "markfortranslation":false,
      "copyenabled":false,
      "optimized":false,
      "postdefault":false,
      "casesensitivity":false,
      "htmlfieldtag":"Id",
      "wscustomintegrationtag":"Id"},
     {
      "name":"Subject",
      "type":"string",
      "updatable":true,
      "mandatory":true,
      "queryable":true,
      "title":"Subject",
      "maxLength":150,
      "markfortranslation":false,
      "copyenabled":true,
      "optimized":false,
      "postdefault":false,
      "casesensitivity":false,
      "htmlfieldtag":"Note Type",
      "wscustomintegrationtag":"Subject"}],
      "item":
        {
        "links":{
           "self":{
              "rel":"self",
              "href":"/OnDemand/user/Rest/latest/Accounts/1QA2-22789P/child/AccountNotes/{id}"},
            "canonical":{
               "rel":"canonical",
               "href":"/OnDemand/user/Rest/latest/Accounts/1QA2-22789P/child/AccountNotes/{id}"}},
        "actions":[{
             "name":"get",
             "method":"GET",
             "responseType":["application/vnd.oracle.adf.resource+json"]},
            {
               "name":"update",
               "method":"PATCH",
               "responseType":["application/vnd.oracle.adf.resource+json"],
               "requestType":["application/vnd.oracle.adf.resource+json"]},
           {
              "name":"delete",
              "method":"DELETE"}]
        },
      "links":{
          "describe":{
             "rel":"describe",
             "href":"/OnDemand/user/Rest/latest/Accounts/1QA2-22789P/child/AccountNotes/describe"},
            "canonicalDescribe":{
              "rel":"canonicalDescribe",
              "href":"/OnDemand/user/Rest/latest/Accounts/1QA2-22789P/child/AccountNotes/describe"}
      }
    }
  },
  "_contextInfo":
  {
   "limit":1,
   "offset":0,
   "lastpage":true}
}

Retrieving Only Resource Field Values Using the onlyData Parameter

You can use the onlyData REST API request parameter with an HTTP GET request to retrieve only field values for Oracle CRM On Demand REST API resources and collections. The onlyData response excludes links.

The following details are for a request to retrieve field value information about an Account resource:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR?onlyData=true

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "Accounts":[{
    "Id":"1QA2-21ATBR"}
  ]
}

The following details are for a request to retrieve field value information about an Accounts collection:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts?onlyData=true

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
   "Accounts":[{
     "Id":"1QA2-21ATBR"},{
     "Id":"1QA2-21ATBY"},{
     "Id":"1QA2-21AWXV"},{
     "Id":"1QA2-21AWY3"},{
     "Id":"1QA2-21RR8P"},{
     "Id":"1QA2-21RR8R"},{
     "Id":"1QA2-21UP19"},{
     "Id":"1QA2-21USBV"},{
     "Id":"1QA2-22789P"},{
     "Id":"1QA2-227E7M"},{
     "Id":"1QA2-227J34"},{
     "Id":"1QA2-227JBS"},{
     "Id":"1QA2-227JBT"},{
     "Id":"1QA2-227JBV"},{
     "Id":"1QA2-227Q47"},{
     "Id":"1QA2-229J2J"},{
     "Id":"1QA2-22EH7L"},{
     "Id":"1QA2-22Y0V1"}],
  "_contextInfo":{
    "limit":100,
    "offset":0,
    "lastpage":true
  }
}

Working with Resource Attachments

You can use the REST API enclosure URL keyword to add, retrieve, update, and remove attachment information for Custom Objects 1-40 resources.

Note: Only Custom Objects 1-40 are supported for attachments as a field.

Adding or Updating an Attachment

You can add or update an Oracle CRM On Demand resource attachment with an attachment specified in the request by sending an HTTP PUT request to the resource's URL.

Note: The HTTP PUT method is only supported for Add and Update REST API operations for enclosure attachments. The request and response attachment data are in Base64 Encoding.

The following details are for a request to add or update an attachment on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment

  • HTTP Method: PUT

  • Content-Type: json

  • Request body:

{"CustomObjects8":[
  {
    "Attachment":"Q3JpY2tldCBpcyBhIGJhdC1hbmQtYmFsbCBnYW1lIHBsYXllZCBiZXR3ZWVuIHR3byB0ZWFtcyBvZiAxMSBwbGF
5ZXJzIGVhY2ggb24gYSBmaWVsZCBhdCB0aGUgY2VudHJlIG9mIHdoaWNoIGlzIGEgcmVjdGFuZ3VsYXIgMjIteWFyZCBsb25nIHBpdGNo
LiBFYWNoIHRlYW0gdGFrZXMgaXRzIHR1cm4gdG8gYmF0LCBhdHRlbXB0aW5nIHRvIHNjb3JlIHJ1bnMsIHdoaWxlIHRoZSBvdGhlciB0Z
WFtIGZpZWxkcy4gRWFjaCB0dXJuIGlzIGtub3duIGFzIGFuIGlubmluZ3Mu",
    "AttachFileName":"Cricket",    
    "AttachFileExt":"txt"}]
  }

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: <enclosure dependent>

  • Location: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment

  • Response body:

{"CustomObjects8":[
  {
    "Attachment":"Q3JpY2tldCBpcyBhIGJhdC1hbmQtYmFsbCBnYW1lIHBsYXllZCBiZXR3ZWVuIHR3byB0ZWFtcyBvZiAxMSBwbGF
5ZXJzIGVhY2ggb24gYSBmaWVsZCBhdCB0aGUgY2VudHJlIG9mIHdoaWNoIGlzIGEgcmVjdGFuZ3VsYXIgMjIteWFyZCBsb25nIHBpdGNo
LiBFYWNoIHRlYW0gdGFrZXMgaXRzIHR1cm4gdG8gYmF0LCBhdHRlbXB0aW5nIHRvIHNjb3JlIHJ1bnMsIHdoaWxlIHRoZSBvdGhlciB0Z
WFtIGZpZWxkcy4gRWFjaCB0dXJuIGlzIGtub3duIGFzIGFuIGlubmluZ3Mu",
    "AttachFileName":"Cricket",    
    "AttachFileExt":"txt"}]
  }

Retrieving Attachments

You can retrieve Oracle CRM On Demand attachments by sending an HTTP GET request to the resource's URL.

Note: The response body is in Base64 Encoding.

The following details are for a request to retrieve an attachment on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment

  • HTTP Method: GET

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: <enclosure dependent>

  • Location: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment

  • Response body: iVBORw0KGgoAAAANSUhEUg.....FTkSuQmCC

Removing Attachments

The Oracle CRM On Demand REST API supports the ability to remove attachments on the Oracle CRM On Demand Server Using the DELETE HTTP method.

The following details are for a request to remove an attachment on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment

  • HTTP Method: DELETE

  • Content-Type: None

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 204

  • Content-Type: None

  • Location: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment

  • Response body: None

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"
       }
   }
}

Associating Books to REST API Resources

You can use the REST API to associate an existing book to existing supported REST API resources. You can see which books are supported by looking at the REST Integration Tags page in the Oracle CRM On Demand user interface. For more information about REST API Integration Tags, see Customizing REST API Integration Tags.

When you add a book child resource to an Oracle CRM On Demand resource, you must specify the BookExternalSystemId field value in the REST API request.

The following details are for a POST request to associate an existing CriticalAccounts book to an Account resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/Accounts/1QA2-238N93/child/AccountBooks

  • HTTP Method: POST

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
   " AccountBooks":[
   {
     "BookExternalSystemId":"CriticalAccounts"
   }
  ]
}

The following are the details for the response to a successful request and the links to the associated book:

  • HTTP Code: 201

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
   "AccountBooks":[
    {
      "BookExternalSystemId":"CriticalAccounts",
        "links":{
          "self":{
             "rel":"self",
             "href":"/OnDemand/user/Rest/028/Accounts/1QA2-238N93/child/AccountBooks/1QA2-2458T5"},
          "canonical":{
            "rel":"canonical",
             "href":"/OnDemand/user/Rest/028/Accounts/1QA2-238N93/child/AccountBooks/1QA2-2458T5"},
          "parent":{
             "rel":"parent",
             "href":"/OnDemand/user/Rest/028/Accounts/1QA2-238N93"
          }
       }
    }
  ]

}

Associating Teams to REST API Resources

You can use the REST API to associate an existing team child resource to existing supported REST API resources. You can see which teams are supported by looking at the REST Integration Tags page in the Oracle CRM On Demand user interface. For more information about REST API Integration Tags, see Customizing REST API Integration Tags.

When you add a team child resource to an Oracle CRM On Demand resource, you must specify the FullName field value in the REST API request.

The following details are for a POST request to associate an existing team to a Custom Object resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/CustomObjects4/1QA2-238N93/child/CustomObject4Teams

  • HTTP Method: POST

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
  "CustomObject4Teams":[
    {
    "UserId":"ABCD-1234", 
    "TeamRole":"Owner",
    "AccessCode":"Full"
    }
  ]
}

Where UserId is the row ID of the user.

The following are the details for the response to a successful request and the links to the associated team:

  • HTTP Code: 201

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "CustomObject4Teams":[{
    "FullName":"user1 user1",
    "TeamRole":"Owner",
    "AccessCode":"Full",
  "links":{
    "self":{
      "rel":"self",
      "href":"/OnDemand/user/Rest/028/CustomObjects4/1QA2-238N93/child/CustomObject4Teams/1QA2-2458T6"},
    "canonical":{
      "rel":"canonical",
      "href":"/OnDemand/user/Rest/028/CustomObjects4/1QA2-238N93/child/CustomObject4Teams/1QA2-2458T6"},
    "parent":{
      "rel":"parent",
      "href":"/OnDemand/user/Rest/028/CustomObjects4/1QA2-238N93"}
    }
  }
 ]
}

Associating Accounts to Contacts Resources

You can use the REST API to associate an Accounts resource to a Contacts resource.

The following details are for a POST request to associate a child Contacts resource (including the contact Id), Account Contacts, to an Account resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-22789P/child/AccountContacts

  • HTTP Method: POST

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
   "AccountContacts":[{
    "ContactId":"1QA2-21ATC5"
   }
 ]
}

The following are the details for the response to a successful request that returns the same Contact Id in the original request:

  • HTTP Code: 201

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
   "AccountContacts":[{
     "ContactId":"1QA2-21ATC5",
   "links":{
     "self":{
       "rel":"self",
       "href":"/OnDemand/user/Rest/028/Accounts/1QA2-22789P/child/AccountContacts/1QA2-24859P"},
     "canonical":{
       "rel":"canonical",
       "href":"/OnDemand/user/Rest/028/Accounts/1QA2-22789P/child/AccountContacts/1QA2-24859P"},
     "parent":{
       "rel":"parent",
       "href":"/OnDemand/user/Rest/028/Accounts/1QA2-22789P"
      }
    }
   }
 ]
}

Associating Contacts to Accounts and Opportunities Resources

You can use the REST API to associate existing contacts resources to existing Accounts and Opportunities resources.

The following details are for a request to associate an existing child Contacts resource (including the contact Id and role), Account Contacts, to an existing Accounts resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-22789P/child/AccountContactRoles/1QA2-23MIPS

  • HTTP Method: PATCH

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
  "AccountContactRoles":[{
    "ContactId":"1QA2-2278B3",
    "Role":"Approver"
  }
 ]
}

The following are the details for the response to a successful request and returns the role and Contact Id from the original request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
   "AccountContactRoles":[{
     "Role":"Approver",
     "ContactId":"1QA2-2278B3",
   "links":{
     "self":{
       "rel":"self",
       "href":"/OnDemand/user/Rest/028/Accounts/1QA2-22789P/child/AccountContactRoles/1QA2-23MIPS"},
     "canonical":{
        "rel":"canonical",
        "href":"/OnDemand/user/Rest/028/Accounts/1QA2-22789P/child/AccountContactRoles/1QA2-23MIPS"},
     "parent":{
        "rel":"parent",
         "href":"/OnDemand/user/Rest/028/Accounts/1QA2-22789P"}
     }
   }
 ]
}

Working with Account Contact Role Resources

You can use the REST API to add, retrieve, update, and remove Account Contact Role resources.

Creating an Account Contact Role

You can use the REST API to create an Account Contact Role resource.

The following details are for a request to create an Account Contact Role resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles

  • HTTP Method: POST

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
  "AccountContactRoles": 
  [{ 
       "ContactId": "1QA2-21ATC5", 
       "Role":"Unknown" 
  }]
} 

The following are the details for the response to a successful request:

  • HTTP Code: 201

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "AccountContactRoles": [
    {
      "Role": "Unknown",
      "ContactId": "1QA2-21ATC5",
      "links": {
        "self": {
         "rel": "self",
         "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CRNM2"
        },
        "canonical": {
         "rel": "canonical",
         "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CRNM2"
        },
        "parent": {
         "rel": "parent",
         "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR"
        }
      }
    }
 ]
}

Retrieving an Account Contact Role List

You can use the REST API to retrieve a list of Account Contact Role resources.

The following details are for a GET request to retrieve a list of Account Contact Role resources on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles?fields=AccountName,ContactFullName,Role,Order

  • HTTP Method: GET

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body: None

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "AccountContactRoles": [
   {
    "AccountName": "ACME Computer Parts",
    "ContactFullName": "John Smith",
    "Role": "Unknown",
    "Order": 0,
    "links": {
     "self": {
      "rel": "self",
      "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CRNM2"
     },
     "canonical": {
      "rel": "canonical",
      "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CRNM2"
     },
     "parent": {
      "rel": "parent",
      "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR"
     }
   }
 }
],
  "links": {
   "self": {
    "rel": "self",
    "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles"
   }
},
  "_contextInfo": {
   "limit": 100,
   "offset": 0,
   "lastpage": true
 }
}

Updating an Account Contact Role

You can use the REST API to update an Account Contact Role resource.

The following details are for a request to update an Account Contact Role resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CSXTD

  • HTTP Method: PATCH

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body:

{
  "AccountContactRoles": 
  [
   { 
     "Role":"User" 
   }
  ]
} 

The following are the details for the response to a successful request:

  • HTTP Code: 200

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Response body:

{
  "AccountContactRoles": [
  {
   "Role": "User",
   "links": {
    "self": {
     "rel": "self",
     "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CSXTD"
    },
    "canonical": {
     "rel": "canonical",
     "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CSXTD"
    },
    "parent": {
     "rel": "parent",
     "href": "/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR"
    }
   }
  }
 ]
}

Deleting an Account Contact Role

You can use the REST API to delete an Account Contact Role resource.

The following details are for a request to remove an Account Contact Role resource on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/028/Accounts/1QA2-21ATBR/child/AccountContactRoles/1QA2-2CRNM2

  • HTTP Method: DELETE

  • Content-Type: application/vnd.oracle.adf.resource+json

  • Request body: None

The following details are for a response to remove an Account Contact Role resource on the Oracle CRM On Demand Server:

  • HTTP Code: 204

  • Content-Type: Text

  • Response body: None