# Error en consulta post API - con api gateway

**URL:** <https://community.thunkable.com/t/error-en-consulta-post-api-con-api-gateway/3331142>\
**Category:** Web API's\
**Created:** [November 8, 2024, 5:12pm UTC](https://community.thunkable.com/t/error-en-consulta-post-api-con-api-gateway/3331142 "2024-11-08T17:12:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisleon7677qhx9vj](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luisleon7677qhx9vj/32/187698_2.png) [@luisleon7677qhx9vj](https://community.thunkable.com/u/luisleon7677qhx9vj)\
**Post date:** [November 8, 2024, 5:12pm UTC](https://community.thunkable.com/t/error-en-consulta-post-api-con-api-gateway/3331142/1 "2024-11-08T17:12:06Z")

</div>

Estoy intentando hacer un ingreso de datos por metodo POST a un servicio de API GATEWAY que me debe debolver un valor de prediccion en funcion a tres valores que ingreso y no me devuelve nada, hice las pruebas en postman y todo sale bien, mi solicitud en postman no requiere ningun encabezado, solo url y el cuerpo, pero aqui en thunkable tengo error con ello, Agradeceria su ayuda.  
Esta es mi consulta postman:

 ![awspostman](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/0/c0aaecd638415b75f99e329c0b8afc3d455937b2.png)

Este es mi codigo en thunkable

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

ya he probado hacer consultas post con otras apis y no tengo problemas, pero con esa en particular me da problemas, no se si se deba a los parametros de header, ya que en las otras si me solicitaron porque en postamn tambien los solicitaba, pero esta solicitud en postman no requeria ningun header o autorizacion y parece que tengo un error con la estructura de mi json

---

<div class="post-metadata">

**Author:** ![luisleon7677qhx9vj](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luisleon7677qhx9vj/32/187698_2.png) [@luisleon7677qhx9vj](https://community.thunkable.com/u/luisleon7677qhx9vj)\
**Post date:** [November 8, 2024, 5:14pm UTC](https://community.thunkable.com/t/error-en-consulta-post-api-con-api-gateway/3331142/2 "2024-11-08T17:14:25Z")

</div>

Como status me sale: undefine  
como error me sale: Failed to fetch  
el objeto que me devuelve es : null

---

<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:** [November 8, 2024, 7:17pm UTC](https://community.thunkable.com/t/error-en-consulta-post-api-con-api-gateway/3331142/3 "2024-11-08T19:17:11Z")

</div>

Try giving the API Body text strings instead of numbers. You’re using 89, 13, and 36. What if you used “89”, “13”, and “36” instead? Does that work? I don’t know if it will help.

Does it work if you just set the Body to the JSON text string “{“x1”:13,“x2”:36,“x3”:89}” using a Text block – as a test?

---

<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, 7:26pm UTC](https://community.thunkable.com/t/error-en-consulta-post-api-con-api-gateway/3331142/4 "2024-11-08T19:26:58Z")

</div>

@luisleon7677qhx9vj  
Have you test it on Thunkable Live app? This could be a CORS issue.

CORS can prevent a web API from working on web.

You can check your [browser console](https://developers.google.com/web/tools/chrome-devtools/open) to see if this is the case. If so, you’ll see an error like this:

“Access to fetch at [URL] from origin ‘[https://x.thunkable.com](https://x.thunkable.com/)’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.”

You can find more information here: [https://docs.thunkable.com/blocks/advanced-app-features/web-api/cors-policy](https://docs.thunkable.com/blocks/advanced-app-features/web-api/cors-policy)
