associate_search ()

associate_search ()

Function prototype

associate_search (session, case, search_str , [max_res = 1000], [offset = 1])

API Version2.7.23 and higher


Returns a list of people matching the search criteria that can be used to add ASSOCIATE to a CASE

The search string will we used to find people in the system who:

  • The name/surname matches the search string
  • Have a communication channel (eMail, Phone) that matches the search string
  • Have any IDENTIFIER that matches the search string

Input

parameters:

  • session: is the session id obtained in the session_init() call
  • case: Reference to the CASE for whom we are searching associates. If not provided, the function assumes that the active session user is the CASE
  • search_str: is the text with we made the matching search in the list of cases.
  • max_res: It sets the maximum number of people to be returned by the function
  • offset: the base-one position of the first person to be returned

Output

parameters:

  • result: is an XML that contains the searched cases list
  • items: the total number of cases that could be returned. If items is higher than max-items item will still be the total number, while the “cases” tag will only include the max_res cases passed
  • offset: the base-one position of the first case returned
  • associates:
    • already_associated: (true/false) Indicates whether the person is already an associate of the CASE passed in the parameter case of the function call. If it is not already associated, you can call the API function case_insert_associate() to make this person an ASSOCIATE of the CASE
    • data: data of the person that can be added as ASSOCIATE
      • ref: reference that can be used in case_insert_associate() to add an ASSOCIATE to a CASE
      • nickname: Nickname of the ASSOCIATE
      • bdate: ASSOCIATE’s birth date
      • age: ASSOCIATE's age
      • gender: M for male F for female
  • ErrorMsg: any fault in the call, either in the validation of input parameters, errors in the connection to the database or any other error, this parameter returns the error message produced
  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request

sample:

associate_search ( “LCAAAAAAAAAAAA”, “joseph“, 100, 1);

Response

sample:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<result>
  <items>10</items>
  <offset>1</offset>
  <associates>
    <associate>
      <ref>92273</ref>
      <already_associated>false</already_associated>
      <data>
        <nickname>josephs</nickname>
        <bdate>1982-01-16</bdate>
        <age>40</age>
        <gender>M</gender>
      </data>
    </associate>
  </associates>
</result>
<ErrorMsg></ErrorMsg>
<ErrorCode></ErrorCode>

Notes:


Related content