Request body

Use the request body to pass additional attributes for the resource. When you pass attributes in a request body, you pass the attributes as part of an object.

For example, to log in with the login resource, you pass the required username and password attributes in a login object.

Some requests include sub-objects for attributes. Declare the sub-objects before listing the related attributes.

JSON format

When you use the JSON format for version 2 REST API calls, you can optionally define a request object with the @type attribute, as shown in the following examples:

{
  "@type": "<request object>",
  "<attribute1>": "<value1>",
  "<attribute2>": "<value2>",
 }

When an attribute includes an object, state the attribute and use the object name as follows:

{
  "@type": "<request object>",
  "<attribute1>": "<value1>",
  "<attribute2>": {
     "@type": "<attribute object>",
     "<attributeA>": "<valueA>",
     "<attributeB>": "<valueB>",}
     "@type": "<attribute object>",
     "<attributeD>": "<valueD>",
     "<attributeE>": "<valueE>",}
  "<attribute3>": "<value3>",
}

For version 3 REST API calls, do not use the @type attribute.

XML format

When you use the XML format, define a request object as an enclosing set of tags, as follows:

<request object>
   <attribute1>value1</attribute1>
   <attribute2>value2</attribute2>
</request object>

When an attribute includes an object, enclose the attribute object within the attribute tags as follows:

<request object>
   <attribute1>value1</attribute1>
   <attribute2>
     <attribute object>
       <attributeA>valueA</attributeA>
       <attributeB>valueB</attributeB>
     </attribute object>
     <attribute object>
       <attributeC>valueC</attributeC>
       <attributeD>valueD</attributeD>
     </attribute object>
   </attribute2>
   <attribute3>value3</attribute3>
</request object>