Difference between revisions of "API: Handle verification"

From Star Wars Combine :: Game Guide
Jump to: navigation, search
(Created page with '== 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)
 
(5 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.
Line 23: Line 23:
 
If you pass an invalid handle
 
If you pass an invalid handle
  
  http://www.swcombine.com:8081/ws/v1.0/handle/iMadeThisUp
+
  http://www.swcombine.com/ws/v1.0/handle/iMadeThisUp
  
 
the response will be an error message accompanied by a 404 HTTP result code:
 
the response will be an error message accompanied by a 404 HTTP result code:
Line 33: Line 33:
  
  
If the handle is actually valid
+
If the handle is actually valid ''and'' properly encoded
  
  http://www.swcombine.com:8081/ws/v1.0/handle/olwin%2Bfroon
+
  http://www.swcombine.com/ws/v1.0/handle/olwin%2Bfroon
  
 
you'll see something like this:
 
you'll see something like this:
Line 49: Line 49:
 
The response provides the character's UID (a unique entity identifier) as well as the handle itself in proper upper/lower case writing.
 
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 proper place.
+
For anything else you want to do with that character, you need their UID, so make sure you store it in a suitable place.

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.