Skip to main content
Best answer

API Query action returns "query string has to be specified"


Saravana

Hi, I am trying an API action in Salesforce but it keeps returning 400 error:

  • {"message":"A query string has to be specified","errorCode":"MALFORMED_QUERY"}

 

When I issue a plain curl query it returns the right values:

  • curl https://MyDomainName.develop.my.salesforce.com/services/data/v57.0/query/?q=SELECT+name+from+Account -H "Authorization: Bearer xxxxxxxxx"

 

So I am unsure how to setup parameters in Zapier to get the results:

 

 

Best answer by Saravana

Yes correct, I am using MyDomainName to hide my actual domain

I tried it like you said and it worked - thanks! I did not realise that you don’t need to encode the query.

 

 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

MohSwellam
Forum|alt.badge.img+8
  • Zapier Expert
  • 840 replies
  • March 17, 2023

Hi @Saravana 

 

Im guessing you are actually replacing the MyDomainName in the URL but just have it here like this so you can share it? 

 

Also, on the left hand side of the query string, just put q not “QueryString” and no need to encode them 


Saravana
  • Author
  • Beginner
  • 1 reply
  • Answer
  • March 17, 2023

Yes correct, I am using MyDomainName to hide my actual domain

I tried it like you said and it worked - thanks! I did not realise that you don’t need to encode the query.