Expand my Community achievements bar.

SOLVED

Adobe Target API | Upate Activitiy - Invalid Json

Avatar

Community Advisor

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?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

API
1 Accepted Solution

Avatar

Correct answer by
Level 4

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"
      }'

View solution in original post

5 Replies

Avatar

Employee Advisor

@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

Avatar

Level 4
Instead of trying to use the update activity request, are you able to use the 'Update activity name' request instead?

Avatar

Correct answer by
Level 4

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"
      }'

Avatar

Level 1

If anyone looking for Answers :

Update activity works only with v3.json ..