0

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?

2
  • The call generator tab shows sending them as query parameters, not a JSON payload - did you try that? Commented Nov 17 at 11:01
  • Does the API accept JSON? I know it looks like JSON, but it might just be parameters as URL-encoded form data. Could you try: --data "filename=test.csv&length=12"? Commented Nov 17 at 11:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.