Query Parameters in POST requests
# support
f
I'm trying to send a POST request with query parameters, but I keep getting the error
the protocol should be https://--
. This is my Request URL
Copy code
https://myorg.my.salesforce.com/services/oauth2/token?grant_type={{grant_type}}&client_id={{client_id}}&client_secret={{client_secret}}
I've defined the parameters in the request body as recommended by another thread. https://cdn.discordapp.com/attachments/1405633580838817935/1405633581308444804/image.png?ex=689f89c9&is=689e3849&hm=feddbb54f99468ff90226ecca171e83504a49a5d2ae285298aa2f13cd0e2133d& https://cdn.discordapp.com/attachments/1405633580838817935/1405633581841252393/image.png?ex=689f89c9&is=689e3849&hm=a6a343feda2380b0bc582e95869cc0dad7713827d82be8cf88d19afaf2aadb61&
c
For sending a POST request with query parameters in the URL, it's crucial to ensure that your base URL starts with
https://
and that any parameters required are included in the body or URL appropriately. Given the error message mentions the protocol, double-check that there aren't any trailing spaces or incorrect characters in your URL, especially right after
https://
. Also, ensure that your environment variables for
grant_type
,
client_id
, and
client_secret
are correctly resolved and do not contain unexpected characters or spaces. If you're using a tool like Postman or a script, confirm that escaped characters in the URL are properly handled. If you believe the URL is correct, and you're still getting this issue, try explicitly setting the headers for
Content-Type
or any other required headers as per your API documentation. Let me know if this helps or if you have further questions.
f
I have followed the above instructions but I am still getting the same error. The request works perfectly with Postman/cURL, using the same headers, URL, and secrets.
^
c
Hey, can you send me a screen recording video that walks through the issue you are facing? It would be easier for me to understand your issue and help you out with it.
f
Absolutely, I'll send that first thing tomorrow
I can't show the contents of the client_id and client_secret variables, but theyre just strings
c
Hey, can you share the org_id? You can find it [here](https://dashboard.vapi.ai/org/settings). This will help me get more details about it.
f
989d7b9d-8b9e-4f83-ad62-83004f156a32
you wont be able to see that particular workflow node because it doesnt allow me to save it due to the error
c
Hey, thanks for sharing your details. Our team will look into it and get back to you soon with an update.
Hey, could you try using the request body instead of the request URL with query parameters? It seems like that might help. We're aware of the issue on our end and will take some time to get it resolved.
f
I'm not sure I'm following, the parameters are defined in the body already
?
c
Are you still facing this problem?
f
I haven't tried recently, has it been resolved?
c
Our team has resolved the issue. If you are still facing this problem, please let me know.
f
Perfect, thank you. I will give it a shot and report back soon
I am still getting the same error when using the API Request tool with client_id, client_secret, and grant_type in the request body I noticed that you added custom credentials, this could be used instead of trying to set these as query parameters, populated by the request body. However, I'm not sure how to use this for Salesforce authentication. When I try to create a custom credential I get "Failed to create custom credential". I assume this is because there is no option for "grant_type" in the credential creation, which is needed to define the client_credentials oauth flow that I'm using for my [Salesforce Connected App](https://help.salesforce.com/s/articleView?id=xcloud.connected_app_overview.htm&type=5) -- but I'm not sure. Please advise https://cdn.discordapp.com/attachments/1405633580838817935/1419739414019702884/image.png?ex=68ebe75d&is=68ea95dd&hm=33ebf977d230e64f5a392b7b44e4ed938eba9c005dee8790c19c8f9968a8f64a& https://cdn.discordapp.com/attachments/1405633580838817935/1419739414422229076/image.png?ex=68ebe75d&is=68ea95dd&hm=3cfc0009becffa24f6dcb29383020935e8bffc469b15f479f3106b82dda05266&
c
Let me check with our team.
f
Any luck?
c
For salesforce credentials, it would be better to use them in an API request/custom function tool rather than creating a custom credential. Try modifying the URL through the API for that specific node to see if the variables will be accepted by the API instead
3 Views