Expand my Community achievements bar.

SOLVED

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": []
}
}

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Arun_kumaran 

 

In response I am able to see offer content, is that what you are trying to update using API?

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

Hi @Arun_kumaran 

 

In response I am able to see offer content, is that what you are trying to update using API?

Avatar

Administrator

Hi @Arun_kumaran, hope you're doing well!  Were you able to resolve this issue with the support that was provided?

If so, please let us and your Target Community peers know by marking the helpful response as, "Correct Reply" - - otherwise, I'd encourage you to update the post with how you solved for the original issue  and/ or reach back out to your Target Community peers with a follow up question!