1

I'd like to send a file to the user, to do so I tried the request below, but it fails.

The docs are not clear about wether is_reusable is compulsory, but the request fails with the same error, even if I include it.

The download url works fine in a browser.

I have https://asd.com/ whitelisted for sure.

Request:

 {
        "recipient": {
            "id": "157..."
        },
        "message": {
            "attachment": {
                "type": "file",
                "payload":
                    {
                        "url":
                            "https://asd.com/s3/..."
                    }
            }
        }
    };

Response: HTTP 500

 {
        "error": {
            "code": 1,
            "message": "An unknown error occurred",
            "error_subcode": 99
        }
    }
Bence Gedai
  • 1,461
  • 2
  • 13
  • 25
  • _“The download url works fine in a browser”_ - is it accessible by Facebook, too? (Not sure if that is necessary, but it might?) You can use https://developers.facebook.com/tools/debug/ to check whether Facebook can at least read the URL, or if there’s any problems regarding that. (Ignore other errors that complain about missing OG meta tags, that’s not applicable in this case.) – CBroe Jan 19 '18 at 11:20
  • @CBroe It seems to be accessible. Response code: 206, Redirect path: https://asd.com/s3... to https://s3.eu-central-1.amazonaws.com/... Are there any other fields that might be interesting? – Bence Gedai Jan 19 '18 at 11:25
  • Nah, that should be good enough. (It is actually able to follow the redirect and read the S3 URL as well, right? Sometimes the latter can be problematic, due to bucket configuration that tries to block “bots” or something like that.) But again, I am not sure if readability by Facebook is even a requirement ... – CBroe Jan 19 '18 at 11:28
  • I just started getting a 500 error when sending attachments today as well. My chatbot has been running fine for months and no code has changed. It may just be a problem on Facebook's end. They do seem to have issues quite regularly. – Josh Cole Jan 19 '18 at 13:10
  • @BenceGedai The URL has to point directly to the asset. The Platform will not follow a redirect. – amuramoto Jan 19 '18 at 17:41
  • It just got solved, the problem was at Facebook's side. Thank you all for help. – Bence Gedai Jan 20 '18 at 09:01

1 Answers1

0

The issue is resolved now. I didn't touch the code, so probably it was an error on Facebook's side, as @Josh Cole and HTTP 500 suggested.

Recently they making quite a few breaking changes... Few days ago they broke all the web views, now the files, whats next?

I'm marking this question solved.

Bence Gedai
  • 1,461
  • 2
  • 13
  • 25