# How do I convert cURL syntax to thunkable?

**URL:** <https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067>\
**Category:** Questions about Thunkable X\
**Tags:** webapi, curl\
**Created:** [May 11, 2022, 6:57pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067 "2022-05-11T18:57:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![s114895u5j68v](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@s114895u5j68v](https://community.thunkable.com/u/s114895u5j68v)\
**Post date:** [May 11, 2022, 6:57pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/1 "2022-05-11T18:57:49Z")

</div>

Hi everyone, I’ve been working on a school project that involves using DeepAI’s deep dream API. I want my app to take a photo that the user uploads and sends it to the API, and returns the image processed by it. I’ve been having a bit of trouble getting the syntax formatted properly, and it’s been causing me a lot of trouble.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/8/18199ed58ce051634b751c7aa7a6538cf1eb72cb.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/5/b5e21480ad02d61f90a6ec6814e0810959c1b123.png)  
 ![Screen Shot 2022-05-11 at 1.43.29 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/8/e8a7c1a8ae237b37b1b212664867359527d17411.jpeg)

This is how the documentation describes using the API, and I’ve been trying to the best of my ability to make it work in thunkable. I’ve set the my webAPI URL to [https://api.deepai.org/api/deepdream](https://api.deepai.org/api/deepdream), and have created a header called “Api-key” set to my API key. Yet, I’m still evidently missing something and it’s been causing me trouble. Online cURL converters have helped me somewhat, but I’m still stuck.

For reference, [here’s a link to the DeepAI deep dream documentation](https://deepai.org/api-docs/?shell#deep-dream)

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 11, 2022, 8:38pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/2 "2022-05-11T20:38:28Z")

</div>

This is really helpful information that you provided. I haven’t worked with the -F flag for API calls. It’s apparently form data as explained a bit [here](https://superuser.com/questions/149329/how-do-i-make-a-post-request-using-curl) and [here](https://everything.curl.dev/http/multipart#sending-such-a-form-with-curl). I just tried to Post the data several different ways (as header, as body, as query parameter; with and without a leading “@” symbol for the image path) and each time it returned the error “error processing given inputs from request.”

So I’m not sure and I know that’s not very helpful but I’ll let you know if I get it working. Here’s the curl command that works in Terminal on a Mac:

```auto
curl \
    -F 'image=https://www.birdlife.org/wp-content/uploads/2021/06/Owl-in-tree-by-Philip-Brown-1-1024x576.jpg' \
    -H 'api-key:quickstart-QUdJIGlzIGNvbWluZy4uLi4K' \
    https://api.deepai.org/api/deepdream

```

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 11, 2022, 8:51pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/3 "2022-05-11T20:51:01Z")

</div>

can you try this? (i can’t test it)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/f/1fc119db680c56e0b5fe3fd5fbe27ec95af869e5.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 11, 2022, 9:00pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/4 "2022-05-11T21:00:39Z")

</div>

I’ve run out of free calls with the quickstart API key I used above. But I’m sure I tried that combination and got the same error. I also can’t get this to work at all in Postman. Only in Terminal.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 11, 2022, 9:22pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/5 "2022-05-11T21:22:31Z")

</div>

i didnt know you can get a quickstart apikey. i’ll try later. thanks

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 11, 2022, 9:25pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/6 "2022-05-11T21:25:12Z")

</div>

It’s just the one displayed in the documentation so I think it’s something anyone can use. I didn’t have to generate it in any way… just copied and pasted. But it only allowed maybe 5 calls.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 12, 2022, 12:21am UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/7 "2022-05-12T00:21:59Z")

</div>

> [@tatiang](#):
>
> `quickstart-QUdJIGlzIGNvbWluZy4uLi4K`

i got postman to work (the -F part became part of form-data).

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/4/54900b7a3e4d287ad2b0515873d6def507348853.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/1/21cb291a85f9e83eb29019d9939c467aa769f8db.png)

here’s the result:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/2/b21a24f39078d8b4f23b5214289c7d1e5f853468.jpeg)

i never got to translate the -F part to thunkable before the api-key ran out!.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 12, 2022, 6:11am UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/8 "2022-05-12T06:11:38Z")

</div>

For the **F** parameter to work, you need to include in the header:  
**Content-Type=x-www-form-urlencoded**

This option tells the API to treat the properties as if coming out of HTML form.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 12, 2022, 5:42pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/9 "2022-05-12T17:42:27Z")

</div>

i think the api-key has no limit - i’ve used it in and out of postman several times for 2 days and i get 200 return codes (see below) for the same reason i think the same api-key should also work in thunkable.

but i can’t seem to make thunkable to do this. i’ve tried your suggestion, and other settings.

can you (@muneer or anyone else) try to make my project (see below) work? thanks.

here’s my postman screenshots

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/8/68a0e1c0e99d998bc4691c46ad68e299f89fa3fa.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/4/747f1a34912f3a7fc55320fa1d79a9da2474ed60.png)  
and the link to the output:  
`https://api.deepai.org/job-view-file/12f7bfa3-b333-4d2b-97af-8fba69ba07ef/outputs/output.jpg`

here’s my block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/2/92233385d48e67629bd3b41b569910648a71da56.png)

here’s the project link  
[https://x.thunkable.com/copy/915ab7ab40e21ed88eaa403e4e0870a1](https://x.thunkable.com/copy/915ab7ab40e21ed88eaa403e4e0870a1)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 12, 2022, 6:49pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/10 "2022-05-12T18:49:51Z")

</div>

The easiest way I have found is what you are doing here ^^^ @manyone

Nice!

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 12, 2022, 7:02pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/12 "2022-05-12T19:02:23Z")

</div>

did it work for you? it doesnt work for me! maybe the api-key does have an expiration count as @tatiang suspects.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 12, 2022, 7:03pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/13 "2022-05-12T19:03:12Z")

</div>

@manyone  
@tatiang  
@jared  
@s114895u5j68v

Here is a working copy of @manyone project

[https://x.thunkable.com/copy/d7bd72114656eb551fa71b2516d80684](https://x.thunkable.com/copy/d7bd72114656eb551fa71b2516d80684)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 12, 2022, 7:05pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/14 "2022-05-12T19:05:47Z")

</div>

thanks!  
that’s tricky! you’d think it follows the same “standard” json method of key:value pair but it doesn’t!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 12, 2022, 7:45pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/15 "2022-05-12T19:45:33Z")

</div>

**image=**

Aha! I _almost_ tried that but wasn’t sure where to put it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 10, 2022, 7:46pm UTC](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/16 "2022-08-10T19:46:00Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
