# Help Needed: POST Web API

**URL:** https://community.thunkable.com/t/help-needed-post-web-api/1484855
**Category:** Questions about Thunkable X
**Created:** [September 3, 2021, 6:19am UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855 "2021-09-03T06:19:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![kareem](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kareem](https://community.thunkable.com/u/kareem)
#### Post date: [September 3, 2021, 6:19am UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/1 "2021-09-03T06:19:36Z")

</div>

Hi all,

So currently I am testing out an API for sms.to as I needed a workaround for mobile phone verification for an app. For context, in my country email verification just wont cut it due to phone/facebook authentication being a widespread norm (so without it, my app’s UX is instantly faulty). That puts firebase authentication out of the way, though I will still use it as the database.

The app is a mulit-vendor e-commerce app with payments and all that, but for some reason I am unable to put the correct body block so that the request is successfull so I keep getting “null” as my response.

I looked throught the other posts ([1](https://community.thunkable.com/t/post-data-web-api/1267637/4),[2](https://community.thunkable.com/t/help-for-web-api/1369985/6),[3](https://community.thunkable.com/t/help-with-web-api-post-request/624457/8),[4](https://community.thunkable.com/t/help-with-api-post/562993/2),[5](https://community.thunkable.com/t/help-with-web-api-post/763173/3),[6](https://community.thunkable.com/t/help-with-web-api-post-requests-and-body/42865)) but I still cant figure out how to put the body blocks, and I tested it with postman and it works so I presume my problem here must be the blocks. Below are the images of my blocks, api documentation, and succesfull postman test.

**sms.to api docs** (I did consider Twilio as it is mentioned a lot here, but unfortuantely it has no support for my country)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/2/422a7b7a0fe3cb3f62c6824f2351e7f730691b00.png)

**Postman POST Test** (successful, I was trying to understand whether -d goes in the body or query parameters in thunkable blocks, looks like its a body thing)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/d/5d0e2b72a52c35bda60daeaf6721e8a6cca34c01.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/f/df49758eb6cf1366f847866e87ba74be712df6fc.png)

**Thunkable Project Blocks and Test** (is my method to collect and display the response correct? as well as setting the body?)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/b/0baf911d39e2e4b082dac4b49b897849bd1aa0bb.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f67eab01c82b46e1480d1251564412208bf8109e.png)

To reiterate, my assumption is that the response is null here because there is a problem with my blocks. Any clues?

_Edit: fixed spelling errors_

_Edit 2: The solution should be below this text. Muneer’s answer was 100% correct, I tested it again wihtout the_ `generate JSON from object` _and just put the_ `response`, `status`, _and_ `error` _blocks in and it worked perfectly (no backslashes anymore). Good luck to all who face this problem, I hope this helps!_

---

<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: [September 3, 2021, 12:49pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/2 "2021-09-03T12:49:41Z")

</div>

You are not using any error handler so better show the full `response` of the API call and also show the `error` and `status` (all the green blocks of the API `POST` call.

Without these info you do not actually know what was the problem.

something similar to this `{"success":false,"status":401,"message":"Invalid Token"}`

---

<div class="post-metadata">

### Author: ![kareem](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kareem](https://community.thunkable.com/u/kareem)
#### Post date: [September 3, 2021, 1:04pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/3 "2021-09-03T13:04:56Z")

</div>

Hi Muneer,

Thanks for the suggestion, so you mean something like this?  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/5/95e18cc92b8a499e41d0caa6a544f6ffad262e01.png)

---

<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: [September 3, 2021, 1:06pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/4 "2021-09-03T13:06:31Z")

</div>

Do not use `get object from JSON`. You the green blocks directly to just display whatever comes from the API call.

---

<div class="post-metadata">

### Author: ![kareem](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kareem](https://community.thunkable.com/u/kareem)
#### Post date: [September 3, 2021, 1:15pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/5 "2021-09-03T13:15:55Z")

</div>

Got it, switched it to `generate JSON from object` and that did the trick. Here is the response:

**Blocks**

 ![Inkedimage_LI](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/7/170596b522f5a8ad1c7dad1f03d289bff3e948a2.jpeg)

**Thunkable Preview**

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

**Thunkable Live Test**

 ![InkedWhatsApp Image 2021-09-03 at 14.10.49_LI](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/f/7fedb959e76c291ed28bc9b32f4e9d3e45d7ded0.jpeg)

Thank you so much for the help Muneer!

---

<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: [September 3, 2021, 1:19pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/6 "2021-09-03T13:19:20Z")

</div>

Status of **200** means success. Good luck to you for the rest of the app.

---

<div class="post-metadata">

### Author: ![hdawc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hdawc/32/119068_2.png) [@hdawc](https://community.thunkable.com/u/hdawc)
#### Post date: [September 10, 2021, 6:45pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/7 "2021-09-10T18:45:22Z")

</div>

Your API key and phone number are showing @kareem

> [@Help Needed: POST Web API](https://community.thunkable.com/t/help-needed-post-web-api/1484855/5):
>
> Got it, switched it to generate JSON from object and that did the trick. Here is the response: Blocks Thunkable Preview Thunkable Live Test Thank you so much for the help Muneer!

---

<div class="post-metadata">

### Author: ![kareem](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kareem](https://community.thunkable.com/u/kareem)
#### Post date: [September 12, 2021, 8:09pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/8 "2021-09-12T20:09:45Z")

</div>

@hdawc Whoops! Thanks for pointing that out, I have fixed it now.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:17pm UTC](https://community.thunkable.com/t/help-needed-post-web-api/1484855/9 "2024-11-08T13:17:00Z")

</div>


