Oracle CRM On Demand REST API Developer's Guide > Overview of Using the Oracle CRM On Demand REST API >
Oracle CRM On Demand REST API Response Links
A link in the Oracle CRM On Demand REST API response contains a location of a resource and metadata about that resource. The Oracle CRM On Demand REST API response can include the following types of links:
- self link. The original URL that generated the response.
For an example of a self response link, see Example of a Response Link for Self, Canonical, Parent, and Child Links.
- canonical link. The URL for the same resource as the top level resource. If you are already viewing the resource as a top-level resource, then this URL is the same as self. If this resource is not available as a top-level resource, then this link shows child resource context.
For an example of a canonical response link, see Example of a Response Link for Self, Canonical, Parent, and Child Links.
- parent link. The URL for the parent resource details. This URL of the parent resource is returned in the response only when retrieving details about a child resource.
For an example of a parent response link, see Example of a Response Link for Self, Canonical, Parent, and Child Links.
- child link. The URL for the child resource details. The URL returns the path to retrieve each child collection for this record. The href attribute contains the child value. A response can return several child links.
For an example of a child response link, see Example of a Response Link for Self, Canonical, Parent, and Child Links.
- association link. The URL of a specific resource included in the response. There can be many association links.
For an example of an association response link, see Example of an Association Response Link.
Each link contains attributes. Table 10 lists the link attributes returned in an Oracle CRM On Demand REST API response.
Table 10. Links Attributes
|
|
|
|
rel |
string |
Indicates the relationship of the linked resource to the current resource that contains the list of links. Values include:
- Self: Indicates that the linked resource is the current resource.
- Parent: Indicates that the linked resource is the parent resource.
- Child: Indicates that the linked resource is the child resource.
- Canonical: Indicates the URL for directly accessing the linked resource.
|
"links": { "self": { "rel": "self", "href": "/OnDemand/user/Rest/028/Accounts/{id}", ...
"links": { "canonical": { "rel": "canonical", "href": "/OnDemand/user/Rest/028/Accounts/{id}", ...
"links": { "parent": { "rel": "parent", "href": "/OnDemand/user/Rest/028/Accounts/{id}", ...
"links": { "AccountAddresses": { "rel": "child", "href": "/OnDemand/user/Rest/028/Accounts/1QA2-22EWBI/child/AccountAddresses", ...
|
href |
string |
Indicates the fully qualified location URL of the linked resource. |
"links": { "self": { "rel": "self", "href": "/OnDemand/user/Rest/028/Accounts/{id}", "kind" : "item" ...
|
kind |
string |
A describe link attribute that indicates context within a describe response. Values include: item, collection, and describe. For information about collections, see About Collection Resources. For more information about describe requests, see Retrieving Metadata about Oracle CRM On Demand Resources. |
"links": { "self": { "rel": "self", "href": "/OnDemand/user/Rest/028/Accounts/{id}", "kind" : "item" ... "self" : { "rel" : "self", "href" : "/OnDemand/user/Rest/028/Accounts/", "kind" : "collection" ... "describe": { "rel": "self", "href": "/OnDemand/user/Rest/028/Accountsdescribe", "kind" : "describe"
|
Example of a Response Link for Self, Canonical, Parent, and Child Links
This topic contains an example of a response that includes self, canonical, parent, and child links. For more information about response links, see Oracle CRM On Demand REST API URL Format. Request:
https://<host>/OnDemand/user/Rest/026/Accounts/1QA2-227Q47/child/Opportunities/1QA2-227Q49?fields=OpportunityName,SalesStage
Response:
{ "Opportunities": [ { "OpportunityName": "RestDoNotDelete", "SalesStage": "Closed/Won", "links": { "self": { "rel": "self", "href": "/OnDemand/user/Rest/026/Accounts/1QA2-227Q47/child/Opportunities/1QA2-227Q49" }, "canonical": { "rel": "canonical", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49" }, "parent": { "rel": "parent", "href": "/OnDemand/user/Rest/026/Accounts/1QA2-227Q47" }, "Activities": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/Activities" }, "CustomObjects4": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/CustomObjects4" }, "Leads": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/Leads" }, "Opportunities": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/Opportunities" }, "OpportunityNotes": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/OpportunityNotes" }, "OpportunityPartners": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/OpportunityPartners" }, "OpportunityRevenues": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/OpportunityRevenues" }, "OpportunityTeams": { "rel": "child", "href": "/OnDemand/user/Rest/026/Opportunities/1QA2-227Q49/child/OpportunityTeams" } } } ] }
Example of an Association Response Link
This topic contains an example of an association link. For more information about response links, see Oracle CRM On Demand REST API URL Format This example includes the primary contact field for an account in the request URL, and the response includes an association link to the specific primary contact resource. Request:
User/Rest/latest/Accounts?fields=AccountName,PrimaryContactFullName
Response:
{ "Accounts":[{ "AccountName":"ACME Computer Parts", "PrimaryContactFullName":"John Smith", "links":{ "self":{ "rel":"self", "href":"/OnDemand/user/Rest/latest/Accounts/1QA2-1ATBR"}, "canonical":{ "rel":"canonical", "href":"/OnDemand/user/Rest/latest/Accounts/1QA2-21ATBR"}, "PrimaryContactFullName":{ "rel":"self", "href":"/OnDemand/user/Rest/latest/Contacts/1QA2-21ATC5"} } } ] }
|