how to return json response with adobe.target.getOffer

Avatar

Avatar
Validate 1
Level 1
xiaog92197055
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
xiaog92197055
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
xiaog92197055
Level 1

16-10-2020

I created a json type offer and want target to return that. However, when I try the following code, response is blank. I couldn’t find any code example on adobe website specifically about return json response. Can you double check whether I missed something below or if you can point me to a code example/documentation with json response call? By the way, the following way works fine if it is html offer.

 

adobe.target.getOffer({  

  "mbox": "mboxname",

  "params": {

 "profile.language": "en"

  },

  "success": function(offer) {

console.log(offer);

alert(offer);         

        adobe.target.applyOffer( { 

           "mbox": "mboxname",

           "offer": offer

 

        } );

  },  

  "error": function(status, error) {          

      console.log('Error', status, error);

  }

});

View Entire Topic

Avatar

Avatar
Give Back 5
Level 3
skandg43264764
Level 3

Likes

31 likes

Total Posts

38 posts

Correct reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Level 3
skandg43264764
Level 3

Likes

31 likes

Total Posts

38 posts

Correct reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
skandg43264764
Level 3

19-10-2020

@xiaog92197055 

Code looks fine to me. I will check the code by executing at my end and will let you know.

Meanwhile, Can you share the screenshot from the browser console showing what are you getting in 'offer' via console.log(offer) function