title: Error 400 invalid value in google apps group settings api
body: <p>I am trying to call a url with put request and the url is </p>
  
  <blockquote>
    <p>PUT <a href="https://www.googleapis.com/groups/v1/groups/groupUniqueId" rel="nofollow noreferrer">https://www.googleapis.com/groups/v1/groups/groupUniqueId</a> but
    getting error response as { "error": { "errors": [ { "domain":
    "global", "reason": "required", "message": "Required" } ], "code":
    400, "message": "Required" } }</p>
  </blockquote>
  
  <p>if i open the link
  <a href="https://developers.google.com/google-apps/groups-settings/v1/reference/groups/update" rel="nofollow noreferrer">https://developers.google.com/google-apps/groups-settings/v1/reference/groups/update</a>
  then there is a  Try It Section i authorize it with OAuth2.0 and put some fields as shown in image <img src="https://i.stack.imgur.com/q7hmT.png" alt="enter image description here"></p>
  
  <p>i write a java servlet for calling this url
  here is its doGet Method code and i am writing it on Google Appengine.i authorized the applicaion with oauth2 and acess_token is valid else it will show Authorization Error.
  it showing me invalid values. </p>
  
  <pre><code>public void doGet(HttpServletRequest req, HttpServletResponse resp)
              throws IOException {
  
          String url = "https://accounts.google.com/o/oauth2/token";
  
          // FetchOptions opt = FetchOptions.Builder.doNotValidateCertificate();
             URL url1=new URL(url); 
             String param="code="+req.getParameter("code")+"&amp;client_id=719226850877-tr21kp47phthuli0hu2v24akgfrplde9.apps.googleusercontent.com&amp;client_secret=hSXi3dWfEmDQfl0XZJJmBssc&amp;redirect_uri=https://www.onemoredemo.appspot.com/oauth2callback&amp;grant_type=authorization_code";
  
               HttpURLConnection connection = 
          (HttpURLConnection)url1.openConnection(); 
               connection.setDoOutput(true); 
               connection.setRequestMethod("POST"); 
               connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
               connection.getOutputStream().write( param.getBytes() ); 
            InputStream str= connection.getInputStream();
            BufferedReader reader=new BufferedReader(new InputStreamReader(str));
          String l="";
          String l1="";
  
            while((l=reader.readLine())!=null){
                l1+=l;
               resp.getWriter().println(l);
  
            }
            try {
                JSONObject obj=new JSONObject();
                obj.put("email", "testing9@iritesh.com");
              JSONObject json=new JSONObject(l1);
              String access_token=json.getString("access_token");
              URL url2=new URL("https://www.googleapis.com/groups/v1/groups/testing@iritesh.com?key=AIzaSyATDZHO5J7a3ItTSBhPby__Xzxi7rZlMJQ");
              HttpURLConnection connection1=(HttpURLConnection) url2.openConnection();
              connection1.setRequestMethod("PUT");
              connection1.addRequestProperty("Content-Type", "application/json");
              connection1.setDoOutput(true);
              connection1.addRequestProperty("Authorization","Bearer "+ access_token);
              connection1.getOutputStream().write(obj.toString().getBytes());
              connection1.connect();
              InputStream str1= connection1.getInputStream();
                BufferedReader reader1=new BufferedReader(new InputStreamReader(str1));
               String rit;
                while( (rit=reader1.readLine())!=null)
               {resp.getWriter().println(rit);
  
               }
  
  
          } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
      }
  </code></pre>
  
  <p>I tried to make a request same as in image.
  first set key parameter to api key then  setting request method as PUT by invoking setRequestMethod("PUT");
  after that added two properties one is Authorization:Bearer access_token
  and then Content-Type : application/json
  then setting its request body as a json object by invoking method</p>
  
  <pre><code>connection1.getOutputStream().write(obj.toString().getBytes());
  </code></pre>
  
  <p>Can any one please point me where i am wrong and where i am putting invalid value?</p>