I have been using the following code to build a JSON object with specific data:
{"contacts":[{"provider":"Yahoo","firstName":"myname","lastName":"surname","nickname":"mynick","email":"example@example.com","photoURL":"http://l.yimg.com/dh/ap/social/profile/profile_bxx.png"}]};
var data = {};
var contacts;
var gc = $.when(gigya.socialize.getContacts({callback: function(response){
data['contacts'] = response.contacts.asArray();
}}));
gc.done(function(response) {
contacts = data;
});
console.log(contacts);
However, when I try to pass this contacts object to a Google soy template, there seems to be an issue with the structure of the JSON object.
Can someone provide guidance on how to properly construct a valid JSON object using the code above?
Thank you for your assistance.