• Bear Drew
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
It's the same question as https://developer.salesforce.com/forums/?id=906F0000000MMbqIAG, but with a twist: I need to do this via REST.

For example, the REST API documentation uses the following example:
curl https://yourInstance.salesforce.com/services/data/v20.0/query/?q=SELECT+name+from+Account -H "Authorization: Bearer token"
but my SOQL uses email address to lookup a Contact.  And this email happens to contain an apostrophe.  

What should the query parameter look like for the following SOQL?
SELECT+Id,+Email,+Name,+Phone+FROM+Contact+WHERE+Email=john.o'connor@skynet.com+AND+AccountId='001W010000HnaZhiAJ'

Using this format returns:
'No viable alternative at character \"'

Using "john.o\'connor@skynet.com" returns:
'Bind variables only allowed in Apex code'

So does URI encoding the backslash to %5C (john.o%5C'connor@skynet.com).

I am stuck.  Can anyone help?
 
  • September 16, 2016
  • Like
  • 0