Skip to content
Mark Chandler edited this page May 15, 2014 · 1 revision

Table of Contents

Application Upload

This is used to upload a Desura update file (mcf)

Input

URL

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

Post

 * appid: Not Required, Integer. This is app id that is being uploaded. Defaults to internal alpha (See: [wiki:GeneralAppVersion version])
 * changelog: Required, Text. This is the change log info
 * mcf: Required, File. The Desura MCF
 * type: Not Required, Integer. Default is 0x08
 * svnrevision: Required, Integer. SVN revision for the build
 * username: Not Required, String. Username of a Desura account
 * password: Not Required, String. Password (or password hash) for that account
   * OR
 * token: Not Required, String. Security Token (contact Scott for it)

Process

 1. If the username '''AND''' password is provided attempt to login the user
 1. When wanting to upload a Desura build this api is called
   * Only users with application admin writing permission can access this API, otherwise a 108 (permission error) being thrown.
   * Invalid data will result in a 107 (validation error) being thrown.
   * Any other errors will result in a 100 (generic error) message being thrown.
 1. The XML from the MCF uploaded will be extracted and saved in the DB
 1. The MCF file header will be updated with the build number and other data provided
 1. If valid data is provided, 0 (ok) will be returned

Output

0: Ok

<?xml version="1.0" encoding="utf-8"?> 
<appupload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
	<status code="0"/>
	<mcf id="7" build="3" appid="500"/>
</appupload>

107: Validation Error

<?xml version="1.0" encoding="utf-8"?> 
<appupload 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 changelog field is required.
		You did not select a mcf file to upload.
	</status>
	<validation>
		<fields>
			<changelog>The changelog field is required.</changelog>
			<mcf>You did not select a mcf file to upload.</mcf>
		</fields>
	</validation> 
</appupload>

108: Permission Error

<?xml version="1.0" encoding="utf-8"?> 
<appupload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
	<status code="108">We&#39;re sorry but you do not have permission to view the app content requested.</status>
</appupload>

100: Generic Error

As above, only with different status code and text.

Method

An implementation of this can be found in the svn: svn://lodle.dyndns.org/modcore/source/php_gcupload