Server Interface (XML-RPC) Documentation
Overview
The XML-RPC server is running at
http://www.myuid.com/api/xmlrpc.php. Your apps will also need
to redirect the user to http://www.myuid.com/api/checklogin.php
to get their login hash and id.
Files
checklogin.php
checklogin.php accepts a single GET parameter, called
return.
This should be given the URL of the page on your server that
needs the login information, probably the current page. It will
send back two GET variables to that URL, in, which will
be equal to “false” if the user is not logged in, or
else an integer value which is the users id, and code,
which is the users login hash, you will need this for future
functions.
xmlrpc.php
xmlrpc.php is a standard XML-RPC server. You can learn more
about XML-RPC at the XML-RPC
Homepage. The functions available on the MyUID server are
as follows:
-
loginVerify - This function is used to verify
that the user isn't spoofing the code and id you receieved
earlier. It takes four parameters, in the following order
they are:
- key string - Your API key, get one of these on
the MyUID homepage after you have logged in.
- user id int - The user ID you got
from checklogin.php.
- users ip string - The IP of the
user connecting to your application.
- user hash string - The hash you
received as code from checklogin.php.
On success, it will return a timestamp as to how long
until the user's login will expire. On failure, it will
return an error code (negative integers are errors).
-
checkTimes - A function to see if you are up to
date on the user's status at MyUID. Requires the
following parameters:
- key string - Your API key, get one of these on
the MyUID homepage after you have logged in.
- user id int - The ID of the user
you want to check up on.
Returns an array with the first value being the
timestamp of the last profile update, and the second
being the timestamp of when the login expires. The
first value of the array will be negative if there is an
error.
-
getProfile - This function retreives the public profile
for a given user. Parameters as follows:
- key string - Your API key, get one of these on
the MyUID homepage after you have logged in.
- user id int - The ID of the user
you want to check up on.
Returns a hash, where the key is the name of the field
in the profile. If there was an error, there will be a
field in the hash identified with a key of
“error” which will contain the error
code.
Error codes
Below is a table of all the error codes you may encounter,
and their meanings:
| Code |
Meaning |
| -5 |
Invalid request |
| -10 |
Invalid API Key |
| -25 |
Login has expired |
| -30 |
Invalid user authorization hash |
| -40 |
Invalid user id |
| -50 |
Unknown error |