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?

1 Answer 1

5

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .