Create an external activity
post
/api/rest/2.0/data/activity
Creates an external activity that matches the criteria specified by the request body.
Request
Supported Media Types
- application/json
The request body defines the details of the external activity to be created.
Root Schema : ExternalActivities
Type:
object
Title:
Show Source
ExternalActivities
-
activityDate:
string
The date the external activity was performed by the associated contact.
-
activityType:
string
The activity's type.
-
assetName:
string
The name of the associated asset.
-
assetType:
string
The type of the associated asset.
-
campaignId:
integer
Id of the associated campaign. This value must correspond to a valid campaign.
-
contactId:
integer
The id of the contact who performed the activity. This value must correspond to a valid contact.
-
createdAt:
string
Read Only:
true
The date and time the external activity was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the external activity. -
createdByName:
string
The name of the user who created the external activity.
-
currentStatus:
string
The external activity's current status.
-
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. Any other values passed are reset tocomplete
by default. For more information, see Request depth. -
description:
string
The description of the external activity.
-
fieldValues:
array fieldValues
Array containing
type
andid
values for all of the activity fields associated with a given external activity -
folderId:
string
Read Only:
true
The folder id of the folder which contains the external activity. -
id:
string
Read Only:
true
Id of the external activity. This is a read-only property. -
name:
string
The name of the external activity.
-
permissions:
array permissions
The permissions for the external activity granted to your current instance. This is a read-only property.
-
scheduledFor:
string
Read Only:
true
The date the external activity is scheduled. -
sourceTemplateId:
string
Id of the template used to create the external activity.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the external activity was last updated. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the external activity. -
updatedByName:
string
The name of the user who last updated the external activity.
Nested Schema : fieldValues
Type:
array
Array containing
Show Source
type
and id
values for all of the activity fields associated with a given external activity-
Array of:
object items
Additional Properties Allowed: additionalProperties
Nested Schema : permissions
Type:
array
The permissions for the external activity granted to your current instance. This is a read-only property.
Show Source
Response
Supported Media Types
- application/json
201 Response
Success.
Root Schema : ExternalActivities
Type:
object
Title:
Show Source
ExternalActivities
-
activityDate:
string
The date the external activity was performed by the associated contact.
-
activityType:
string
The activity's type.
-
assetName:
string
The name of the associated asset.
-
assetType:
string
The type of the associated asset.
-
campaignId:
integer
Id of the associated campaign. This value must correspond to a valid campaign.
-
contactId:
integer
The id of the contact who performed the activity. This value must correspond to a valid contact.
-
createdAt:
string
Read Only:
true
The date and time the external activity was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the external activity. -
createdByName:
string
The name of the user who created the external activity.
-
currentStatus:
string
The external activity's current status.
-
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. Any other values passed are reset tocomplete
by default. For more information, see Request depth. -
description:
string
The description of the external activity.
-
fieldValues:
array fieldValues
Array containing
type
andid
values for all of the activity fields associated with a given external activity -
folderId:
string
Read Only:
true
The folder id of the folder which contains the external activity. -
id:
string
Read Only:
true
Id of the external activity. This is a read-only property. -
name:
string
The name of the external activity.
-
permissions:
array permissions
The permissions for the external activity granted to your current instance. This is a read-only property.
-
scheduledFor:
string
Read Only:
true
The date the external activity is scheduled. -
sourceTemplateId:
string
Id of the template used to create the external activity.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the external activity was last updated. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the external activity. -
updatedByName:
string
The name of the user who last updated the external activity.
Nested Schema : fieldValues
Type:
array
Array containing
Show Source
type
and id
values for all of the activity fields associated with a given external activity-
Array of:
object items
Additional Properties Allowed: additionalProperties
Nested Schema : permissions
Type:
array
The permissions for the external activity granted to your current instance. This is a read-only property.
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.
Examples
The following examples demonstrate how to create a new external activity using an HTTP request and cURL. For more information on requests, see API requests.
HTTP Request Example
Create a new external activity:
POST /api/REST/2.0/data/activity
Content-Type: application/json
Request body:
{
"name": "Tradeshow 2021",
"assetName": "Tradeshow 2021",
"assetType": "Tradeshow",
"activityType": "Viewed a Demo",
"activityDate": "1612460136",
"campaignId": 37,
"contactId": 2405
}
Note:
TheactivityDate
must be included to successfully link an External Activity to a Contact.
Response:
{
"type": "ExternalActivities",
"id": "102332",
"depth": "complete",
"name": "Tradeshow 2021",
"activityDate": "1612460136",
"activityType": "Viewed a Demo",
"assetName": "Tradeshow 2021",
"assetType": "Tradeshow",
"campaignId": 37,
"contactId": 2405
}
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 '{"name":"Tradeshow 2021","assetName":"Tradeshow 2021","assetType":"Tradeshow","activityType":"Viewed a Demo","activityDate":"1612460136","campaignId":37,"contactId":2405}' https://secure.p03.eloqua.com/api/REST/2.0/data/activity