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

Table of Contents

Download URL

This is used to get download url's for an item. The urls should be ordered from most important to least important. I.e. put closer mirrors with less load first.

Input

URL

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

Post

 * sitearea: Required, must be a valid [wiki:GeneralSitearea sitearea] (supported: games, mods)
 * siteareaid: Required, Integer
 * branch: Required, Integer
 * build: Not Required, Integer
 * local: Not Required, (any val).

Process

 1. When wanting the download urls for an item this api is called
   * Invalid data will result in a 107 (validation error) being thrown.
   * If the game / mod is for sale and the person has not brought the "branch" a 112 (purchase error) will be thrown.
   * Permission denied to download this file will result in a 108 (permission error) being thrown.
   * If the item can not be found it will result in a 110 (item not found) being thrown.
   * If no download mirrors are available a 111 (no mirrors) error will being thrown.
   * If the item is for sale and the person hasn't purchased it a 112 (purchase req) error will be thrown.
   * If the item is not available in the users region a 113 (region) error will be thrown.
   * If the item is invite only and the user doesn't have an invite a 114 (invite only) error will be thrown.
   * If the request is valid but the download isn't yet available (i.e. releasing on X date) a 116 (not yet available) error will be thrown.
   * Any other errors will result in a 100 (generic error) message being thrown.
 1. If a valid sitearea / siteareaid is provided, 0 (ok) will be returned along with the item information.
 1. If a valid sitearea / siteareaid is provided but that item is an un-authed item (and the user is allowed access) the unauthed tag will be added
 1. If local post var provided it will convert the url from mcf://www.desura.com:62001/* to mcf://server:62001/*
 1. All mcf urls will start with mcf:// and include port numbers

Output

0: Ok

<?xml version="1.0" encoding="utf-8"?> 
<itemdownloadurl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
 	<status code="0"/>
	<item sitearea="mods" siteareaid="3">
		<name>Sample Mod</name>
		<mcf build="1" id="13" branch="7">
			<urls>
				<url>
					<link>mcf://mcf.gamedev.com:62001</link>
					<provider>desura.com</provider>
					<banner>http://www.desura.com/banner.png</banner>
					<provlink>http://www.desura.com</provlink>
				</url>
			</urls>
			<version>1.0</version>
			<installsize>1024</installsize>
			<filesize>1024</filesize>
			<filehash>##############</filehash>
			<authhash>##############</authhash>
			<authed>1</authed>
		</mcf>
	</item>
</itemdownloadurl>

0: Ok with local

<?xml version="1.0" encoding="utf-8"?> 
<itemdownloadurl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
 	<status code="0"/>
	<item sitearea="mods" siteareaid="3">
		<name>Sample Mod</name>
		<mcf build="1" id="13" branch="7">
			<urls>
				<url>
					<link>mcf://server:62001</link>
					<provider>desura.com</provider>
					<banner>http://www.desura.com/banner.png</banner>
					<provlink>http://www.desura.com</provlink>
				</url>
			</urls>
			<version>1.0</version>
			<installsize>1024</installsize>
			<filesize>1024</filesize>
			<filehash>##############</filehash>
			<authhash>##############</authhash>
			<authed>1</authed>
		</mcf>
	</item>
</itemdownloadurl>

0: Ok with un-authed tag

<?xml version="1.0" encoding="utf-8"?> 
<itemdownloadurl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
 	<status code="0"/>
	<item sitearea="mods" siteareaid="3">
		<name>Sample Mod</name>
		<mcf build="1" id="13" branch="7">
			<urls>
				<url>
					<link>mcf://mcf.gamedev.com:62001</link>
					<provider>desura.com</provider>
					<banner>http://www.desura.com/banner.png</banner>
					<provlink>http://www.desura.com</provlink>
				</url>
			</urls>
			<version>1.0</version>
			<installsize>1024</installsize>
			<filesize>1024</filesize>
			<filehash>##############</filehash>
			<authhash>##############</authhash>
			<authed>0</authed>
		</mcf>
	</item>
</itemdownloadurl>

107: Validation Error

<?xml version="1.0" encoding="utf-8"?> 
<itemdownloadurl 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 siteareaid field is required. The sitearea field is required.</status>
	<validation>
		<fields>
			<sitearea>The sitearea field is required.</sitearea>
			<siteareaid>The siteareaid field is required.</siteareaid>
		</fields>
	</validation> 
</itemdownloadurl>

100: Generic Error

108: Permission Denied

110: Item Not Found

111: No Mirrors

112: Purchase Required

113: Not available in your Region

114: Invite Only

116: Not yet released

As above, only with different status code and text.