Home Facebook API - Batch upload photos
Reply: 1

Facebook API - Batch upload photos

Cowmoogun
1#
Cowmoogun Published in 2017-12-07 20:15:41Z

I'm trying to batch upload photos and I keep getting a response back from Postman saying "Batch parameter must be a JSON Array" Does anyone see what is wrong with this because it looks like valid json to me. I've been rattling with this for a few hours making minor tweaks trying to get it to upload to no avail. I also have tried encoding the url.

https://graph.facebook.com/v2.11?batch=[{"method":"POST", "relative_url":"https://graph.facebook.com/v2.11/{pageid}/photos?access_token={access-token}", "body":"link_url":"https://{link-to-image}/wmphotos/999995/6d5cc4169bbf4e7dbe31f3739e025412/a572c29dff_640.jpg"}]&access_token={access-token}
Brian de Heus
2#
Brian de Heus Reply to 2017-12-08 02:05:11Z

Looking at your code, it seems that the JSON object in your batch array is actually malformed. body:link_url:link should be body: {link_url:link}

Bad:

[
    {
        "method":"POST", 
        "relative_url":"foo", 
        "body":"link_url":"link"
    }
]

Good:

[
    {
        "method":"POST", 
        "relative_url":"foo", 
        "body":{"link_url":"link"}
   }
]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298142 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO