December 2, 2008, Tuesday, 336

BTPWS-Login-Key-Registration

From DBWiki

Jump to: navigation, search

Acquiring a loginKey

A loginKey can be acquired by any registered Bitmunk user. The loginKey will be valid for 1 hour and only for the IP address that acquired it. Once a loginKey expires, a new one can be requested using the same method.

  • Note: Some services will fail for Bitmunk users that have not verified their identities (provided their legal name and address to Bitmunk).

To acquire a loginKey (or re-acquire one after it expires):

https://www.sandbox.bitmunk.com:9443/api/xml/secure/login

Your POST request should contain the following URL-encoded parameters:

  • username - The username for the Bitmunk user that is logging in.
  • password - The password for the Bitmunk user that is logging in.

The formatted POST request should look like this:

POST /api/xml/secure/login HTTP/1.1
Host: www.sandbox.bitmunk.com:9443
Content-Type: application/x-www-form-urlencoded
Content-Length: 40

username=myusername&password=mypassword

If the username and password are valid, the following XML will be returned to you:

<?xml version="1.0" encoding="UTF-8"?>
<xml_response version="1.0">
   <login_key version="1.0">9afd732c6</login_key>
</xml_response>

If the username and password are invalid, an exception will be returned to you like this:

<?xml version="1.0" encoding="UTF-8"?>
<xml_response version="1.0">
 <exception code="5">Cannot login, invalid username or password!</exception>
</xml_response>

The list of exception codes has not yet been finalized, so they are subject to change and no table is yet available describing them.