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
Verify that you are sending correct url
Make sure that pdf is actually hosted in that url
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
Make sure that you are sending correct file
Verify that you can read that file on your end
Set proper permissions to your file before sending it
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
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
Make sure that you are sending correct url
Verify that pdf content is actually avalible in that url
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
make sure that you are sending current pdf url and file content
Try making api request again to see it is resolved or not
Contact us if this error is not resolved.
Last updated