I'm trying to migrate from the deprecated files.upload API to the new Slack upload flow using files.getUploadURLExternal.
According to the documentation, the request should include a filename and length field. However, Slack keeps returning an error saying those fields are missing.
Here is my curl command:
curl -s -X POST https://slack.com/api/files.getUploadURLExternal \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json; charset=utf-8" \
--data '{"filename":"test.csv","length":12}'
Response:
{
"ok": false,
"error": "invalid_arguments",
"response_metadata": {
"messages": [
"[ERROR] missing required field: length",
"[ERROR] missing required field: filename"
]
}
}
What is the correct JSON structure for Slack's files.getUploadURLExternal API?
Why does Slack say filename and length are missing even though they are clearly included?
--data "filename=test.csv&length=12"?