associate_set_contact ()

associate_set_contact ()

Function prototype

associate_set_contact (session , associate, [case])

API VersionALL

Modifies personal data of the ASSOCIATE of a CASE

This function is only permitted if:

  • The ASSOCIATE corresponds to the same session's user
  • OR the ASSOCIATE has never logged in the system(*) AND
    • The ASSOCIATE indicated is an associate of the session's user
    • The session user is a PROFESSIONAL
    • OR, if case<>null, the session user is an ASSOCIATE of case and has "edit" permission on the case's associates (see case_get_associate_permissions ())

(*) If an associated has done a login, then he is the only one that can modify his data. Otherwise it means that the ASSOCIATE was invited by an invitation, but it is still pending for confirmation. While the invited ASSOCIATE has not created an activated his account, it is allowed to modify contact data (to correct possible errors when creating the invitation)

Input

parameters:

  • session: is the token obtained in the session_init call
  • associate: is a associate contact XML object obtained from associate_get_contact () call. In addition, associate ref (<ref>) must be added in XML request.
    • ref - reference of associate
  • case: (optional) If provided, then the relationship information between the ASSOCIATE and the CASE will be stored. Otherwise relationship information will be ignored (if present in XML request)

Output

parameters:

  • result: empty
  • 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_set_contact ( “LCAAAAAAAAA”, "

   <contact>
	  <ref>12231</ref>
      <username>alex31234</username>
      <relationship>
         <type>
            <code>FAMILY</code>
         </type>
         <relative>
            <code>PARENT(M)</code>
         </relative>
      <relationship>
      <identifiers>
         <identifier>
            <label>STUDY_REF</label>
            <value>0001</value>
         </identifier>
         <identifier>
            <label>NAT_ES</label>
            <value>ALEX</value>
         </identifier>
         <identifier>
            <label>PASS</label>
            <value />
         </identifier>
         <identifier>
            <label>RES_ES</label>
            <value />
         </identifier>
         <identifier>
            <label>GOV_INS_ES_CAT</label>
            <value>DEV4</value>
         </identifier>
      </identifiers>
	  <data>
   		<bdate>1998-03-20</bdate>
      	<age>17</age>
      	<gender>F</gender>
      </data>
      <name>
         <prefix />
         <given_name>Maria rosa</given_name>
         <middle_name />
         <maiden_name />
         <family_name>Gosa</family_name>
         <family_name2>Imbern</family_name2>
         <subfix />
      </name>
      <addresses>
         <address>
            <kind>Main Address</kind>
            <street>Sepúlveda</street>
            <number>91</number>
            <floor>5º</floor>
            <suite>3ª</suite>
            <district />
            <city>Barcelona</city>
            <postcode />
            <state />
            <country>España</country>
            <comment />
         </address>
      </addresses>
      <channels>
         <phones>
            <phone>
			   <ref>1</ref>
               <type>mobile</type>
               <value>934546365</value>
               <comment />
               <preferred>true</preferred>
            </phone>
            <phone>
			   <ref>2</ref>
               <type>ext</type>
               <value>22</value>
               <comment />
               <preferred>false</preferred>
            </phone>
            <phone>
			   <ref>3</ref>
               <type>home</type>
               <value>936666666</value>
               <comment />
               <preferred>false</preferred>
            </phone>
            <phone>
			   <ref>4</ref>
               <type>work</type>
               <value>935555555</value>
               <comment />
               <preferred>false</preferred>
            </phone>
         </phones>
         <emails>
            <email>
			   <ref>5</ref>
               <type>work</type>
               <value>adsasda@LINKCARE.ES</value>
               <comment />
               <preferred>true</preferred>
            </email>
            <email>
			   <ref>6</ref>
               <type>home</type>
               <value>awasdasd@LINKCARE.ES</value>
               <comment />
               <preferred>false</preferred>
            </email>
         </emails>
         <aims>
            <aim>
			   <ref>7</ref>
               <type>Skype</type>
               <value>SKYPEUSER</value>
               <comment />
            </aim>
         </aims>
         <device>
		    <ref>8</ref>
            <type>bluetooth</type>
            <value>D898989</value>
            <comment />
         </device>
         <devices />
      </channels>
   </contact>

");

Response

sample:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<result/>

<ErrorMsg/>

<ErrorCode/>

Notes:




Related content