Skip to main content

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.

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.




This is what I am aiming for.


@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.


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.


@mjanwani 

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

 


I tried hitting similar url from Workbench and it works.
 


@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


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?


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


could you please help team @Troy Tessalone


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?


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


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?


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.


Reply