Post photos to an album using a batch request and curl

132 Views Asked by At

I'm trying to post a number of photos to an already created album using cURL with the following command:

 curl -F 'access_token=<>' \
    -F 'batch=[ \
        {"method":"POST","relative_url":"/album_id/photos","url":"<photo_url>"}, \
        {"method":"POST","relative_url":"/album_id/photos","url":"<photo_url>"}]' \
        https://graph.facebook.com

The error I'm getting is (#324) Requires upload file. Is it even possible to post photos in a batch request to an album and if so what is the correct way to do it with cURL? Thanks!

Edit: the correct command thanks to CBroe is:

curl -F 'access_token=<>' \
     -F 'batch=[ \
         {"method":"POST","relative_url":"/album_id/photos","body":"url=<photo_url>"}, \
         {"method":"POST","relative_url":"/album_id/photos","body":"url=<photo_url>"}]' \
         https://graph.facebook.com
0

There are 0 best solutions below