Skip to content

phonebook

ibox.phonebook in the library, ibox phonebook in the CLI.

On-device phone book.

all_contacts

all_contacts() -> str

Get all phonebook contacts

get_contact

get_contact(id: str) -> str

Get a phonebook contact by its unique ID.

add_contact

add_contact(contact: dict) -> str

Add a contact to the phonebook. Returns the contact's unique ID.

e.g.: contact = {"lastRevision": "0001-01-01T00:00:00Z", "name": "N:Hotline", "n": "N:Hotline;;;;", "formattedName": "Hotline", "birthDay": "0001-01-01T00:00:00Z", "title": "", "organisation": "", "url": "", "ringtone": "", "tags": "", "username": "", "vref": "", "etag": "", "syncedWithServer": "OutOfSync", "syncWithServer": False, "addresses": [], "labels": [], "telephoneNumbers": [ { "key": "1", "name": "0800800800", "type": "WORK", "preferred": False } ], "emails": [], "photos": [] }

modify_contact

modify_contact(id: str, contact: dict) -> str

Change a phonebook contact. Fields you leave out stay as they are.

e.g.: contact = {"name": "N:Hotline", "formattedName": "Hotline", "telephoneNumbers": [ { "name": "0800800800", "type": "WORK", "preferred": False } ]}

Parameters:

Name Type Description Default
id str

the contact's uniqueID, as listed by all_contacts().

required
contact dict

the fields to change, in the format of add_contact(). telephoneNumbers replaces all the contact's numbers.

required

Returns:

Name Type Description
str str

response content: status true, or false if no contact has this ID.

delete_contact

delete_contact(id: str) -> str

Delete a phonebook contact.

Parameters:

Name Type Description Default
id str

the contact's uniqueID, as listed by all_contacts().

required

Returns:

Name Type Description
str str

response content: status true, or false if no contact has this ID.