About Contacts

About Contacts

Contents

 

 

Introduction

You can use the contacts method to download all contacts stored in the user’s Personal Cloud Storage account.

Examples

Create Contacts

Code Sample

cloud.createContact({
    firstname: 'ryan',
    tel: [{
        type: 'other',
        number: "5551234567",
        indx : 0,
        preference : 0	
    }],
    success: function(success) {
        var createdContact = success.body;
    }
});

Delete Contacts

Code Sample

cloud.deleteContact({
    id: '324b4f1f015a1000a30eff6dbea449b8',
    success: function(success) {
        //contact was deleted
    }
});

Retrieve Contacts

Retrieving First 200 Contacts

Code Sample

cloud.contacts({
    success: function(success) {
        var contacts = success.body.contactsResponse.account.addrbook.contacts.contact;
    }
});

Retrieving Next 200 Contacts

Code Sample

cloud.contacts({
    page: 2,
    success: function(success) {
        var contacts = success.body.contactsResponse.account.addrbook.contacts.contact;
    }
});

Querying Contacts by Name

Code Sample

cloud.contacts({
    query: 'name:John',
    success: function(success) {
        var contacts = success.body.contactsResponse.account.addrbook.contacts.contact;
    }
});

Update Contacts

cloud.updateContact({
    id: '324b4f1f015a1000a30eff6dbea449b8',
    version: 1,
    firstname: 'mike',
    success: function(success) {
        var updatedContact = success.body;
    }
});

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

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