API for search Directory error | XM Community
Skip to main content

Hi,

I am trying to use below API to search for records in Directory :

https://api.qualtrics.com/c79e78a949572-search-directory-contacts

When I was trying out in documentation, single field filter works fine, but when I use below code for multiple criteria based on syntax they have provided I am getting an error :

{

"meta": {

"httpStatus": "400 - Bad Request",

"error": {

"errorMessage": "The provided simpleFilter syntax is invalid, please review all components before retrying the request",

"errorCode": "CFH_0.4"

},

 

 

Below is the code that I am using in body:

 

{

"filter": 
{
"conjunction": "and",
"filters": 
b
{"comparison": "eq",
"filterType": "email",
"value": "aa@b.com"},

{"comparison": "eq",
"filterType": "externaldatareference",
"value": "cc@b.com"}

]
}
}

 

What am I doing wrong ?

Hi @Neha Tank 

extRef instead of externaldatareference


Thanks a lot vgayraud for the prompt support. It worked fine.

I would like to use this API in webservice element in my survey flow. 

The requirement is to pass email and extRef to get couple of attributes from the contact list and store in embedded field in survey. I wasn’t sure how is the body with filter provided in webservice below:

 

 

I tried passing only one filter in Body parameters and clicked on TEST and it was returning only the requestID. How can I obtain other attributes and store in embedded data ?

 

Thanks in advance.


Something like that, where you would pipe in values for email and extRef from EDs or questions I suppose :

 


I did this but then it gave me same error "The provided simpleFilter syntax is invalid, please review all components before retrying the request", 


true instead of TRUE and check your filter syntax, it’s working fine for me.

 


Thanks a ton vgayraud. It worked well.


Now instead of hard coded values for email and extRef I want to give embedded field values. Can it still be done through json ? How should i modify the json filter syntax ?


Absolutely, just can pipe in the values you want, EDs, question answers, panel fields. you can also add piped-in text in the URL or other query parameters. It’ll look like this :

{
"filter": {
"conjunction": "and",
"filters": "
{"comparison": "eq", "filterType": "email", "value": "${e://Field/yourField1"},
{"comparison": "eq", "filterType": "extRef", "value": "${e://Field/yourField2"}]
}
}

 


Leave a Reply