Search code examples
apiadvanced-rest-clientcloudconvert

Cloudconvert File not found (upload failed)


I plan on using cloudconverts API API for converting docx files to pdf but im stuck with a File not found (upload failed) error each time i have started a conversion process and request the status of the conversion.

To make sure the file can be reached, i ran a test using their API and executing my request which was a success.

Im testing the conversion using Googles Advanced Rest Client and my header og payload is as follows:

Requesting a process:

enter image description here

Im getting an URL for my convertion process and all is good. So time to start my process of converting my file. Im using the option to let cloudconvert download the docx from my domain.

Starting my process:

enter image description here

The request for starting my process is also a succes and i now want to check the status of my conversion by calling the previous url as a GET. But this gives me an error message in the response saying: File not found (Upload failed)

As written in the beginning of my post, i tried using their API console to test if the file can be downloaded from my site, which it could and PDF was created successfully .. So i guess im missing something somewhere, just cant see it...


Solution

  • So yeah,

    First problem was that there was wrong content-type header set. For JSON payload it should be "application/json". With "application/x-www.form-urlencoded" content type header the server expected different payload so the call resulted with error.

    Second one was about JSON parsing. JSON is not the same as JavaScript object. Keys in JSON must contain double quotes characters.

    Finally I'm not sure what do you mean by success response. If you talking about status code - well it's just bad API configuration/design.