Facebook API 100 Error

久未见 提交于 2019-12-25 02:57:04

问题


Been receiving this error when trying to post on a feed. I am using JavaScript to post. The ByteArray data is coming from a .swf

API Error Code: 100

API Error Description: Invalid parameter

Error Message: picture URL is not properly formatted

Here is my AS3:

var bdToSave:BitmapData = new BitmapData(s.width,  s.height);
        bdToSave.draw(s, null, null, null, null, true);
        var encoder:JPGEncoder = new JPGEncoder();
        var byteArray:ByteArray = encoder.encode(bdToSave);

        if (ExternalInterface.available) ExternalInterface.call("publishStream", byteArray);

Here is my JS:

function publishStream(person)
        {

            FB.ui({ 
                    method : 'feed', 
                    name: 'I just painted my face!',
                    caption: 'From the show Warren, using the True Colors: Face Painting App I painted my face to match my favourite team!',
                    link:  'https://www.facebook.com/fanunitednet',
                    description: '',
                    picture: person
                  });
        }

I am sending it a byte array of data. Is it possible to get it working using that or do I need a URL? My issue is that I'm taking a picture, sending the bytearray of data to the form and then trying to use that picture.. there is no direct link.

Thoughts?


回答1:


You need to upload the image via the Graph API first, for example like it's described here:

https://developers.facebook.com/docs/graph-api/reference/user/photos/#publish

This mean via a POST request to /{user_id}/photos as multipart/form-data mime-type, and the byteArray as source parameter.

Remember that you need the publish_actions permission to be able to do this!



来源:https://stackoverflow.com/questions/21589152/facebook-api-100-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!