Seema
Seema

Reputation: 1

Illegal character in query at index --salesforce

Getting this error:

Illegal character in query at index 61:

https://cs4.salesforce.com/services/data/v32.0/query?q=Select +AppId__c,Technical_Review_Approved__c +From Application__c + Where + AppId__c+= '1793poiuyt' 

Even tried this:

String url = "/query?q=";
String getRecords = url + "Select AppId__c,Technical_Review_Approved__c From Application__c Where AppId__c= '1793poiuyt' " ;


Caused by: java.net.URISyntaxException:  Illegal character in query at
index 61: 
https://cs4.salesforce.com/services/data/v32.0/query?q=Select AppId__c,Technical_Review_Approved__c From Application__c Where AppId__c= '1793poiuyt'

Upvotes: 0

Views: 2278

Answers (1)

raffters
raffters

Reputation: 186

You can't have spaces in a URL. Check the REST Developer Guide: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm.

An example: https://na1.salesforce.com/services/data/v20.0/query/?q=SELECT+name+from+Account -H "Authorization: Bearer token"

Upvotes: 1

Related Questions