hi. i'd like to test moments.insert api. so i was add moment function below to helper object. but i couldn't get result what i want.
i had called two type moment open api below. first, 'gapi.client.plus.moments.insert' [1] wasn't works but second style, gapi.client.request[2] was works. please let me know what is different or what am i missed.
moment: function(){
var moment = {
'type':'https://schemas.google.com/AddActivity',
'target':{
'url': 'https://developers.google.com/+/plugins/snippet/examples/thing'
}
};
var request = gapi.client.plus.moments.insert({
'userId': 'me',
'collection': 'vault',
'body': moment
});
request.execute( function(mement) {
console.log(mement);
});
// using gapi.client.request
var args = {
'path': '/plus/v1/people/me/moments/vault',
'method': 'POST',
'body': JSON.stringify(moment),
'callback': function(response) {
console.log(response);
}
};
gapi.client.request(args);
}