Skip to content
Mark Chandler edited this page May 14, 2014 · 5 revisions

Table of Contents

Login

The login request is used to validate a members username and password. Invalid details will result in an error, valid details will result in the users session been created and their profile information returned to the application. Included in their profile information is all games and mods in their account, as well as all games and mods they have development access to.

Input

URL

 * http://api.desura.com/1/memberlogin
 * https://secure.desura.com/1/memberlogin

Post

 * username: Required, 20 chars max
 * password: Required, 4 chars min, 20 chars max (can be md5 hash, provided this value is 32chars long)

Process

 1. When the login API is called, the username and password will be validated according to the rules below:
   * Invalid data will result in a 107 (validation error) being thrown.
   * If the username and password fields are valid, the information will be matched in the database.
     * If the username exists but password is incorrect a 103 (invalid password) error will be thrown.
     * If the username cannot be found a 104 (invalid username) error will be thrown.
     * If the username exists but account isn't activated a 105 (account not active) error will be thrown.
     * If the username exists but account is banned a 106 (account banned) error will be thrown.
     * If the username exists but account is suspended a 109 (account suspended for creditcard chargeback) error will be thrown.
     * If more than 5 failed login attempts are made, a 108 (permission denied) error will be thrown. The user will need to wait 5 minutes before trying again.
   * Any other errors will result in a 100 (generic error) message being thrown.
 1. If a valid username / password is provided, the following cookies will be set:
   * freeman: login token
   * masterchief: session ID
 1. Also 0 (ok) will be returned along with the users profile information.

Output

0: Ok

