Share via


search Request

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Represents a request method that searches for users.

Syntax

<search rid="string value">
   <firstName>string value</firstName>
   <lastName>string value</lastName>
   <displayName>string value</displayName>
   <emailAlias>string value</emailAlias>
   <function>and</function>
</search>

The following sections describe attributes, parent elements, and child elements.

Attributes

Attribute

Data Type

Description

rid

string

Represents the client-assigned instance ID for this request. This is a required attribute.

Element Information

Parent Element

Element

Description

cwaRequests

Contains one or more methods that a Unified Communications AJAX API Client sends to a Communicator Web Access Server.

Child Elements

Element

Occurrence

Description

function

0 or 1

Specifies how to conduct the query. The supported operations are bitwise AND ("and") and bitwise OR ("or") on the supplied query fields. The default value is "OR".

firstName

0 or more

Individual first name to search for.

lastName

0 or more

Individual last name to search for.

displayName

0 or more

Display name of the URI being searched for

emailAlias

0 or more

E-mail alias of the Uri being searched for.

Remarks

This element allows the Unified Communications AJAX API Client application to search for other Office Communicator users by their first, last and display name. If the emailAlias element is included, the search is based on the alias portion of a user e-mail address. It is important to note that this element does not search for SIP aliases or user aliases. Communicator Web Access Server returns a result set that might contain 0 to an unbounded number of users. For each of the returned users whose presence is requested, you have to make a queryPresence request to receive presence information for the user. If a partial displayName is sent as part of the request, all users whose display name contains that partial name starting in the first position is returned in the result set.

Examples

XML example of the search request

The user is searching for users whose first name is 'Jay' and last name is 'Allen'. Communicator Web Access Server returns all users that match the criteria. The function element of the search request specifies that both the firstName and lastName elements must match those of potential matches.

<search rid="24">
   <firstName>Jay</firstName>
   <lastName>Allen</lastName>
   <function>and</function>
</search>

XML example of a response to the search request

The requested user was not found. The searchResult attribute returned had a value of zero

<cwaEvents pollWaitTime="1000" ackId="38" sid="15">
   <requestSucceeded eid="37" rid="24" />
   <searchResult eid="38" rid="24" returned="0" moreAvailable="false" />
</cwaEvents>

XML example of a search request with a partial displayName field value

The user is searching for any user whose display name starts with "Josh".

<search rid="24">
   <firstName></firstName>
   <lastName></lastName>
   <emailAlias></emailAlias>
   <displayName>Josh</displayName>
</search>

XML example of the response to the the request

The person returned by the response has two SIP Uri's. The user exists as both "Joshua Pollock" and "Josh Pollock".

<cwaEvents pollWaitTime="1000" ackId="65" sid="334">
   <requestSucceeded eid="64" rid="24" />
   <searchResult eid="65" rid="24" returned="2" moreAvailable="true">
      <user uri="sip:JoshPollock@contoso.com" displayName="JoshP"
         title="" office="" phone="" homePhone="" cellPhone=""
         otherPhone=""
         company="" city="" state="" country="" email="" />
      <user uri="sip:JoshuaPollock@contoso.com" displayName="JoshuaP"
         title="" office="" phone="" homePhone="" cellPhone=""
         otherPhone="" company="" city="" state="" country="" email="" />
   </searchResult>
</cwaEvents>

See Also

Concepts

search Element