Skip to main content
Best answer

Salesforce Zapier API call issue

  • May 15, 2025
  • 14 replies
  • 133 views

Forum|alt.badge.img

Hi Team
I am exploring Salesforce Zapier connection, and I want to query a tooling api request where I am facing issue with below being used in Zapier - API Request Beta.
mysalesforcedomainurl/services/data/v62.0/tooling/query?q=SELECT+Id,PackageLicense.NamespacePrefix,PackageLicenseId+FROM+InstalledSubscriberPackage


This is a Get request.
ERROR -
 

Salesforce returned a MALFORMED_QUERY error. Please make sure you are entering valid data or use the help link below to contact Zapier support for more information / assistance.

Best answer by SamB

I’m so sorry to hear it didn’t work as hoped, ​@mjanwani. I did some testing with that same query in a Zap and managed to replicate the error. So I put the query into the Query string parameters section instead of the URL field, which allows the parameters to be automatically encoded and that got rid of the “MALFORMED_QUERY” error.

For example, this was the set up:

4ec3164e2c0ddd5678cd427230671fa3.png

And here’s what it returned:
20bdc6fd90b83e57d1e990cd66d1af86.png
 

Can you give that approach a try and let me know whether that sorts it?

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

14 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34072 replies
  • May 15, 2025

Hi ​@mjanwani 

For us to have more info, post screenshots showing how your Zap step is configured in EDIT mode with the field mappings visible.

Also, link to the app API endpoint documentation you used to configure the API request in the Zap step.


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 15, 2025



This is what I am aiming for.


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34072 replies
  • May 15, 2025

@mjanwani 

What is the link to the app API endpoint documentation you used to configure the API request in the Zap step?

Also, screenshot does not show how the Headers are configured.


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 15, 2025

Header is not needed this is the previous step.  Also didnt find any specific documention here.
 

This post has been edited by a moderator to remove personally identifiable information (PII). Please remember that this is a public forum and avoid sharing sensitive details.


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34072 replies
  • May 15, 2025

@mjanwani 

How did you know what value to put in the URL field if you did not reference any API endpoint documentation?

 


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 15, 2025

I tried hitting similar url from Workbench and it works.
 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34072 replies
  • May 15, 2025

@mjanwani 

So you never referenced official Salesforce API endpoint documentation links to configure your Zap step API request?

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.htm


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 9744 replies
  • May 16, 2025

Hi and welcome to the Community, ​@mjanwani! 🎉

It could be the + characters in the URL that are causing the trouble here. Looking at the Saleforce documentation Troy linked to it states that either + or %20 characters can be used:

e80861ec0977b5698816aaa152a0139a.png

Can you try changing all the + to %20 instead, and let us know whether that fixes it?


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 16, 2025

Hi SamB
Looks like it does not work either
Orgulr/services/data/v62.0/tooling/query?q=SELECT%20Id%20FROM%20InstalledSubscriberPackage


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 16, 2025

could you please help team @Troy Tessalone


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 9744 replies
  • Answer
  • May 19, 2025

I’m so sorry to hear it didn’t work as hoped, ​@mjanwani. I did some testing with that same query in a Zap and managed to replicate the error. So I put the query into the Query string parameters section instead of the URL field, which allows the parameters to be automatically encoded and that got rid of the “MALFORMED_QUERY” error.

For example, this was the set up:

4ec3164e2c0ddd5678cd427230671fa3.png

And here’s what it returned:
20bdc6fd90b83e57d1e990cd66d1af86.png
 

Can you give that approach a try and let me know whether that sorts it?


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 19, 2025

Thanks!!! I did try that way but I used + in the query.
Thanks you for saving!


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • May 19, 2025

Can you help me one more things here - This API request is in beta, means it won’t work for production URL?
Then we have to go with Webhooks?


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 9744 replies
  • May 20, 2025

You are most welcome, ​@mjanwani 🤗

Glad I could help. I’ll go ahead and mark my previous reply as the best answer here, as seems to have done the trick! 😁🎉

This API request is in beta, means it won’t work for production URL?
Then we have to go with Webhooks?

No, the reference to beta in the action’s name doesn’t mean that it won’t work for production URLs used in the API Requests. You wouldn’t need to switch to using the Webhooks by Zapier app instead.

It’s the API Request action itself that is a beta feature: It is available for use, but is still in active development and may change in future. 

Hope that helps to clarify things. Let me know if you’ve got any further questions or if there’s anything else I can assist with.