Skip to content
Lodle edited this page May 13, 2014 · 4 revisions

Table of Contents

Update Polling

This is used to get the new version numbers of items that have been updated and session cookies

Input

URL

 * http://api.desura.com/1/updatepoll

Post

 * appid: Required, integer. The current appid (i.e. 100 for public release)
 * build: Required, integer. The current build of the application
 * updates[ sitearea ][ siteareaid ] : Optional, nullvalue. List of items on the computer but not on user account to get updates for
 * accolades[ sitearea ][ siteareaid ] : Optional, data format: accoladeid:value:updatetime. List of accolades to update
 * stats[ sitearea ][ siteareaid ] : Optional, data format: statid:value:updatetime. List of stats to update

Process

 1. When wanting to check for updates this api is called
   * Invalid data will result in a 107 (validation error) being thrown.
   * If the user cannot be logged in, a 104 (account not found error)  will be thrown.
   * If the item can not be found it will be skipped and ignored
   * Any other errors will result in a 100 (generic error) message being thrown.
 1. If valid information, 0 (ok) will be returned along with the item information of items that have been updated.

Output

0: Ok

<?xml version="1.0" encoding="utf-8"?> 
<updatepoll xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
	<status id="0" />
	<cookies>
		<session>67d8a06cdf5ce2043d948d204e85b496</session>
	</cookies>
	<messages>
		<cart>0</cart>
		<threadwatch>0</threadwatch>
		<updates>0</updates>
		<privatemessages>0</privatemessages>
	</messages>
	<app id="500">255</app>
	<items>
		<mods>
			<mod siteareaid="8">
				<branches>
					<branch id="17">
						<name>Default</name>
						<nameon>0</nameon>
						<free>1</free>
						<price></price>
						<demo>0</demo>
                                                <test>0</test>
                                                <eula date="1286283967">http://www.gamedev.com/mods/sven-co-op/eula/37</eula>
						<inviteonly>0</inviteonly>
						<regionlock>0</regionlock>
                                                <preload>20120716062301</preload>
						<onaccount>0</onaccount>
						<mcf id="84">
							<build>3</build>
							<version>4.07</version>
							<filesize>410143799</filesize>
							<installsize>820241115</installsize>
						</mcf>
					</branch>
				</branches>
			</mod>
		</mods>
		<games />
	</items>
	<news>
		<item id="1" cat="1">
			<title>Source Mods now on Desura</title>
			<url>http://www.desura.com/news/source-mods</url>
		</item>
	</news>
	<gifts>
		<gift id="1">
			<title>Sven Co-op Special Edition</title>
			<url>https://secure.desura.com/cart/gift/view/84cc3277cb6d073fc7a93356cd3a8816</url>
		</gift>
	</gifts>
</updatepoll>

107: Validation Error

<?xml version="1.0" encoding="utf-8"?> 
<updatepoll xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
	<status code="107">
	The appid field is required.
	</status>
	<validation>
		<fields>
			<appid>The appidfield is required.</appid>			
		</fields>
	</validation>
</updatepoll>

100: Generic Error

As above, only with different status code and text.

Notes

Only the items that have been updated should be returned.