Adobe Target API | Upate Activitiy - Invalid Json | Community
Skip to main content
Perrin_Ennen
Community Advisor
Community Advisor
April 14, 2020
Solved

Adobe Target API | Upate Activitiy - Invalid Json

  • April 14, 2020
  • 5 replies
  • 8233 views

Hello,
if I get an activity e.g. via https://mc.adobe.io/tenant/target/activities/ab/123456 and change only the name of the activity in the JSON and send it to https://mc.adobe.io/tenant/target/activities/ab/123456, then I get the message:

 

"Invalid Json. Unrecognized property name 'options'. Location: line - 7, column - 17."

 

"options": [
{
"optionLocalId": 0,
"offerId": 0
},
{
"optionLocalId": 2,
"name": "Offer2."
"offerId": 596872
}
],

 

If I delete this part, I get another warning. This time under experiences at optionLocations.

 

"experiences": [
{
"experienceLocalId": 0,
"name": "experience A."
"visitorPercentage": 100,
"optionLocations": [
{
"locationLocalId": 0,
"optionLocalId": 0
}
]
},
],

 

Do I pass a wrong format - or can someone tell me what I am doing wrong?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by nzchris

Instead of trying to use update activity API request, are you able to use the update activity request instead?

API documentation: https://developers.adobetarget.com/api/#update-activity-name

curl -X PUT \
  https://mc.adobe.io/<your-tenant-name>/target/activities/168816/name \
  -H 'authorization: Bearer <your-bearer-token>' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/vnd.adobe.target.v1+json' \
  -H 'x-api-key: <your-api-token>'
  -d '{
        "name": "New Name for Activity"
      }'

5 replies

MihneaD
Adobe Employee
Adobe Employee
April 15, 2020

@perrin_ennen 
I don't know much about this topic but asking some clarifying questions for those who do and woudl be willing to help here is what woudl be good to know:

1. Are you using API v1.0 or API v2.0?
2. What are you trying to accomplish?

Mihnea Docea | Technical Support Consultant | Customer Experience | Adobe | 1 (800) 497-0335

nzchris
Level 3
April 15, 2020

[Removed]

nzchris
Level 3
April 15, 2020
Instead of trying to use the update activity request, are you able to use the 'Update activity name' request instead?
nzchris
nzchrisAccepted solution
Level 3
April 15, 2020

Instead of trying to use update activity API request, are you able to use the update activity request instead?

API documentation: https://developers.adobetarget.com/api/#update-activity-name

curl -X PUT \
  https://mc.adobe.io/<your-tenant-name>/target/activities/168816/name \
  -H 'authorization: Bearer <your-bearer-token>' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/vnd.adobe.target.v1+json' \
  -H 'x-api-key: <your-api-token>'
  -d '{
        "name": "New Name for Activity"
      }'
October 31, 2021

If anyone looking for Answers :

Update activity works only with v3.json ..