Create custom object data

post

/api/REST/2.0/data/customObject/{parentId}/instance

Creates custom object data that matches the criteria specified by the request body.

Request

Supported Media Types
Path Parameters
Body ()
The request body defines the details of the custom object data to be created.
Root Schema : CustomObjectData
Type: object
Title: CustomObjectData
Show Source
Nested Schema : fieldValues
Type: array
Array containing type and id values for all of the fields associated with a given custom object data asset. Custom object date field values must be in Unix time format.
Show Source
Nested Schema : permissions
Type: array
The permissions for the custom object data granted to your current instance. This is a read-only property.
Show Source
Nested Schema : FieldValue
Type: object
Title: FieldValue
Show Source
Back to Top

Response

Supported Media Types

201 Response

Success.
Body ()
Root Schema : CustomObjectData
Type: object
Title: CustomObjectData
Show Source
Nested Schema : fieldValues
Type: array
Array containing type and id values for all of the fields associated with a given custom object data asset. Custom object date field values must be in Unix time format.
Show Source
Nested Schema : permissions
Type: array
The permissions for the custom object data granted to your current instance. This is a read-only property.
Show Source
Nested Schema : FieldValue
Type: object
Title: FieldValue
Show Source

400 Response

Bad request. See Status Codes for information about other possible HTTP status codes.

401 Response

Unauthorized. See Status Codes for information about other possible HTTP status codes.

403 Response

Forbidden. See Status Codes for information about other possible HTTP status codes.

404 Response

The requested resource was not found. See Status Codes for information about other possible HTTP status codes.

500 Response

The service has encountered an error. See Status Codes for information about other possible HTTP status codes.
Back to Top

Examples

The following examples demonstrate how to create new custom object data (records) for a custom object using an HTTP request and cURL. For more information on requests, see API requests.

HTTP Request Example

Create new custom object data (records) for the custom object asset with Id #12:


POST /api/REST/2.0/data/customObject/12/instance
Content-Type: application/json 
			

Request body:


{
  "type": "CustomObjectData",
  "fieldValues": [
    {
      "id": "1",
      "value": "John"
    },
    {
      "id": "4",
      "value": "john.doe@oracle.com"
    }{
      "id": "18",
      "value": "1503344288"
    }
  ]
}
			

Note:

The field value ids for the elements you create here must correspond to the field value ids of the relevant custom object asset. Custom object date field values must be in Unix time.

Response:


{
  "type": "CustomObjectData",
  "id": "12",
  "createdAt": "1503505545",
  "name": "Custom Object Data Example",
  "updatedAt": "1503505545",
  "fieldValues": [
    {
      "type": "FieldValue",
      "id": "1",
      "value": "John"
    },
    {
      "type": "FieldValue",
      "id": "4",
      "value": "john.doe@oracle.com"
    },
    {
      "type": "FieldValue",
      "id": "18",
      "value": "1503344288"
    }
  ],
  "uniqueCode": "Example"
}
			

cURL Example

Here is the same example in cURL given an instance with the name APITest, username API.User, and POD of 3.


curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"type":"CustomObjectData","fieldValues":[{"id":"1","value":"John"},{"id":"4","value":"john.doe@oracle.com"}{"id":"18","value":"1503344288"}]}' https://secure.p03.eloqua.com/api/REST/2.0/data/customObject/12/instance
			
Back to Top