-1
String uri = baseUri + "/query?q=Select+Id+from+Account+where+Id=+ ('017F00000nqmNPQAY')";

I am using SOQL for querying the data, it is working fine without where clause, but I don't know how to write it with where clause, It is throwing error when I am trying the above syntax. How can I resolve this?

Hash
  • 4,647
  • 5
  • 21
  • 39

1 Answers1

1

Why not do something like this:

URIBuilder ubuilder = new URIBuilder(baseUri);
ubuilder.setPath("/services/data/v39.0/query/")
   .setParameter("q", "SELECT Id, Name FROM Account WHERE Id = '017F00000nqmNPQAY'");
HttpGet request = new HttpGet(ubuilder.build());
Gareth Jordan
  • 968
  • 1
  • 6
  • 10