function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Harshal Sakpal 18Harshal Sakpal 18 

SOSL using POST REST /parameterizedSearch API

I got the "/services/data/v46.0/parameterizedSearch" POST API working for a complex SOSL search I want to perform. I am referring to the Salesforce documentation here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized.htm

My requirement is, I wish to find an email address by only searching the email fields and have the request json payload tailored to do so
 
POST /services/data/v46.0/parameterizedSearch
{ 
"q":"mytestemail+test@example.com", 
"fields":["Id", "external_id__c"], 
"in": "EMAIL", 
"sobjects": [{"name":"Account"}] 
}

Per my understanding if I use "in": "PHONE" it should not yield any results but it does.
 
POST /services/data/v46.0/parameterizedSearch 
{ 
"q":"mytestemail+test@example.com", 
"fields":["Id", "external_id__c"], 
"in": "PHONE", 
"sobjects": [{"name":"Account"}] 
}

Please let me know if I am missing something here.
vijay kumar kvijay kumar k
Hi Harshal

I think u forgot to add Email field in fields

​​​​​​For reference
 
POST /services/data/v46.0/parameterizedSearch 
{ 
"q":"mytestemail+test@example.com", 
"fields":["Id", "external_id__c","Email__c"], 
"in": "Email__c", 
"sobjects": [{"name":"Account","where":"Email__c !=null"}] 
}

 
Harshal Sakpal 18Harshal Sakpal 18
@vijay kumar k
per documentation The "in" field accepts one of the following values. Mentioned in the documentation here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized.htm

Use one of the following values:
  • ALL
  • NAME
  • EMAIL
  • PHONE
  • SIDEBAR
roshif caferoshif cafe

When you visit the NBI Clearance Outlets, you should show both your Valid IDs and adequate identification…


https://www-nbiclearancecom.com/