2

I have a problem with using messenger platform when i'm trying to send image. I've read this before start.

https://developers.facebook.com/docs/messenger-platform/send-api-reference/image-attachment

URL send works perfect but File upload gives me this error

{
    "error": {
        "message": "(#100) Incorrect number of files uploaded. Must upload exactly one file.",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2018005,
        "fbtrace_id": "CDNEhlKlGrt"
    }
}

Here is my cURL

curl  \
  -F 'recipient={"id":"1102713306494360"}' \
  -F 'message={"attachment":{"type":"image", "payload":{}}}' \
  -F 'filedata=C:/users/terminal/test.png;type=image/png' \
  "https://graph.facebook.com/v2.6/me/messages?access_token=EAAC3tteq77IBAAnr5zseJ4vTYcMXPFVAHIl...

Here is an answer

enter image description here

What am i doing wrong?

ChrisB
  • 2,497
  • 2
  • 24
  • 43
  • 2
    You just exposed your non-expiring page access token here – so now the very first thing you need to do is go reset the password of the page admin that granted it to invalidate it. – CBroe Oct 25 '16 at 08:08
  • I'm also banging my head against this, any insight would be welcome :/ – danii Dec 07 '16 at 15:39
  • 2
    I had a similar issue. You need an @ before value for the `filedata` parameter, i.e. `filedata=@C:/users/terminal/test.png;type=image/png` – Brien Crean Jul 13 '17 at 22:19
  • what kind of input parameters are those with `=` and then they're assigned a JSON structure. Shouldn't this all be a JSON structure? The documentation is confusing and I'm unable to pass the correct arguments to this endpoint. – Masroor Oct 21 '20 at 12:29

1 Answers1

-1
-F 'filedata=@E:/desktop/Capture.PNG;type=image/png' \
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • 3
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 02 '22 at 00:38