HELP! Error in API Connector & Plugin

Hello @emmanuel

I am trying to use Cloudconvert APIs. The call below works well in Postman but for some reason it throws an error in the plugin and API connector plugin. It almost seems like it’s being called twice when I initialize the call. Hint the below message

I tried almost everything, and nothing seems to work in Bubble, but postman is not having a problem with it at all.

The problem seem’s to be related to the body of the post request. Using other CloudConvert API calls as parameters works fine.

By the way, this seems familiar as another issue I have reported earlier. Please see post below

The Plugin I am trying to build link is

The curl operation I am trying to execute is

curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: fef668d9-3343-f73f-455a-99c504a052d1" -d '{
    "apikey": "Pdb7jYzdtUv_HYqyPAxH0OsM0mBB51kQTWyonEGcO1-3HuDXqqsG--T8w_o-Exor42dztuvsw9sdAiyAacPV7g",
    "inputformat": "txt",
    "outputformat": "png",
    "input": "base64",
    "file": "VGhpcyBpcyBhIHRleHQ=",
    "filename": "Short test File.txt",
    "converteroptions": {
        "resize": null,
        "resizemode": "maximum",
        "resizeenlarge": null,
        "density": 400,
        "rotate": null,
        "page_range": null,
        "grayscale": null,
        "disable_alpha": true,
        "strip_metatags": null,
        "command": null
    },
    "wait": false,
    "download": false,
    "save": true
}' "https://api.cloudconvert.com/convert"

Thanks

I can’t see in your editor, … did you add a header in Bubble for “Content-Type: application/json”?

1 Like

Yes did that

Do you get the same error in postman, on the second try? The error message looks like the action you want to take has already been taken.

Nope this is a brand new call. Even if it was an error on the second call then I should get back formatted JASON reply from the plugin

I had a look at their API docs, it looks like you may need to follow their process for asynchronous conversion, i.e. create a process, etc.

This works:

Action 1: Request process url
POST to https://api.cloudconvert.com/process
{ "inputformat": "txt", "outputformat": "png" }

Action 2: Start Process
POST to https:[url]
where url is from Step 1
JSON body how you have it.

Action 3: Pause workflow 3 seconds

  • This is arbitrary, would be better to either pause and check for status, or get them to call your Bubble endpoint when its done.
  • maybe even just save the image url and not worry about pausing … depends on how you want to display it.

Action 4: The output url from step 2 can be used to save into an image field.

1 Like

Yes the step by step works in bubble but seems too many calls where the original call performs it at once. The problem in bubble starts when you need to send the configuration of the conversion as it is a nested JSON request {{

I faced a similar issue when configuring the Google places API as it requires the same parameters

This topic was automatically closed after 14 days. New replies are no longer allowed.