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

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

Delete Contact

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

Retrieve Contacts

Retrieving First 200 Contacts

Code Sample

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

Retrieving Next 200 Contacts

Code Sample

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

Querying Contacts by Name

Code Sample

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

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

Update Contact

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

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