Jump to: navigation, search

ContactListGet

Purpose

This method is intended for building a ScrollableList object based on provided constraints. There is no general rule. Results depend on the filter used, and on the database used. Note also that the data returned by the lookup request comes from the Contact table only. In the same way, the ordering of the Contacts returned is done using Contact table data only.

URL

  • GET /OMContacts/ContactListGet/

Request

Parameters

Key ValueType Value Description Mandatory Unique Default
ContactCount String Asks UCS to return total count of matching Contacts.

Setting this parameter to true results in an extra database query which will decrease performance.

false true false
TenantId Integer true true
SubscriberId String The subscriber (that is, line of business) within the tenant to which the contacts belong false true
PageMaxSize Integer If no value is provided, UCS configured value (schema/select-limit) is used. false true (schema/select-limit)
ESQuery String Raw Lucene Query. If present, overrides both SearchCriteria and SortCriteria. false true
SearchCriteria KVList No filtering if not present false true
SortCriteria KVList No ordering if not present false true
AttributeList KVList List of sortable attributes to return false true If AttributeList KVList is null or is not passed, all attributes are returned.

Please refer to www.elastic.co/guide/en/elasticsearch/reference/1.7/query-dsl.html for a description of the ESQuery possible values

SearchCriteria KVList value SimpleConstraint KVList definition

Key ValueType Value Description Mandatory Unique Default
(Operator) KVList yes yes false false


KVList value detail

Key ValueType Value Description Mandatory Unique Default
AttrName String The system name of a Contact Attribute as declared in Configuration Server (tenant-specific configuration)

Max. length: 256 characters

true true
AttrValue String The value type of this parameter depends on the Contact Attribute type declared in Configuration Server (settings/type). If type is set to:

String (default): value must be a String Max. length: 256 characters date: value must be a String formatted with the pattern: "yyyy-MM-ddTHH:mm:ss.SSSZ" binary: This is an error! Binary values cannot be used in search constraints

false true


ComplexConstraint KVList definition

Key ValueType Value Description Mandatory Unique Default
(Operator) KVList One instance for NOT operator. Multiple instances for AND or OR operators. true false

(Operator) = NOT || AND || OR KVList value detail conforms to SimpleConstraint or ComplexConstraint KVList definition

SortCriteria KVList value

Key ValueType Value Description Mandatory Unique Default
(Sort Index) KVList false true


KVList value

Key ValueType Value Description Mandatory Unique Default
Operator String Can have value of "ASC" or "DSC". true true
AttrName String String represents either:
  • A Contact object attribute name: 'Id', 'TenantId', 'IsExternalResource', 'CreatedDate', 'ModifiedDate', 'MergeId'; or;
  • A sortable Contact Attribute system name.

Configuration note—to make a Contact Attribute sortable, it is necessary to configure this Contact Attribute as sortable (settings/is-sortable) in ConfigServer (EmailAddress, PhoneNumber, FirstName & LastName are sortable by default). (Notice the number of sortable Contact Attributes is limited !) Max. length: 256 characters

true true


AttributeList KVList

Key ValueType Value Description Mandatory Unique Default
AttrName String String value represents attribute name.:
  • A Contact object attribute name: 'Id', 'TenantId', 'IsExternalResource', 'CreatedDate', 'ModifiedDate', 'MergeId'; or;
  • A sortable Contact Attribute system name.

Configuration note—to make a Contact Attribute sortable, it is necessary to configure this Contact Attribute as sortable (settings/is-sortable) in Configuration Server (EmailAddress, PhoneNumber, FirstName & LastName are sortable by default) (Note that the number of sortable Contact Attributes is limited.) If AttributeList KVList is empty, all attributes are returned. Max. length: 256 characters

false false

Sample

TenantId 102
SearchCriteria AND EQUAL AttrName FirstName
AttrValue John
AND NOT_EQUAL AttrName LastName
AttrValue Doe
SortCriteria 0 Operator ASC AttrName LastName
1 Operator DSC AttrName FirstName
AttributeList AttrName EmailAddress
AttrName PhoneNumber

