getting error while trying to batch upload photos on fan page via Facebook javascript SDK -


I am trying to upload a batch via the Facebook Javascript API. I had read the API document. ()

I request batch through the following javascript function:

  function batch uploads photopage () {var pageId = '111222333'; Var pageexacton = 'xxxxyyzzzzzzz'; FB.API ('/', 'Post', 'Batch': [{'Law': 'Post', 'Relative_Archic': PageID + '/ Photo', 'AccessToken': Page Asset Token, 'Message': ' Test Upload Photo 1 ... 'New Date (),' url ':' https://hn85599112.files.wordpress.com/2014/07/girl-photo.jpeg '}, {' Method ':' Post ' , 'Relative_url': PageID + '/ photo', 'AccessToken': PageNetSetToken, 'Message': 'Test Upload Photo 2 ...' + New Date (), 'url': 'http: //www.paopaoche. Net / up / 2012-5 / 20125523231510353173.jpg '}]}, function (feedback) {log (feedback);}); }   

but it always answers an error message:

  {"error": {"message": "(# 324) upload file I'm struggling for it for a long time, but still can not understand it. "," Type ":" OAuth Exception "," Code ": 324}}   

Please help, if you know what I am wrong, thank you very much! T_T

Take a look at this JSFiddle:

Be sure to add your app_id , Page_id and page_access_token.

Actually, you forgot that you have to add a body parameter and the URL will encode the actual parameter in it:

  FB.API ( '/', 'Post', {AccessToken: Page Asset Token, 'Batch': [{'Method': 'Post', 'Relative_Archic': PageID + '/ Photo', 'AccessToken': PageNet Token, 'Body' : "Message = test upload photos 1 ... and url = https: //hn85599112.files.wordpress.com/2014/07/girl-photo.jpeg"}, {'method': 'post', 'relative_url' : PageId + '/ photos', 'access_token': pageAccessToken, 'body': "message = test O ... and url = http: //www.paopaoche.net/up/2012-5/20125523231510353173 .jpg "}]}, function (feedback) {console.log (JSON.stringify (feedback))}) ;   

View

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -