Hello,
I want add custom activity via REST API. Response status is "success", but all data is not registered. Because result status is "skipped".
response json is
:"Invalid attribute 'null'"},{"code":"1003","message":"Invalid attribute 'null'"},,,,,
request URL is
request body is
{"input":
[{"leadId":13
,"activityDate":"2016-07-21T01:34:25+09:00"
,"activityTypeId":100001
,"primaryAttributeValue":"something"
,"attributes":[
{"contact_datetime":"2016-07-07 01:02:01","certain_field1":"AA-BB-CC1"}
,{"contact_datetime":"2016-07-07 01:02:02","certain_field1":"AA-BB-CC2"
,{"contact_datetime":"2016-07-07 01:02:03","certain_field1":"AA-BB-CC3"}
,,,,,,
I don't know how to resolve.
If you know this solution, please let me know.
Thank you.
Solved! Go to Solution.
Can't say I understand your dev/debugging environment if you have to hand-retype the request.
In any case your payload doesn't conform at all to the docs, which show:
{
"input" : [
{
"leadId" : 1001,
"activityDate" : "2013-09-26T06:56:35+07:00",
"activityTypeId" : 1001,
"primaryAttributeValue" : "Game Giveaway",
"attributes" : [
{
"name" : "URL",
"value" : "http://www.nvidia.com/game-giveaway"
}
]
}
]
}
attributes is an array of objects. Each object has two own properties, name and value. You're doing something very different, and obvs. that's why it's breaking.
If those extra commas are actually in the request, they are creating null members. Only the last comma is ignored.
It's just truncated. radical body is more go on.
I don't understand you completely, but I'd need to see an entire body of a failed request, not a truncated one. You also have a missing right curly brace.
I'm testing another system written in PHP. In that case, there is 60 attributes in that body. I post this article edited by hand.
Admittedly, I'm missing right curly brace but, it's just mistake by hand.
In actuality, that request body generated by json_encode() function so, it is not a point of that problem.
Can't say I understand your dev/debugging environment if you have to hand-retype the request.
In any case your payload doesn't conform at all to the docs, which show:
{
"input" : [
{
"leadId" : 1001,
"activityDate" : "2013-09-26T06:56:35+07:00",
"activityTypeId" : 1001,
"primaryAttributeValue" : "Game Giveaway",
"attributes" : [
{
"name" : "URL",
"value" : "http://www.nvidia.com/game-giveaway"
}
]
}
]
}
attributes is an array of objects. Each object has two own properties, name and value. You're doing something very different, and obvs. that's why it's breaking.
I seem to have been completely misunderstood. I debugged and it has ran correctly.
Thank you for your reply and your help in resolving the problem.
Please mark one of the earlier responses as Correct for future searches.