I'm trying to retrieve an Id from Salesforce over the REST API using SOSL.
My query which I can execute without issue in the Developer Console is:
FIND '(415)901-7000' IN PHONE FIELDS RETURNING Account(Id)
This is the phone number of the sForce Account which is present in my Developer Org.
I am calling the REST Api from C# and this is my encoded Uri:
/services/data/v20.0/search/?q=FIND+%27(415)901-7000%27+IN+PHONE+FIELDS+RETURNING+Account(Id)
However, when I send the request I get this in the response:
{
"message": "No search term found. The search term must be enclosed in braces.",
"errorCode": "MALFORMED_SEARCH"
}
Attempting to address this with:
FIND {(415)901-7000} IN PHONE FIELDS RETURNING Account(Id)
I send:
/services/data/v20.0/search/?q=FIND+%7B(415)901-7000%7D+IN+PHONE+FIELDS+RETURNING+Account(Id)
But I simply get the following in the response:
{
"message": "",
"errorCode": "MALFORMED_SEARCH"
}
What is the correct way to send this SOSL search via the REST API?