Getting Started

To use the LandGrab Devloper API you must have a developer token. This token is a randomly-generated string, unique to each developer or client system that wishes to use the API. To request a developer token, send an email to desau@landgrab.net. In the email, state your LandGrab user account name and purpose for the token (a short description of your project will suffice). Once you have received your developer token, you can connect to LandGrab's API.

Initiating a Session

The first communication you need to do is send your developer token to the LandGrab server. This is done by calling the AuthService.initiateSession() method, passing your developer token in the developerToken argument. If the token is valid, you will be given a session key. This session key is a randomly-generated 32 character string which must be used in all subsequent method calls. This is usually the first argument of a method call. The default timeout of a session is 2 hours. If you do not use the session key within 2 hours, you'll need to call initiateSession again.

Service URLs

All LandGrab web service URLs have the same prefix:
http://landgrab.net/landgrab/services/
For example, the AuthService is:
http://landgrab.net/landgrab/services/AuthService

User Authentication

Initiating a session using the AuthService.initiateSession() method will allow you to make queries that do not require elevated privileges. For example, you can obtain all public messages for a given game (since these are available "anonymously" through the web UI). However, to retrieve the private messages for a given user, you must authenticate the user, using the login and password of the specified user.

To authenticate a user, use the AuthService.authenticateUser() method. After you have successfully authenticated a user, all subsequent calls that can use elevated privileges will use the authenticated user. You can change users by calling the AuthService.authenticateUser() method again. To see which user you currently have authenticated, you can use the AuthService.getAuthenticatedUserName() method.