Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Changing VEC Custom Code through API

Avatar

Level 1

Hello Everyone,


We use the Custom code section under VEC to execute JavaScript code for personalization. We are exploring a way to change this code through Adobe Target APIs.

For the Form-based-editor, we are able to do it using the following steps:
1. Use Get Activity Details API ([https://developers.adobetarget.com/api/#get-xt-activity-by-id] ). This returns the offer-id corresponding to the custom-code with the Form-based-editor.
2. Extract the offer-id from the step above and use Update Offer API to change the custom-code with the Form-based-editor.([https://developers.adobetarget.com/api/#update-offer-by-id] )


Unfortunately, VEC custom-code does not return any offer-id. Instead, it returns offerTemplateId (see below JSON Response) and we are not able to find how to update this offer using the offerTemplateid using any API.

 

JSON Response: 

{
"id": 634140,
"thirdPartyId": "e433a55a-e3f8-4e11-a8de-fa9abf2d7ffe",
"name": "API Testing to Edit Custom Code VEC",
"state": "saved",
"priority": 0,
"options": [
{
"optionLocalId": 2,
"name": "Offer2",
"offerId": 0,
"offerTemplates": [
{
"offerTemplateId": 133,
"templateParameters": [
{
"name": "offerContent",
"value": "<script>\nconsole.log(\"Testing VEC\")\n</script>"
}
]
}
]
}
],
"locations": {
"mboxes": [],
"selectors": [
{
"locationLocalId": 0,
"name": "Location 0",
"selector": "BODY > *:eq(0)",
"audienceIds": [
6669917
],
"viewLocalId": 2
}
]
},
"experiences": [
{
"experienceLocalId": 0,
"name": "Experience A",
"audienceIds": [],
"optionLocations": [
{
"locationLocalId": 0,
"optionLocalId": 2
}
]
}
],
"metrics": [
{
"metricLocalId": 32767,
"name": "MY PRIMARY GOAL",
"conversion": true,
"action": {
"type": "count_once"
},
"mboxes": [
{
"name": "target-global-mbox",
"successEvent": "mbox_shown",
"audienceIds": [
6669916
]
}
],
"clickTrackSelectors": []
}
],
"reportingAudiences": [],
"workspace": "53546425",
"modifiedAt": "2022-06-15T12:24:09Z",
"views": [
{
"viewLocalId": 2,
"viewId": 2240,
"audienceIds": []
}
],
"applicationContext": {
"channel": "web",
"applicationVersions": [],
"mobilePlatformVersions": []
}
}

2 Replies