Sample

TenantId 101
SearchCriteria EQUAL ESQuery FirstName:C*
AttributeList AttrName FirstName
AttrName LastName

Sample

TenantId 101
ESQuery LastName:C*
AttributeList AttrName FirstName
AttrName LastName

Sample

TenantId 101
ESQuery {"from":0,"size":5,"query":{"query_string":{"query":"+LastName:Cassandra +FirstName:C*"}},"sort":[{"FirstName":{"order":"asc"}}]}
AttributeList AttrName FirstName
AttrName LastName

Sample

TenantId 101
ESQuery {"from":0,"size":5,

"query":{"fuzzy":{"LastName":{"value":"Cassandra","fuzziness":2}}},"sort":[{"FirstName":{"order":"desc"}}]}

AttributeList AttrName FirstName
AttrName LastName

Success

Parameters

Key ValueType Value Description Mandatory Unique Default
ScrollId String ScrollableList Id This id is used to call LookupNextPage. Not available if HasNext is false false true
TotalCount Integer Present only if ContactCount=true in the request false true
PageSize Integer The number of Contacts available in this page true true
HasNext String true or false Indicates more records are available (using method LookupNextPage).

If true: CloseLookup method is to be called after iteration If false: UCS automatically closes the list and there is no need to call CloseLookup method

true true
ContactData KVList false true


ContactData KVList

Key ValueType Value Description Mandatory Unique Default
(Contact Index) KVList false true

(Contact Index) is a string representation of an integer index used to maintain Contacts ordering

KVList value

Key ValueType Value Description Mandatory Unique Default
Id String Contact Id true true
Attributes KVList If AttributeList KVList is empty, all attributes are returned. Attribute "Id" is never delivered with this list, even if requested specifically in AttributeList. false true


KVList value

Key ValueType Value Description Mandatory Unique Default
(AttributeName) String The type depends on the Attribute:
  • TenantId(Integer), IsExternalResource(String true/false), CreatedDate(formatted String with Date pattern), ModifiedDate(formatted String with Date pattern), MergeId(String)
  • SortableContactAttributes(String, or formatted StringDate with Date pattern). When all attributes have been requested from the Contact table (input parameter AttributeList was null or empty), the (AttributeName) key is equal to StrAttributeXX or DateAttributeXX if the column is not currently associated to a sortable ContactAttribute as declared in ConfigServer.
  • Date values are returned as String with the pattern"yyyy-MM-ddTHH:mm:ss.SSSZ")
true true
(AttributeName) Integer The type depends on the Attribute:
  • TenantId(Integer), IsExternalResource(String true/false), CreatedDate(formatted String with Date pattern), ModifiedDate(formatted String with Date pattern), MergeId(String)
  • SortableContactAttributes(String, or formatted StringDate with Date pattern). When all attributes have been requested from the Contact table (input parameter AttributeList was null or empty), the (AttributeName) key is equal to StrAttributeXX or DateAttributeXX if the column is not currently associated to a sortable ContactAttribute as declared in ConfigServer.
  • Date values are returned as String with the pattern "yyyy-MM-ddTHH:mm:ss.SSSZ")
true true

(AttributeName) is the system name of the Attribute (as defined in Configuration Server.)

Sample

ScrollId 1234567890123456
PageSize 2
HasNext false
ContactData 0 Id 1234567890123456
Attributes EmailAddress john@rivers.com
PhoneNumber 1257566
1 Id ABCDEFJIOQJDLHDEC
Attributes EmailAddress john@cole.com
PhoneNumber 354535432

Error

FaultCode FaultString Description
201 Missing parameter 'SubscriberId' SubscriberId was not provided but is a required parameter.
533 Invalid ES Query Provided ESQuery is malformed
732 Invalid Tenant {0} Provided tenant is not configured in UCS
921 SubscriberId '{0}' is invalid or not active. The provided SubscriberId is not valid.

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on May 18, 2018, at 07:05.