title: How to post an image to facebook page using Google App Script's facebook snippet?
body: <p>I am trying to setup a small application based on Google App Script and Google sheets 
  So far I am able to get the facebook page feed and able to connect to facebook app through Oauth2 library and got the tokens </p>
  
  <p>So I am struggling to write the code for posting to facebook , </p>
  
  <p>Currently I got the facebook page feeds but the post format documentation from facebook is referring to javascript SDK , and here I am not using SDK and graph API refers with POST and GET requests I think that also didn't work here .
  So this is my Codes for getting facebook token and page feed .</p>
  
  <p>Some one referred this as a duplicate but those question and answer doesn't fit in my question , I want facebook post format if it is with payload kindly include those payload options or someone can edit below code for POST </p>
  
  <p>I am able to post to pages with the page access token not user access token
  and pasting that page access token also throws the same error . </p>
  
  <p><strong>Updated Code But error appears as follows</strong> </p>
  
  <hr>
  
  <blockquote>
    <p>Request failed for <a href="https://graph.facebook.com/v3.2/" rel="nofollow noreferrer">https://graph.facebook.com/v3.2/</a><strong>PAGE</strong>/feed?message=hello?access_token=<strong>TOKEN</strong> returned code 403. Truncated server response: {"error":{"message":"(#200) If posting to a group, requires app being installed in the group, and \\n either publish_to_groups permission... (use muteHttpExceptions option to examine full response) (line 53, file "FB postinf")</p>
  </blockquote>
  
  <p>code updated</p>
  
  <pre><code> function example() {
  
  var service = getService();
    if (service.hasAccess())
     var data = {
      "message" : "Me Testing",
      //"slug" : "me-testing",
     // "text_to_subscribe" : "true"
    };
    var payload = JSON.stringify(data);
    var options = {
      "method" : "POST",
      "contentType" : "application/json",
      "payload" : payload
    };
    var url = "https://graph.facebook.com/v3.2/PAGENAME/feed?message=hello?access_token=ManuallyPastedTOKEN";
    // + '?access_token=' + encodeURIComponent(service.getAccessToken());
    var response = UrlFetchApp.fetch(url, options);
    }
  
  </code></pre>
  
  <hr>
  
  <p>This is using OAuth2 GET FEED  </p>
  
  <pre><code>function sasublish(){
  
  var service= getService()
  if (service.hasAccess()) {
  
    var url = 'https://graph.facebook.com'
      + '/pagename/feed'
      +'?fields='+ encodeURIComponent("name,full_picture,message,attachments{subattachments,url}")
  
    +'&amp;access_token='+ service.getAccessToken();
  
  
      var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});
  
      var json = response.getContentText();
      var jsondata = JSON.parse(json);
   } 
  </code></pre>