API Incremental Updates

The WePlann API allows for increment updates. Updates are stored for a maximum of 5 days.


Example of retrieving incremental updates for products.


Step 1

To retrieve incremental updates store the last retrieved update and delete versions locally. Pass the last retrieved versions to the productversion API

GET http://developer.weplann.com/api/productversion?updateversion=100&deleteversion=88
<?xml version="1.0" encoding="UTF-8"?>
<VersionResponse xmlns="http://www.weplann.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <UpdateVersion>116</UpdateVersion>
   <DeleteVersion>117</DeleteVersion>
</VersionResponse>

Note: if there are no updates the returned value will be 0 indicating that you have the most current updates.


Step 2

If there are updates you can use your current version to retrieve modified records. To retreive updated records call the products API.

GET http://developer.weplann.com/api/products?version=100
<PagedResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.weplann.com">
	<CurrentPage>1</CurrentPage>
	<PageSize>100</PageSize>
	<TotalCount>3</TotalCount>
	<TotalPages>1</TotalPages>
	<HasPreviousPage>false</HasPreviousPage>
	<HasNextPage>false</HasNextPage>
	<Values>
		<Product Id="d8d9718f-8b18-44c4-a77f-2d372f3871da">
			<ProductTypeCode>scheduled</ProductTypeCode>
			<Name>NY - Matilda the Musical V2</Name>
			<CityCode>LGA</CityCode>
			<ImmediateBooking>true</ImmediateBooking>
			<HasAvailability>true</HasAvailability>
		</Product>
		<Product Id="44d53d22-1559-4a99-880b-a0cb38c7fc3f">
			<ProductTypeCode>scheduled</ProductTypeCode>
			<Name>NY - The Phantom of the Opera V2</Name>
			<CityCode>LGA</CityCode>
			<ImmediateBooking>true</ImmediateBooking>
			<HasAvailability>true</HasAvailability>
		</Product>
		<Product Id="aee8e272-6f73-4ff8-be10-2fd66d5a6c1f">
			<ProductTypeCode>timeless</ProductTypeCode>
			<Name>Tour Nocturno de Nueva York</Name>
			<CityCode>LGA</CityCode>
			<ImmediateBooking>true</ImmediateBooking>
			<HasAvailability>true</HasAvailability>
		</Product>
	</Values>
</PagedResponse>

Step 3

To retrieve the ids of records that have been deleted call the productsdeleted API.

GET http://developer.weplann.com/api/productsdeleted?version=88
<PagedResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.weplann.com">
	<CurrentPage>1</CurrentPage>
	<PageSize>500</PageSize>
	<TotalCount>2</TotalCount>
	<TotalPages>1</TotalPages>
	<HasPreviousPage>false</HasPreviousPage>
	<HasNextPage>false</HasNextPage>
	<Values>
		<string>80081d08-7229-4095-bf79-09e071c7cd2a</string>
		<string>4e3c7609-557a-4e9e-b542-dfabec05b99e</string>
	</Values>
</PagedResponse>

Step 4

Save the returned versions from the productversion API locally for the next synchronization.

Save updateversion 116
Save deleteversion 117