Difference between revisions of "Generate New Token"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "Category:API '''Implementation Status:''' Implemented<br/> '''URI:''' https://api.kag2d.com/player/$PLAYER/token/new<br/> '''HTTP ...")
 
m
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:API]]
 
[[Category:API]]
  
'''Implementation Status:''' [[Implemented(API Implementation Status)|Implemented]]<br/>
+
'''Implementation Status:''' [[API_Implementation_Statuses#Implemented|Implemented]]<br/>
 
'''URI:''' https://api.kag2d.com/player/$PLAYER/token/new<br/>
 
'''URI:''' https://api.kag2d.com/player/$PLAYER/token/new<br/>
 
'''HTTP Verbs Supported:''' GET<br/>
 
'''HTTP Verbs Supported:''' GET<br/>
Line 8: Line 8:
  
 
== Successful Response ==
 
== Successful Response ==
With a proper request (authentication, etc), a response will look like:
+
'''Request:''' GET /player/FliesLikeABrick/token/new<br />
 +
'''Other:''' Authentication provided
 
  {"playerToken": "89653198-5d06-4a74-a8b1-2c41fa234df8FliesLikeABrick7a6b066760c6bff022e409ee014443745fb5b70cbad06ebe27070f8d909895d1636d7b6822b4757291416f68cbc1f5a385fed0b8e07b38b530ce437cd24fc91c"}
 
  {"playerToken": "89653198-5d06-4a74-a8b1-2c41fa234df8FliesLikeABrick7a6b066760c6bff022e409ee014443745fb5b70cbad06ebe27070f8d909895d1636d7b6822b4757291416f68cbc1f5a385fed0b8e07b38b530ce437cd24fc91c"}
  
Line 18: 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 ==
 +
* [[Validate Token]]
 +
* [[Authentication Token]]

Latest revision as of 17:58, 5 August 2013


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