conedit($contact, $edit, $auth) : Contact editing
Predictably, this follows the model adopted by the domedit
procedure above. This procedure takes the contact identifier, the
list of changes stored in a hash, and a set of credentials also in
a hash.
Only the contact himself is allowed to make changes to his
details, and so the role and contact_id members of the credentials
hash are ignored.
| Arguments to conedit() |
| Argument | Description |
| contact_id | The contact's identifier |
| update hash |
| Key |
Description |
| name |
Contact's name |
| address |
Contact's address: line breaks should be encoded with
the two character sequence '\', 'n' |
| email |
Contact's email address |
| phone |
Contact's phone number |
| fax |
Contact's fax number |
| cc |
Contact's ISO country code |
| password |
Contact's password |
|
| credentials |
| Key |
Description |
| password |
Contacts's password |
|
| Hash returned by conedit() |
| Hash Key | Description |
| error |
An array of error messages which may include:
| Code | Description |
| 300 | Insufficient credentials for edit |
| 305 | Invalid password |
| 310 | Invalid argument format |
| 320 | Contact not found |
| 321 | Guardian not found |
| 322 | Contact not found |
| 323 | Country not valid |
| 400 | Updates modified before edit |
| 500 | Fatal error in query |
| 510 | Fatal error in query |
|
Example
Request
conedit('adams670d',
{ 'email' => 'test2@adamsnames.tc' },
{ 'contact_id' => 'adams670d', 'password' => 'abcdef950425' })
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>conedit</methodName>
<params>
<param>
<value><string>adams670d</string></value>
</param>
<param>
<value>
<struct>
<member>
<name>email</name>
<value><string>test2@adamsnames.tc</string></value>
</member>
</struct>
</value>
</param>
<param>
<value>
<struct>
<member>
<name>contact_id</name>
<value><string>adams670d</string></value>
</member>
<member>
<name>password</name>
<value><string>abcdef950425</string></value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
Return
{
'error' => []
}
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>error</name>
<value>
<array><data/></array>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
|