One-to-ones in responses and requests
Responses
In responses, inline child objects appear along with fields declared directly on the primary data model entity.
For example, the following shows the response to a GET /activities
call. Note that the response includes an activityLegalInfo_Ext
object with its own fields as well as fields declared directly on
Activity
, such as activityPattern
and
activityType
.
GET /common/v1/activities/xc:20201
{
"data": {
"attributes": {
"activityLegalInfo_Ext": {
"id": "cc:S2qhgxij6HvhXz6K3t39K",
"legalCaseNumber": "0003",
"legalReviewDate": "2022-05-05T07:00:00.000Z"
},
"activityPattern": "90_day_diary",
"activityType": {
"code": "general",
"name": "General"
},
Keep in mind that Cloud API does not include fields in responses when the values of those fields is NULL. Thus, in order to test the behavior of one-to-one child fields, you must GET an object that already has a one-to-one child with at least one non-NULL field.
Requests
In requests, inline child objects can be included along with fields declared directly on the primary data model entity.
For example, the following shows the request body for a PATCH
/activities
call. Note that the request includes an
activityLegalInfo_Ext
object with its own fields as well as a
field declared directly on Activity
(priority
).
PATCH /common/v1/activities/xc:20207
{
"data": {
"attributes": {
"priority": {
"code": "low"
},
"activityLegalInfo_Ext": {
"legalCaseNumber": "0004",
"legalReviewDate": "2022-05-07"
}
}
}
}