Users Get Me

argument keys:

  • no arguments needed, pass and empty dictionary or array

returns: dictionary of user (the one that the API key belongs to) properties:

  • name: URL version of user name, for example "john-smith" for "John Smith"
  • title: full name of user, for example "John Smith"
  • id: ID number of user, for example "12345"

This users.get_me demo uses the sample code below. Create a separate file in your hosted site. Change the path to the and files. Replace the all caps USERNAME, APIKEY, and SITENAME to your information.

Sample Code

//set globals before includes
    $newdebuglevel = 0;    
//add includes
//change path to your server location
//set startup parameters for xmlrpc
//change path to your server location
    $GLOBALS ['xmlrpc_null_extension' ] = true;
    $ServerPath = "xml-rpc-api.php";
    $ServerHostName = "";
    $ServerPort = "";
//create a client for your site
    $Client = new xmlrpc_client($ServerPath,$ServerHostName,$ServerPort);
    $Client->setCredentials("USERNAME","API KEY");
    $Client->return_type = "phpvals"; //forces return of page.get_one as php values
    $SiteName = "SITENAME";
////////////test code
////////////code doesn't include error checking
//common example start
    $siteobj = new WikidotSite($SiteName, $Client);
    $returnarray = array();
    echo "<h3>users.get_me example</h3></br><hr>";
    foreach($returnarray as $key=>$data){
        echo $key.": ".$data."</br>";} 

Download Code File

Live demo

Uses above code in an Iframe from a PHP host.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License