# \[Solved\] How do I make a cURL api call using the webAPI?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194>\
**Category:** Questions about Thunkable X\
**Tags:** webapi, curl\
**Created:** [April 24, 2022, 8:25pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194 "2022-04-24T20:25:08Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [April 24, 2022, 8:25pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194/1 "2022-04-24T20:25:08Z")

</div>

I have a CURL command that I want to use in Thunkable with an API Post block:

curl -H “Content-Type: application/json” -H “authorization: Token _API\_TOKEN_” [https://api.ximilar.com/recognition/v2/classify](https://api.ximilar.com/recognition/v2/classify) -d ‘{“task\_id”: “_TASK\_ID_”, **“records”: [{"\_url": “_URL_” }]** }’

I’m having a hard time figuring out how to set up the part in bold. I’ve never seen a list used as a parameter value. I tried this:

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

But it gave me an error (“records field required”). I also tried it without the list block but the same error appeared.

Any suggestions?

---

<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:** [April 24, 2022, 8:32pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194/2 "2022-04-24T20:32:37Z")

</div>

Import the call in a piece of software called postman.

From there you can see any headers you need to set as well as what body and query parameters need to be set. It’s super handy and it’s what I use most of the time when I have to figure out a curl call

Or

Search for a curl to restAPI converter online

---

<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:** [April 24, 2022, 9:27pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194/3 "2022-04-24T21:27:20Z")

</div>

See this post @manyone already solved the issue

> [@How to link Ximiliar app to Thukable](https://community.thunkable.com/t/how-to-link-ximiliar-app-to-thukable/1810704/39):
>
> here’s the curl statement for a classify run for one photo: curl -H “Content-Type: application/json” -H “authorization: Token API\_TOKEN” [https://api.ximilar.com/detection/v2/detect](https://api.ximilar.com/detection/v2/detect) -d ‘{“task\_id”: “0a8c8186-aee8-47c8-9eaf-348103xa214d”, “records”: [{"\_url": “[https://bit.ly/2IymQJv](https://bit.ly/2IymQJv)” } ] }’ here’s what i think the web api blocks should look like (NOTE: FOR TWO PHOTOS) i believe the contents of \_url should be the actual url you type in browser to see the image (in this example, yo…

---

<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:** [April 24, 2022, 10:19pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194/4 "2022-04-24T22:19:23Z")

</div>

this is the final block that works - it’s calling the correct endpoint /recognition/v2/classify (the above was mistakenly pointing to /detection/v2/detect)  
[![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/d/0d7d9acfa0615b3f9be41cdd4f391cc094a3c2e4.png) ](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/d/0d7d9acfa0615b3f9be41cdd4f391cc094a3c2e4.png)

this is based on a classify run to classify only one image. (see object inside list in **records** parameter). if more photos are needed, simply them as new objects to the list - but then you have to modify the response processing to use a **for** loop so that the property string “records[1].best\_label.name” is adjusted so the index to records reflects the current value.)

---

<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:** [April 24, 2022, 10:55pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194/5 "2022-04-24T22:55:34Z")

</div>

Thank you! That worked. I had to use Body instead of Query Parameters and I also needed the generate JSON from object block.

---

<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:** [July 23, 2022, 10:55pm UTC](https://community.thunkable.com/t/solved-how-do-i-make-a-curl-api-call-using-the-webapi/1846194/6 "2022-07-23T22:55:40Z")

</div>

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