how to return json response with adobe.target.getOffer | Community
Skip to main content
October 16, 2020
Solved

how to return json response with adobe.target.getOffer

  • October 16, 2020
  • 2 replies
  • 4395 views

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);

  }

});

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 skand

@xiaog92197055 

Kindly marked this post as answered if the suggested solution did help you in achieving your result.

 

2 replies

Adobe Employee
October 20, 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

October 20, 2020
actually console.log(offer) doesn't print offer in console. but alert(offer) works. Replace the mbox name in my code with mbox you use. you will see the alert pop up. I don't see an option here to upload screenshot.
skandAdobe EmployeeAccepted solution
Adobe Employee
October 28, 2020

@xiaog92197055 

Kindly marked this post as answered if the suggested solution did help you in achieving your result.