Difference between revisions of "Generate New Token"

From King Arthur's Gold Wiki
Jump to: navigation, search
m
Line 19: Line 19:
  
 
'''Account not active'''
 
'''Account not active'''
  {"message": "Access Denied: Account is not active"}
+
  {"statusMessage": "Access Denied: Account is not active"}
  
 
'''Requesting a token for another user'''
 
'''Requesting a token for another user'''
  {"message": "Access Denied: You are not authorized to request a token for this user"}
+
  {"statusMessage": "Access Denied: You are not authorized to request a token for this user"}
  
 
'''Account has a global ban issued'''
 
'''Account has a global ban issued'''
  {"message": "Access Denied: Account suspended with global ban"}
+
  {"statusMessage": "Access Denied: Account suspended with global ban"}
  
 
== See Also ==
 
== See Also ==
 
* [[Validate Token]]
 
* [[Validate Token]]

Revision as of 15:41, 30 March 2012


Implementation Status: Implemented
URI: https://api.kag2d.com/player/$PLAYER/token/new
HTTP Verbs Supported: GET
Response Type: JSON dictionary
HTTP Auth Required: Yes

Successful Response

Request: GET /player/FliesLikeABrick/token/new
Other: Authentication provided

{"playerToken": "89653198-5d06-4a74-a8b1-2c41fa234df8FliesLikeABrick7a6b066760c6bff022e409ee014443745fb5b70cbad06ebe27070f8d909895d1636d7b6822b4757291416f68cbc1f5a385fed0b8e07b38b530ce437cd24fc91c"}

where playerToken is the token. There may be additional keys sent in the future, so plan accordingly in consumer code.

Error Conditions

These are examples of how errors are fed back to the HTTP client. This is not an exhaustive list, new error conditions/validation may be added at any point. If you need to hardcode against a certain indicator of an error condition, use the HTTP response code (e.g. 403)


Account not active

{"statusMessage": "Access Denied: Account is not active"}

Requesting a token for another user

{"statusMessage": "Access Denied: You are not authorized to request a token for this user"}

Account has a global ban issued

{"statusMessage": "Access Denied: Account suspended with global ban"}

See Also