mlapi
HomeBlog
  • Welcome
  • Extract Text from PDF
    • Parameters
    • Supported File types
    • Error Responses
    • Programming Languages
      • Python
      • Javascript
      • Curl
      • Java
      • Go
      • Rust
      • C++
    • Web and Mobile frameworks
      • React
      • React Native (Javascript)
      • HTML
      • PHP
      • Rust (with Active-Web)
      • Angular
      • Flutter
      • Andriod Development (Java)
      • Swift
      • Vue.js
      • Svelte
    • Pricing
    • On Premise Deployment
Powered by GitBook
On this page
  • 400 - Failed to fetch PDF from URL
  • 400 - Failed to read file
  • 400 - No PDF URL or file provided
  • 500 - An error occurred while extracting pdf content from url
  • 500 - Failed to process PDF
  1. Extract Text from PDF

Error Responses

Errors you might encounter when making requests to the mlapi API.

400 - Failed to fetch PDF from URL

This error occurs when we were unable to fetch PDF content from given URL.

Error response will look like this -

{
"error" : "Failed to fetch PDF from URL",
"reason" : "Reason for failure",
"pdf_url" : "entered pdf url" 
}

Possible ways to avoid it

  1. Verify that you are sending correct url

  2. Make sure that pdf is actually hosted in that url

  3. Make it public, so other people can access it as well

400 - Failed to read file

This error occurs when we failed to read the file content that you shared.

Error response

{
"error" : "Failed to read file",
"reason" : "reason for this error"
}

Possible ways to avoid it

  1. Make sure that you are sending correct file

  2. Verify that you can read that file on your end

  3. Set proper permissions to your file before sending it

  4. Do not send password protected files

400 - No PDF URL or file provided

You will get this error of you don't specify any pdf_url or don't send any file while making api request.

Error response

{
"error" : "No PDF URL or file provided",
"reason" : "No PDF URL or file provided"
}

Possible ways to avoid it

  1. Make sure that you are either sending pdf_url or file while making api request.

500 - An error occurred while extracting pdf content from url

This error occurs when there was some error while extracting pdf content from given url

Error response

{
"error" : "An error occurred while extracting pdf content from url"
"reason" : "why did this error occured",
"pdf_url" : "url for which this error occured"
}

Possible ways to avoid it

  1. Make sure that you are sending correct url

  2. Verify that pdf content is actually avalible in that url

  3. Make sure that the url is public and anybody can access it

500 - Failed to process PDF

You will get this error in response when there was an error while processing your pdf. If you do get this error then make another api request and see if it could be resolved.

Error response

{
"error" : "Failed to process PDF",
"reason" : "reason why this error occured",
"source_type" : "string, this has two possible responses, if you send pdf_url as input, then source_type will be URL and if you send file as input for processing then source_type will be File",
"source_info" : "string, if pdf url is uploaded then you will get pdf url in response and if file is uploaded then the response will be Uploaded file."
}

Possible ways to avoid it

  1. make sure that you are sending current pdf url and file content

  2. Try making api request again to see it is resolved or not

  3. Contact us if this error is not resolved.

PreviousSupported File typesNextProgramming Languages

Last updated 9 months ago