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
- application/json
Path Parameters
-
id(required): integer
Id of the custom object.
The request body defines the details of the custom object data to be created.
Root Schema : CustomObjectData
Type:
object
Title:
Show Source
CustomObjectData
-
contactId:
string
Id of the contact. This is a read-only property.
-
currentStatus:
string
The custom object's current status. This is a read-only property.
-
fieldValues:
array fieldValues
Array containing
type
andid
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. -
id:
string
Read Only:
true
Id of the custom object. This is a read-only property. -
type:
string
The asset's type in Eloqua. This is a read-only property.
Nested Schema : fieldValues
Type:
array
Array containing
Show Source
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.-
Array of:
object FieldValue
Title:
FieldValue
Nested Schema : FieldValue
Type:
object
Title:
Show Source
FieldValue
-
id:
string
Read Only:
true
The id of the field to be set to the corresponding value. -
type:
string
The asset's type in Eloqua. This is a read-only property.
-
value:
string
The value to set the corresponding field id to. Date values must be submitted as a unix timestamp.
Response
Supported Media Types
- application/json
201 Response
Success.
Root Schema : CustomObjectData
Type:
object
Title:
Show Source
CustomObjectData
-
contactId:
string
Id of the contact. This is a read-only property.
-
currentStatus:
string
The custom object's current status. This is a read-only property.
-
fieldValues:
array fieldValues
Array containing
type
andid
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. -
id:
string
Read Only:
true
Id of the custom object. This is a read-only property. -
type:
string
The asset's type in Eloqua. This is a read-only property.
Nested Schema : fieldValues
Type:
array
Array containing
Show Source
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.-
Array of:
object FieldValue
Title:
FieldValue
Nested Schema : FieldValue
Type:
object
Title:
Show Source
FieldValue
-
id:
string
Read Only:
true
The id of the field to be set to the corresponding value. -
type:
string
The asset's type in Eloqua. This is a read-only property.
-
value:
string
The value to set the corresponding field id to. Date values must be submitted as a unix timestamp.
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.
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