#kxshf
1 messages · Page 1 of 1 (latest)
Hey @distant adder , could you please help me w this?
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Sec
This is the reqID - req_JandibuZ2PBip3
for this account on my Stripe Connect - acct_1NicabIjozdmEQfO
You are passing a json body:
{
file: "@/home/kashif/Pictures/success.png",
purpose: "identity_document",
}
which is not valid
I invite you to follow the APi documentation:
https://stripe.com/docs/api/files/create
I'm not passing a JSON bro
--header 'Authorization: Basic MY_KEY_HERE' \
-F "purpose"="identity_document" \
-F "file"="@/home/kashif/Pictures/success.png"```
This is my request
The request Id you shared with me was a Postman request and not a curl
Yes, I just copy pasted the cURL to share it w you ..
I remember using this API somewhere in April / May, it was working as expected
Now, it's throwing this error - { "error": { "message": "Invalid request (check that your POST content type is application/x-www-form-urlencoded). If you have any questions, we can help at https://support.stripe.com/.", "type": "invalid_request_error" } }
The thing is, this error message for this specific API is wrong, since the type must be multipart/form-data as mentioned in your files API docs here - https://stripe.com/docs/api/files/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I've tried using both multipart/form-data and application/x-www-form-urlencoded; Both of these doesn't work.
Moreoever, multipart/form-data is the only way to send files over HTTP requests, but it throws the same error.