user_validate ()
user_validate ()
Function prototype | user_validate ( session, user, mode, team) |
---|---|
API Version | All |
Validate data of a user before create or update If mode = new and there is already existent user in database function will return it's id. | |
Input parameters: |
|
Output parameters: |
|
Request sample: | user_validate ( “LCAAAAAAAAA”, <user> <ref /> <name> <given_name /> <middle_name /> <family_name /> <family_name2 /> </name> <identifiers> <identifier> <label>NICKNAME</label> <value>pat001</value> </identifier> <identifier> <label>NAT_ES</label> <value /> </identifier> <identifier> <label>PASS</label> <value /> </identifier> </identifiers> <data> <age /> <gender /> <nationality_ref></nationality_ref> <status /> <preferences> <password_expire /> </preferences> </data> <channels> <emails> <email> <ref /> <type>work</type> <value /> <comment /> <preferred>true</preferred> </email> </emails> <aims /> <devices /> <phones> <phone> <ref /> <type>home</type> <value /> <comment /> <preferred>true</preferred> </phone> <phone> <ref /> <type>work</type> <value /> <comment /> <preferred /> </phone> </phones> </channels> </user> “, 'new', 1); |
Response sample: | <?xml version="1.0" encoding="utf-8" standalone="yes"?> <result> <user_validate> <validation> <errors> <field> <id>STUDY_REF</id> <name>Birthdate</name> <error>CONTACT_FIELD.CANT_BE_NULL</error> <description>can't be null</description> </field> </errors> <conflicts> <conflict> <name>Mary Doe</name> <gender>Female</gender> <birthdate>1968-03-12</birthdate> <age>52</age> <fields> <field> <id>CHANNEL.EMAIL</id> <name>e-mail</name> <value>marydoe@linkcare.es</value> </field> </fields> </conflict> </conflicts> </validation> </user_validate> </result> <ErrorMsg></ErrorMsg> |
Return Error codes
ERROR CODE | |
---|---|
INVALID_TOKEN | The session token provided is not valid |
INSUFFICIENT_PRIVILEGES | The session user does not have the necessary privileges to execute this action |
USER.NOT_FOUND | The USER reference provided in XML data does not correspond to an existing USER |
TEAM.NOT_FOUND | The TEAM reference provided does not correspond to a valid TEAM |
PROGRAM.NOT_FOUND | The PROGRAM reference provided does not correspond to a valid PROGRAM |
CONTACT_DATA.VALIDATION | The information provided to validate the CASE is not valid |
, multiple selections available,