1

Can someone please help with the image file format used in schedule_custom_profile_image, to upload image in Facebook create Live video API. click here to refer the API

It is mentioned in the API to pass the profile image as image format. I have tried with base64 format, blob format, the local image path, binary format.

None of the above worked for me.

I have tried using curl too :

curl -X POST \
-F "planned_start_time=1486645055" \
-F "access_token={access_token} " \
-F "schedule_custom_profile_image=@//Users/blin/picture.png" \
https://graph.facebook.com/v2.8/me/live_videos

But here it does not provide the exact format. This seems as image path.

I'm getting error :

{"error":{"message":"(#100) Invalid image format. It should be an image file data.","type":"OAuthException","code":100,"fbtrace_id":"AOng3JJfJsH"}}
  • I have tried with CURL command on centOS and able to excute the same. The image format is byte array got to know when tried debugging the CURL request. As I'm calling the FB Live video API using AngularJS front-end, not getting how to send data in the object. Someone Please Help. – Diksha Tekriwal Jul 14 '17 at 11:38
  • 1
    It's a multipart request. You could find more about it here [https://stackoverflow.com/questions/16958448/what-is-http-multipart-request](https://stackoverflow.com/questions/16958448/what-is-http-multipart-request) – Maxim Firsoff Sep 20 '17 at 03:02
  • Dude, ... tried everything that came in my mind... data:image/png;base64,... (negatif) ... new buffer(decodeBase64) .. (negatif) .... new buffer(decodebase64)... toString('binary') nooope .. any help will be appreciated .... :/ – M. Gara Oct 03 '17 at 23:30
  • In html file add: onchange="angular.element(this).scope().uploadFile(this.files)" In js file: var fd = new FormData(); $scope.uploadFile = function (files) { $scope.$apply(function () { $scope.image = files[0].name; }); //Take the first selected file fd.append("schedule_custom_profile_image", files[0]); }; Then call FB API in http request with headers: { 'Content-Type': undefined }, transformRequest: angular.identity – Diksha Tekriwal Oct 04 '17 at 06:42
  • Did you ever find a solution to this?? – Geige V May 21 '18 at 21:10

0 Answers0