skip to Main Content

I want to upload base64 image (jpg,png) on facebook using facebook developers graph API’s in angular 6

https://graph.facebook.com/me/photos‘ this api end I am using with passing formdata.
I am referring https://www.devils-heaven.com/facebook-javascript-sdk-photo-upload-from-canvas/

socailpostCall(imageResult) {
  let xhr: XMLHttpRequest = new XMLHttpRequest();
  let formData = new FormData();
  formData.append("access_token",{access_token});
  formData.append("source", imageResult);
  return this._http.post('https://graph.facebook.com/me/photos',formData)
}

I expect imge should uploaded on facebook as a post, but actually It shows

{
   "error": {
      "message": "(#200) This endpoint is deprecated since the required permission publish_actions is deprecated",
      "type": "OAuthException",
      "code": 200,
      "fbtrace_id": "AckVrByZBvyDeuoac00SVXN"
   }
}

2

Answers


  1. The error message tells you that it is not possible anymore to post to a user profile. You can only use this to post to a Page – with a Page Token that includes the publish_pages permission.

    More information: https://developers.facebook.com/docs/graph-api/reference/page/photos/#Creating

    Login or Signup to reply.
  2. When you refer to the docs you can see that the following endpoint has been deprecated

    Apps that have used these endpoints in the last 90 days (before 30th
    april) can continue using them with API versions 3.2 and lower until
    July 30th, 2019.

    https://developers.facebook.com/docs/graph-api/changelog/4-30-2019-endpoint-deprecations

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search