It looks like you are using the undocumented async version of the sync endpoint.
The async endpoint given in the documentation is: /data/v1/async/dataextensions/{id}/rows
This is the endpoint that requires the 'items' payload, like what you have.
{
"items": [{
"PersonId":"sampleId",
"ActivityCode" : "sample_string",
"ActivityDate": "12/12/12",
"ActivitySource": "sample_string"
}]
}
But since you are using an undocumented, but valid, endpoint (/hub/v1/dataeventsasync/key:{key}/rowset
), you need to use the same payload as the sync version with 'Key" and 'Values', not 'Items'.
[
{
"keys":{
"Email": "[email protected]"
},
"values":{
"LastLogin": "2013-05-23T14:32:00Z",
"IsActive": true,
"FirstName": "John",
"FollowerCount": 2,
"LastName": "Smith"
}
},
{
"keys": {
"Email": "[email protected]"
},
"values":{
"LastLogin": "2013-05-23T14:32:00Z",
"IsActive": true,
"FirstName": "Jane",
"FollowerCount": 2,
"LastName": "Smith"
}
}
]
Once you change the payload (or the endpoint), the error goes away and it successfully inserts the records. Do note however that the returned payload on the dataeventsasync endpoint is literally an empty string (""
). I assume this is because the endpoint is undocumented and therefore not officially supported/completed.
/data/v1/async/dataextensions/{id}/rows
, but doing a call to get the possible endpoints for hub, I see this endpoint does exist:/hub/v1/dataeventsasync/key:{key}/rowset
. Instead of 'items', I would copy the payload of the sync - using 'key' and 'value' objects and see if that will resolve your issue. Or use the other documented endpoint