CloudConvert API: Call not working properly

I’m trying to use the API from CloudConvert to convert a file from .ogg to .wav.
As I understand that we cannot get a file via API back and save it on Bubble’s s3, I’m saving it on my own s3 bucket.

This is my call:
{
“apikey”: “zzz”,
“inputformat”: “ogg”,
“outputformat”: “wav”,
“input”: “download”,
“file”: “https://s3.amazonaws.com/appforest_uf/zzz/audio90037081.ogg”,
“output”: {
“s3”: {
“accesskeyid”: “zzz”,
“secretaccesskey”: “zzz”,
“bucket”: “zzz”
}
},
“wait”: true,
“download”: false
}

In Postman the call is working properly, but Bubble has some strange behavoiur. I’m getting the error message “Cannot POST /download/DJdeQkvFHIPZWahYwCzj” BUT the process works and the converted file is saved in my own s3 correctly.

I would just need to a successfull API response to integrate it in my workflow and I just can’t figure out what to do.
Does anyone has a clue what I can do?

Thx!!

Hey @AlexK!

I haven’t used CloudConvert before, but I just setup a quick prototype and was able to schedule a conversion from Bubble that retrieves a file from Google Cloud Storage and saves the result there as well, so it looks like this is doable.

Just as a starting point, make sure to add the Content-type header and set to application/json.

If that isn’t the trouble, I’d suggest posting your successful postman call (with keys redacted) and then also post your api connector call (similarly redacted) and everybody can chime in on possible issues.

Hi @mebeingken!
Thanks for the reply!
Good point on making it more visual so that others can understand easier what the current settings are.
Here we go:

My Goal: Send a file from Bubble s3 to CloudConvert via API and let the conversion magic happen and afterwards save it on my own (= not Bubble) s3 bucket.

Here is the call in Postman:

Here is the response from Postman (plain text as the answer is to long to make a proper screenshot):


{
“id”: “t0lPuSsJUfnbjZTw6pRq”,
“url”: “//leanna.infra.cloudconvert.com/process/t0lPuSsJUfnbjZTw6pRq”,
“expire”: 1542065559,
“percent”: 100,
“message”: “Saved file to S3”,
“step”: “finished”,
“starttime”: 1542022356,
“output”: {
“filename”: “ZZZ.wav”,
“ext”: “wav”,
“size”: 439314,
“type”: “s3”
},
“input”: {
“filename”: “ZZZ.ogg”,
“name”: “ZZZ”,
“ext”: “ogg”
},
“converter”: {
“mode”: “convert”,
“format”: “wav”,
“type”: “ffmpeg”,
“options”: {
“audio_codec”: “PCM_S16LE”,
“audio_bitrate”: 128,
“audio_channels”: null,
“audio_frequency”: 44100,
“audio_normalize”: null,
“trim_to”: null,
“trim_from”: null,
“strip_metatags”: false,
“command”: null
}
},
“group”: “audio”,
“minutes”: 1,
“endtime”: 1542022359
}


As you can see I get a response with " “message”: “Saved file to S3” ". This would be the outcome I would expect from Bubble as well.

Here it the API connector in Bubble:

Here are the corresponding responses in Bubble:
1.) Wait true + download false:
Raw response for the API
{“error”:“Process already started. Please use GET requests to get the current status.”,“code”:400}
→ The file has nevertheless been converted and correctly saved in my own personal s3 bucket

2.) Wait false + download false:
Raw response for the API
{“error”:“Process already started. Please use GET requests to get the current status.”,“code”:400}
→ The file has nevertheless been converted and correctly saved in my own personal s3 bucket

3.) Wait true + download true:
Cannot POST /download/WFH0URKGm2ehIb6dzQCS
→ The file has nevertheless been converted and correctly saved in my own personal s3 bucket

4.) Wait false + download true:
Raw response for the API
{“error”:“Process already started. Please use GET requests to get the current status.”,“code”:400}
→ The file has nevertheless been converted and correctly saved in my own personal s3 bucket

It’s really a mystery. It works perfetcly fine, but I get error responses. I just don’t know why (and of course why there are 2 different ones).

So if anyone has an idea about what’s wrong, I would be really thankful because I just can’t get through it… Thx!

Ahh, that is why our results were different – you are using the /convert endpoint for their “console”. In my test I used the process documented here which allows you to create a process which returns a url that is used in the second call. I have to run out right now, but take a look at that link and if you need, I can send you a sample set of calls.

Oh wow. I tried it earlier which this approach but it didn’t work out. Because of that I started using my own s3 bucket. And now it works with the 2 step flow. :open_mouth:
Thanks for pointing me into the right direction @mebeingken :smiley::+1:

Just in case someone wants to achieve the same some day:
I deleted the “download” key and it finally worked!

1 Like

@AlexK I am struggling to setup my cloudconvert API. Can I perhaps send u screenshots of my setup so that you could point out where I am going wrong?