1

I am trying to execute a very simple query on a standard Case object via the REST API but am receiving an INVALID_QUERY_LOCATOR error.

My query is:

SELECT Status FROM Case WHERE CaseNumber='00001039' LIMIT 1

which works in the developer console, but not via the REST API:

https://cs5.salesforce.com/services/data/v20.0/query/q=SELECT+Status+FROM+Case+WHERE+CaseNumber='00001039'+LIMIT+1

Error response: 400 - BadRequest

[{"message":"invalid query locator","errorCode":"INVALID_QUERY_LOCATOR"}]

I've also tried escaping the quote char in the URL with %27, without any luck:

https://cs5.salesforce.com/services/data/v20.0/query/q=SELECT+Status+FROM+Case+WHERE+CaseNumber=%2700001039%27+LIMIT+1

Any ideas?

4

400 means your request is not correct. Check that you are missing ? mark in your REST query. Try below

https://cs5.salesforce.com/services/data/v20.0/query/?q=SELECT+Status+FROM+Case+WHERE+CaseNumber='00001039'+LIMIT+1

Note that Workbench is a good tool to test your request

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.