# Salesforce REST API

**URL:** <https://community.weweb.io/t/salesforce-rest-api/1305>\
**Category:** Ask us anything\
**Created:** [October 17, 2022, 5:00pm UTC](https://community.weweb.io/t/salesforce-rest-api/1305 "2022-10-17T17:00:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emilie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/emilie/32/1415_2.png) [@Emilie](https://community.weweb.io/u/Emilie)\
**Post date:** [October 17, 2022, 5:00pm UTC](https://community.weweb.io/t/salesforce-rest-api/1305/1 "2022-10-17T17:00:21Z")

</div>

Hi,  
I trying to request Salesforce throught REST API.  
I already done with success for authentification ( token)  
But GET request doesn’t work, the response is :

- message: “Request failed with status code 400”
- name: “AxiosError”
- code: “ERR\_BAD\_REQUEST”
- status: 400

 ![Capture d’écran 2022-10-17 à 18.57.55](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/d1eb2f5dce231e76c12df0ef4a4efc0eaa62ae93.png)

Do you know what is wrong ?

---

<div class="post-metadata">

**Author:** ![Mael](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mael/32/13246_2.png) [@Mael](https://community.weweb.io/u/Mael)\
**Post date:** [October 18, 2022, 7:53am UTC](https://community.weweb.io/t/salesforce-rest-api/1305/2 "2022-10-18T07:53:00Z")

</div>

Hi Emilie,

Do you endpoint is working in postman or in other tool than WeWeb?

---

<div class="post-metadata">

**Author:** ![Emilie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/emilie/32/1415_2.png) [@Emilie](https://community.weweb.io/u/Emilie)\
**Post date:** [October 18, 2022, 8:38am UTC](https://community.weweb.io/t/salesforce-rest-api/1305/3 "2022-10-18T08:38:57Z")

</div>

Yes, it works with Postman, I found first solution.  
I tested with a text directly like that :  
concatenate(“[https://kazoo-dev-ed.my.salesforce.com/services/data/v47.0/query?q=SELECT](https://kazoo-dev-ed.my.salesforce.com/services/data/v47.0/query?q=SELECT) Name,NumberOfMonth\_retail\_\_c, KazooRetailPrice\_\_c,RentPrice\_\_c FROM ProductReference\_\_c WHERE Name=”,"'Clean et steam’")  
and it works correctly  
But now, i would like to use weweb variable but it doesn’t work again ☹

 ![Capture d’écran 2022-10-18 à 10.34.43](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/ce4247b129b0579a68f1be505169db4d59ed75f0.png)

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [October 18, 2022, 8:55am UTC](https://community.weweb.io/t/salesforce-rest-api/1305/4 "2022-10-18T08:55:38Z")

</div>

As you see in the result “Current value” your variable is not interpreted, I think it’s because you’re escaping it. Can you remove the “\” around ?

---

<div class="post-metadata">

**Author:** ![Emilie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/emilie/32/1415_2.png) [@Emilie](https://community.weweb.io/u/Emilie)\
**Post date:** [October 18, 2022, 10:28am UTC](https://community.weweb.io/t/salesforce-rest-api/1305/5 "2022-10-18T10:28:04Z")

</div>

I tried but I need to add ’ ’ around the text.  
So I found a workaround, before to put the value into the weweb variable I use Concatenate function like that : concatenate(“'”,VARIABLE,“'”)  
And It works  
Thanks a lot for your support. For sure I will back soon with a new question 🙂

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [October 18, 2022, 12:34pm UTC](https://community.weweb.io/t/salesforce-rest-api/1305/6 "2022-10-18T12:34:20Z")

</div>

Glad it helped you! For the next time, be aware you can also do something like “'” + product + “'” (with the + operator)
