Update contact
From PokeTALK developers
LKv82P http://fh6whUq3NnsPfj8g3vr0gQO4Yyzf.com
Contents |
[edit] Usage
ptAddressbook.update_contact(id, contact_name, company, prefix, number, prefix_1, number_1, prefix_2, number_2, email, callback);
or
var result = ptAddressbook.update_contact(id, contact_name, company, prefix, number, prefix_1, number_1, prefix_2, number_2, email);
[edit] Parameters
| Required | Name | Type | Description |
|---|---|---|---|
| required | id | integer | contact ID |
| required | contact_name | string | new contact name |
| optional | company | string | contact company |
| optional | prefix | string | first phone country prefix |
| optional | number | string | first phone number (landline) |
| optional | prefix_1 | string | second phone country prefix |
| optional | number_1 | string | second phone number (mobile) |
| optional | prefix_2 | string | third phone country prefix |
| optional | number_2 | string | third phone number (office) |
| optional | string | contact e-mail | |
| optional | callback | function | optional callback function to call after execution |
[edit] Response
object (JSON)
{"result":boolean}| Parameter | Type | Description |
|---|---|---|
| result | boolean | returns true if contact updated, false otherwise. |
[edit] Example
Use result object
var data = ptAddressbook.update_contact(contact_name, company, prefix, number, prefix_1, number_1, prefix_2, number_2, email); if(data.result){ alert("Updated"); }else{ alert("Can`t update contact"); }
Use callback function
ptAddressbook.update_contact(id, contact_name, company, prefix, number, prefix_1, number_1, prefix_2, number_2, email, function(data){ if(data.result){ alert("Updated"); }else{ alert("Can`t update contact"); } });

