Validate invite token API: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
Of course, if you invite a player to a game with their token, the [[Create game API]] will inform you that it's invalid. But you may wish to determine whether or not it's valid before attempting to create a game, such as when a new player signs up on your site. | Of course, if you invite a player to a game with their token, the [[Create game API]] will inform you that it's invalid. But you may wish to determine whether or not it's valid before attempting to create a game, such as when a new player signs up on your site. | ||
You can do this by calling the following API: http://warlight.net/API/ValidateInviteToken | You can do this by calling the following API: http://warlight.net/API/ValidateInviteToken?Token=12345678 | ||
To call this programmatically, you can POST your e-mail address and API token to this page in the format Email=your@email.com&APIToken=yourapitoken You can get your API token from the [[Get API Token API]]. | To call this programmatically, you can POST your e-mail address and API token to this page in the format Email=your@email.com&APIToken=yourapitoken You can get your API token from the [[Get API Token API]]. |
Revision as of 06:49, 1 May 2013
If you're creating a system that invites players to WarLight games via the Create game API, you may wish to validate whether or not an invite token or e-mail address is valid before you attempt to invite them to a game.
Of course, if you invite a player to a game with their token, the Create game API will inform you that it's invalid. But you may wish to determine whether or not it's valid before attempting to create a game, such as when a new player signs up on your site.
You can do this by calling the following API: http://warlight.net/API/ValidateInviteToken?Token=12345678
To call this programmatically, you can POST your e-mail address and API token to this page in the format Email=your@email.com&APIToken=yourapitoken You can get your API token from the Get API Token API.
This will return the following fields about the player whose token you provided:
- tokenIsValid: This simply tells you that the token does belong to a WarLight player.
- name: The player's WarLight nickname.
- isMember: True if the player has purchased a WarLight membership.
- color: The player's preferred WarLight color.
- tagLine: The tagline the player has set up to display on their profile page.