function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Need Help in Integrating Google+

Hi Everybody ,


I am trying to make a HTTP request to Google+ Moments Insert method taking the reference as below link.


Here is  the code  used ..


      Http httpm = new Http ();
      HttpRequest httpReqm = new HttpRequest();
      HttpResponse httpResm = new HttpResponse();
      String EndPointURL1 = '';
     // String AuthHead = tokenType + ' '+AccessToken ;  
                                             "Type"   : "" ,
                                             "target" : {
                                                                "tragetURL" : ""
      httpResm = httpm.send(httpReqm);


I am Getting the response


{ "error": { "errors": [ { "domain": "global", "reason": "parseError", "message": "This API does not support parsing form-encoded input." } ], "code": 400, "message": "This API does not support parsing form-encoded input." } }.


Also,I was used scope as they mentioned in the API above .


Can anyone plz clarify me how to set the Request body for this request. and get the proper response.


@Subbu - Can you try setting the HTTP header to 'application/json'. The other thing i see missing based on the API is the "collection" part of the URI which is expect is required. Once you are further down the line debugging I can see a potential issue with the JSON string as well. The below should be changed from:

 "target" : {
     "tragetURL" : ""


 "target" : {
     "url" : ""


This is based on the API documentation as I do not see a targetURL attribute for the target object in the JSON request.









Hii Vbs , 


Thanx for your reply . Now I was clear about the request to make .


Now  I can able to get the response for all other methods except for moments.Insert method ,always  it showing the response as below ..


  • "error":{
    • "errors":[
      • {
        • "domain":"global",
        • "reason":"unauthorized",
        • "message":"Unauthorized"
    • "code":401,
    • "message":"Unauthorized"



In the API documentation they mentioned as this method will not work in the explorer..

plz refer the NOTE in this link


Can u clarify is this my problem or any thing other ?

This looks like an issue with authorizing the request. There are 2 ways to do this:
1. Use the API key provided with your Google developer account and pass this as a query parameter key=yourAPIKey with your GET request.
2. Use OAuth2 for getting access to the resource and use the token to complete your request.
See this to manage your authentication process.