Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
How to fix imgur api error status 400, 417 errors

While uploading pictures using the Imgur API, some pictures are not uploaded and returns status 400 or 417 errors.

{
  status: 400,
  success: false,
  data: {
    error: "We don't support that file type!",
    request: '/3/upload'
}
{
  status: 417,
  success: false,
  data: {
    error: 'Internal expectation failed',
    request: '/3/upload',
    method: 'POST'
  }
}

This error was fixed upon launching the console. But every time I upload a picture I have to restart the console. How may I prevent this from happening?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The 417 error states that the Imgur CDN was expecting a file type such as .png, .mp4, .gif, etc. You may view the supported file types here.

The 400 indicates an improper / bad request , while requesting the API for a POST type request you must know how to properly request it, you may refer to the proper method here.

about 4 years ago · Juan Pablo Isaza Report

0

Note: Your "Account" and your "Application" are distinct entities. If you try to upload to an album on your account, thinking your application has access rights to it because they are tied to the same email, you'll probably get the 417 error.

Also, it seems that imgur validates the .PNG file before validating access rights.

I have concluded that as you are trouble shooting , this is a rough gauge of "how close to succcess" you are:

1: VERY CLOSE : "Internal Expectation Failed" Your .PNG payload within the form-data is probably correct.

2: COLDER : "We Don't Support That File Type" You probably corrupted your .PNG binary file when attempting to concat it into the "form-data" payload.

3: COLDEST : "bad request" You really fucked up bad.

If you are rolling your own "multi-part form-data" like I did, one of the posters here has a good low-level example that does NOT use 3rd party libraries: NodeJS Request how to send multipart/form-data POST request

Your payload is constructed something like this:

payload=Buffer.concat([
    Buffer.from( formdata_string_top    , "utf8"   ) 
,   Buffer.from( png_binary_file        , "binary" ) 
,   Buffer.from( final_formdata_boundary, "utf8"   ) 
]);;

You might be tempted to do this , because it is readable in your logs, but it WILL_CORRUPT_YOUR_BINARY_FILE

payload=Buffer.concat([
    Buffer.from( formdata_string_top    , "utf8"   ) 
,   Buffer.from( png_binary_file        , "binary" ) 
,   Buffer.from( final_formdata_boundary, "utf8"   ) 
]).toString( "utf8" );
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!