Difference between revisions of "API: Handle verification"

From Star Wars Combine :: Game Guide
Jump to: navigation, search
m (Handle check resource)
(Handle check resource)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<< [[API: Getting started]]
 +
 
== API: Handle verification ==
 
== API: Handle verification ==
  
 
Whatever your application does, it probably allows for SWC players to sign up.
 
Whatever your application does, it probably allows for SWC players to sign up.
  
You might want to know if a handle actually exists in SWC.  
+
You might want to know if a handle actually exists in SWC.
 
 
 
 
  
 
== Handle check resource ==
 
== Handle check resource ==
Line 16: Line 16:
 
Note, that  
 
Note, that  
  
a) you need to URL-encode it twice and
+
a) you need to URL-encode it and
  
 
b) upper/lower case doesn't matter.
 
b) upper/lower case doesn't matter.

Latest revision as of 01:18, 18 September 2017

<< API: Getting started

API: Handle verification

Whatever your application does, it probably allows for SWC players to sign up.

You might want to know if a handle actually exists in SWC.

Handle check resource

The character handle you wish to verify needs to be passed via URL.

/handle/[characterHandle]

Note, that

a) you need to URL-encode it and

b) upper/lower case doesn't matter.


If you pass an invalid handle

http://www.swcombine.com/ws/v1.0/handle/iMadeThisUp

the response will be an error message accompanied by a 404 HTTP result code:

<error>Not Found</error>


If the handle is actually valid and properly encoded

http://www.swcombine.com/ws/v1.0/handle/olwin%2Bfroon

you'll see something like this:

<?xml version="1.0" encoding="UTF-8"?>
<handlecheck xmlns="[...]" version="1.0" timestamp-swc="[swcTime]">
  <uid>1:1190612</uid>
  <handle>Olwin Froon</handle>
</handlecheck>

The response provides the character's UID (a unique entity identifier) as well as the handle itself in proper upper/lower case writing.

For anything else you want to do with that character, you need their UID, so make sure you store it in a suitable place.