Create custom object data

post

/api/REST/1.0/data/customObject/{id}

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 : 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 : 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 custom object data new data (records) for custom object assets using an HTTP request and cURL. For more information on requests, see API requests.

HTTP Request Example

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


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

Request body:


{
    "type": "CustomObjectData",
    "fieldValues": [
        {
            "id": "102",
            "value": "Nightcrawler"
        },
        {
            "id": "103",
            "value": "nightcrawler@mutant.com"
        }
    ]
}
			

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":"23",
    "fieldValues":[
        {
            "id":"102",
            "value":"Nightcrawler"
        },
        {
            "id":"103",
            "value":"nightcrawler@mutant.com"
        }
    ]
}
			

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":"102","value":"Nightcrawler"},{"id":"103","value":"nightcrawler@mutant.com"}]}' https://secure.p03.eloqua.com/api/REST/1.0/data/customObject/12
			
Back to Top