I created an activity json as following and posting to the google plus moments api
var activity = {
“type”: “http://schemas.google.com/AddActivity”,
“target”: {
“url”: “http://www.qontext.com”
}};
POST is successful but the moment is not shown the history. Authentication is taken care of.
Example url works fine. Can somebody help.
As long as the provided target url does not return (html) content that includes the required meta data (http://schema.org/Thing) your inserted element will not show up in the Google+ History (no matter if the Response will be a HTTP 200 or not).
Providing your meta data in the request body (as “result” JSON) does not work either. So you have to ensure that the target url will return HTML that contains the data that you would like to post.
E.g. this can be done via a simple PHP script like this:
so then just post
by doing so you activity will be added to the Google+ History – but of course that implies interactivity with your server – which can also have some benefits for you.