When I use the API with a url it works perfect, but if I do it with a file, I don’t get it to work. This is the code I use:
var xhr =new XMLHttpRequest(); xhr.withCredentials = true;
xhr.open(“POST”, url,false);
xhr.setRequestHeader(“Content-Type”,“application/x-www-form-urlencoded”);
xhr.setRequestHeader(“cache-control”, “no-cache”);
xhr.send(data);
where data=
apikey=mi_api_key&file=mi_file.pdf&language=spa&isOverlayRequired=false;
The response is:
{“OCRExitCode”:99,“IsErroredOnProcessing”:true,“ErrorMessage”:[“Parameter name ‘file’ is invalid. Valid parameters: apikey,url,language,isoverlayrequired,base64image,iscreatesearchablepdf,issearchablepdfhidetextlayer,filetype,addressparsing,scale,detectorientation,istable,ocrengine,detectcheckbox,checkboxtemplate,checkboxtemplateregex”,“Please check if you need to URL encode the URL passed in request parameters.”],“ProcessingTimeInMilliseconds”:“0”}
Thanks a lot!