About Contacts

About Contacts

Contents

Introduction

The Python SDK allows you to retrieve contacts from the user’s address book. The following examples provide detailed steps that describe how to use supported methods and include code samples to help you get started with contacts.

Examples

Create Contacts

Code Sample

contact = Contact()
contact.firstname = 'ryan'
contact.tel = [
    {
        'type': 'other',
        'number': "5551234567",
        'indx' : 0,
        'preference' : 0,
    }
]
contact = cloud.create_contact(contact)

Delete Contact

Code Sample

# contact object retrieved from 'create_contact' or 'contacts' api call
cloud.delete_contact(contact)

Retrieve Contacts

Retrieve First 200 Contacts

Code Sample

contacts = cloud.contacts()

Retrieve Next 200 Contacts

Code Sample

contacts = cloud.contacts(page=2)

Query Contacts by Name

Code Sample

contacts = cloud.contacts(query='name:John')

Update Contact

Code Sample

# contact object retrieved from 'create_contact' or 'contacts' api call
contact.firstname = 'ryan_renamed'
contact = cloud.update_contact(contact)

NOTE: This SDK returns a maximum of 200 contacts in a successful response.

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.