<?xml version="1.0" encoding="utf-8"?> 
<memberlogin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
	<status code="0"/>
	<member siteareaid="1346">
		<admin>true</admin>
		<name>pizza</name>
		<nameid>pizza</nameid>
		<url>http://www.gamedev.com/members/pizza</url>
		<urledit>http://www.gamedev.com/members/edit/pizza</urledit>
		<email>scott@moddb.com</email>
		<firstname>Scott</firstname>
		<lastname>Reismanis</lastname>
		<timezone>UTC</timezone>
		<language>en</language>
		<country>AU</country>
		<age>1980-05-09</age>
		<gender>Male</gender>
		<datelastvisit>20081030125847</datelastvisit>
		<avatar>http://static.gamedev.com/borderless/images/default/error_50x50.png</avatar>
		<cookies>
			<id>1|2e78ed9e356ab1bfffbce73d279638cf|febed9c7e11fe84048c4e579290a1044</id>
			<session>67d8a06cdf5ce2043d948d204e85b496</session>
		</cookies>
		<messages>
			<cart>0</cart>
			<threadwatch>0</threadwatch>
			<updates>16</updates>
			<privatemessages>0</privatemessages>
		</messages>
		<tools>
			<tool siteareaid="1234">
				<name>DirectX 9.0c Runtime</name>
				<nameid>directx-9.0c</nameid>
				<icon>http://media.gamedev.com/images/2/1/1/109/icon1.gif</icon>
			</tool>
		</tools>
		<games>
			<game siteareaid="109">
				<name>Battlefield 2</name>
				<nameid>battlefield-2</nameid>
				<summary>Summary Goes Here</summary>
				<url>http://www.gamedev.com/games/battlefield-2</url>
				<urledit>http://www.gamedev.com/games/edit/battlefield-2</urledit>
				<urlpublish>http://www.gamedev.com/games/publish/battlefield-2</urlpublish>
				<homepage>http://www.dice.se/</homepage>
				<style>First Person Shooter</style>
				<theme>Western</theme>
				<type>Single &amp; Multiplayer</type>
				<indie>Commercial</indie> 
				<rating>0</rating>
				<icon>http://media.gamedev.com/images/2/1/1/109/logo1.gif</icon>
				<boxart>http://media.gamedev.com/images/2/1/1/109/icon1.gif</boxart>
				<branches />
                                <dlc>0</dlc>
				<downloadable>0</downloadable>
				<uploadable>0</uploadable>
				<developer sitearea="groups" siteareaid="1">
					<name>dice</name>
					<nameid>dice</nameid>
					<url>http://www.gamedev.com/groups/dice</url>
				</developer>
				<publisher sitearea="groups" siteareaid="1">
					<name>dice</name>
					<nameid>dice</nameid>
					<url>http://www.gamedev.com/groups/dice</url>
				</publisher>
				<engine siteareaid="1" />
				<mods></mods>
				<tools>
					<tool siteareaid="1234">
						<required />
						<global />
					<tool>
					<tool siteareaid="2345">
						<name>BattleField 2 SDK</name>
						<nameid>battlefield-2-sdk</nameid>
						<icon>http://media.gamedev.com/images/2/1/1/109/icon1.gif</icon>
					</tool>
				</tools>
			</game> 
			<game siteareaid="1">
				<name>Half-Life</name>
				<nameid>half-life</nameid>
				<summary>Summary goes here</summary>
				<url>http://www.gamedev.com/games/half-life</url>
				<urledit>http://www.gamedev.com/games/edit/half-life</urledit>
				<urlpublish>http://www.gamedev.com/games/publish/half-life</urlpublish>
				<homepage>http://www.valvesoftware.com/</homepage>
				<style>First Person Shooter</style>
				<theme>Fighter</theme>
				<type>Single &amp; Multiplayer</type>
				<indie>Commercial</indie> 
				<rating>0</rating>
				<icon>http://media.gamedev.com/images/2/1/1/109/logo1.gif</icon>
				<boxart>http://media.gamedev.com/images/2/1/1/109/icon1.gif</boxart>
				<branches />
                                <dlc>0</dlc>
				<downloadable>0</downloadable>
				<uploadable>0</uploadable>
				<developer sitearea="members" siteareaid="1">
					<name>INtense!</name>
					<nameid>intense</nameid>
					<url>http://www.gamedev.com/members/intense</url>
				</developer>
                                <publisher sitearea="members" siteareaid="1">
					<name>INtense!</name>
					<nameid>intense</nameid>
					<url>http://www.gamedev.com/members/intense</url>
				</publisher>
				<engine siteareaid="1" />
				<mods>
					<mod siteareaid="8518">
						<name>United Coalition</name>
						<nameid>united-coalition</nameid>
						<summary>Summary goes here</summary>
						<url>http://www.gamedev.com/mods/united-coalition</url>
						<urledit>http://www.gamedev.com/mods/edit/united-coalition</urledit>
						<urlpublish>http://www.gamedev.com/mods/publish/united-coalition</urlpublish>
						<homepage>http://www.united-coalition.com</homepage>
						<style>First Person Shooter</style>
						<theme>Western</theme>
						<type>Multiplayer</type>
						<indie>Indie</indie> 
						<rating>0</rating>
						<icon>http://media.gamedev.com/images/3/1/9/8518/icon.gif</icon>
						<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>
						<developer sitearea="groups" siteareaid="3">
							<name>DesuraNET</name>
							<nameid>desuranet</nameid>
							<url>http://www.gamedev.com/groups/desuranet</url>
						</developer>
						<publisher sitearea="groups" siteareaid="3">
							<name>DesuraNET</name>
							<nameid>desuranet</nameid>
							<url>http://www.gamedev.com/groups/desuranet</url>
						</publisher>
					</mod> 
					<mod siteareaid="3">
						<name>Sample Mod</name>
						<nameid>sample-mod</nameid>
						<summary>Summary goes here</summary>
						<url>http://www.gamedev.com/mods/sample-mod</url>
						<urledit>http://www.gamedev.com/mods/edit/sample-mod</urledit>
						<urlpublish>http://www.gamedev.com/mods/publish/sample-mod</urlpublish>
						<homepage>http://sample.moddb.com</homepage>
						<style>First Person Shooter</style>
						<theme>Western</theme>
						<type>Single Player</type>
						<indie>Indie</indie> 
						<rating>6</rating>
						<icon>http://media.gamedev.com/images/3/1/1/3/icon.gif</icon>
						<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>
						<uploadable>1</uploadable>
						<developer sitearea="groups" siteareaid="2">
							<name>DesuraNET</name>
							<nameid>desuranet</nameid>
							<url>http://www.gamedev.com/groups/desuranet</url>
						</developer>
						<publisher sitearea="groups" siteareaid="2">
							<name>DesuraNET</name>
							<nameid>desuranet</nameid>
							<url>http://www.gamedev.com/groups/desuranet</url>
						</publisher>
					</mod> 
				</mods>
			</game> 
		</games>
		<development>
			<games>
				<game siteareaid="1">
					<stub />
					<mods>
						<mod siteareaid="3">
							<name>Sample Mod</name>
							<nameid>sample-mod</nameid>
							<summary>Summary goes here</summary>
							<url>http://www.gamedev.com/mods/sample-mod</url>
							<urledit>http://www.gamedev.com/mods/edit/sample-mod</urledit>
							<urlpublish>http://www.gamedev.com/mods/publish/sample-mod</urlpublish>
							<homepage>http://sample.moddb.com</homepage>
							<style>First Person Shooter</style>
							<theme>Western</theme>
							<type>Single Player</type>
							<indie>Indie</indie> 
							<rating>6</rating>
							<icon>http://media.gamedev.com/images/3/1/1/3/icon.gif</icon>
							<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>0</preload>
                                                                        <onaccount>0</onaccount>
									<mcf id="84">
										<build>3</build>
										<version>4.07</version>
										<filesize>410143799</filesize>
										<installsize>820241115</installsize>
									</mcf>
								</branch>
							</branches>
							<developer sitearea="groups" siteareaid="2" />
                                                        <publisher sitearea="groups" siteareaid="2" />
						</mod> 
					</mods>
				</game> 
			</games>
		</development>
	</member>
	<news>
		<item id="1" cat="1">
			<title>Source Mods now available</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>
</memberlogin>

107: Validation Error

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

105: Account Not Active

<?xml version="1.0" encoding="utf-8"?> 
<memberlogin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="desura" version="1">
	<status code="105">You have not activated your account. Please follow the instructions in your welcome email to activate your account. If you have not received your activation email, please try registering again.</status>
</memberlogin>

103: Invalid Password

104: Invalid Username / Password

106: Account Banned

109: Account Suspended

100: Generic Error

As above, only with different status code and text.