Skip to content

Instantly share code, notes, and snippets.

@AntonNguyen
Created December 4, 2013 22:27
Show Gist options
  • Save AntonNguyen/7796752 to your computer and use it in GitHub Desktop.
Save AntonNguyen/7796752 to your computer and use it in GitHub Desktop.

Suppose we have the following contacts with the following ids: 1, 2, 3

This call would delete contacts 2 and 3

<request method="client.update">
	<client>
		<client_id>1</client_id>
		<contacts>
			<contact>
				<contact_id>1</contact_id>
			</contact>
		</contacts>
	</client>
</request>

This call would delete contact 1

<request method="client.update">
	<client>
		<client_id>1</client_id>
		<contacts>
			<contact>
				<contact_id>2</contact_id>
			</contact>
			<contact>
				<contact_id>3</contact_id>
			</contact>
		</contacts>
	</client>
</request>

This call would delete contact 1, but create a new one as well

<request method="client.update">
	<client>
		<client_id>1</client_id>
		<contacts>
			<contact>
				<contact_id>2</contact_id>
			</contact>
			<contact>
				<contact_id>3</contact_id>
			</contact>
			<contact>
				<first_name>Chris</first_name>
				<last_name>Richard</last_name>
			</contact>
		</contacts>
	</client>
</request>

This call would delete ALL contacts, but create two new ones

<request method="client.update">
	<client>
		<client_id>1</client_id>
		<contacts>
			<contact>
				<first_name>Chris</first_name>
				<last_name>Richard</last_name>
			</contact>
			<contact>
				<first_name>Nox</first_name>
				<last_name>Dineen</last_name>
			</contact>
		</contacts>
	</client>
</request>

This call would delete all contacts

<request method="client.update">
	<client>
		<client_id>1</client_id>
		<contacts/>
	</client>
</request>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment