GetUserClientSites

  • Method
    SlimCD.Login.GetUserClientSite

    Purpose

    Gets specific sitename, businesstype, industrycode info for a username/password or clientid/siteid.

    Description
    Retrieves a list of clients and sites for the specified username/password, or a list of sites for the specified clientid, or the details on a specified clientid/siteid. The information returned shows details on the site’s setup.

    Business Rules

    Link to something

    Argument List

    Name Required Usage
    GetUserClientSitesRequest Required Object containing properties for the request
    timeout Optional Integer wait time, in seconds, before timeout response is generated
    callback* Optional Function to call upon completion of asynchronous request

    *for JavaScript only

    GetUserClientSites Request Fields

    Field Name Type Length Required Description
    Username string 20 require Username or API Access Credential that accesses web service.
    Password string 20 require Plaintext password for the client account.
    ClientID string 10 conditional Assigned by the Slim CD administrator.
    SiteID integer 10 optional Assigned by the Slim CD administrator.

    1. Passwords are required except when the username is set to an API Access Credential, in which case it should be passed in as an empty string.

    Reply Fields

    reply outer tag for the reply data block
    response Success, FAIL, Error
    response code 0, 1, 2 (respective) matching the above
    description If successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurred
    reponseurl The Slimcd.com url which was called for this operation
    datablock The confirmation text returned from the server.

    Reply Hierarchy

    • reply
      • response
      • responsecode
      • description
      • responseurl
      • datablock
        • SiteList
          • Site
            • ClientID
            • SiteID
            • PriceID
            • MerchantID
            • BusinessType
            • CreditRoute
            • CheckRoute
            • GiftRoute
            • CardTypes
            • CheckMask
            • ClientName
            • SiteName
            • DBA
            • Address
            • Address2
            • City
            • State
            • Zip
            • Country
            • Phone
            • Email

    Remarks

    • General
      1. Names in name/value pairs are NOT case-sensitive
      2. Names inside XML tags ARE case-sensitive
    • Function-Specific
      1. None
  • Include

    Method

    Request

    Reply

    Sample Code

    Downloads

    Download full sample source.


     

  • Include

    Method

    Request

    JSON Reply

    Sample Code

    Downloads
    Download full sample source.


  • Include

    Method

    Request

    Reply

    Sample Code

    Downloads
    Download full sample source.


  • Include

    Method

    Request

    Reply

    Sample Code

    Downloads

    Download full sample source.


  • Include

    Method

    Request

    Reply

    Sample Code


  • Method

    Request

    Reply

    Sample Code

    Downloads
    Download full sample source.


  • URL

    Protocols

        • SOAP/XML
        • HTTP POST
        • HTTP GET

    Request


    The sample above shows the name/value pairs that would be send with HTTP POST

    Status Codes

    Status Code Status Description Explanation
    200 200 OK Approved or declined attempts will return a response with an XML reply block
    500 500 Internal Server Error The response will not contain XML, as a server error has occurred.

    Reply Output is in XML format if a status code of 200 is returned.

    610 N University Drive

    610 N University Drive

    If the block’s tag does not indicate “Success”, the tag will contain an error description which can be displayed to the end-user

    Sample Code


    The sample above shows the use of an API Access Credential with a blank password, and specifies a long timeout for CloseBatch

    The sample above shows the clientid, siteid and password. BatchNumber is always blank.

    DOWNLOAD

    EXERCISER TOOL

    Remarks

    • Remarks Go here
  • URL

    Protocols

    • HTTP POST
    • HTTP GET

    This function accepts either name/value pairs or JSON

    Request

    Reply

    Sample Code


    The sample above shows the use of an API Access Credential with a blank password, and specifies a long timeout for CloseBatch

    The sample above shows the clientid, siteid and password. BatchNumber is always blank.

    The sample above shows the use jQuery cross-domain POST with jsonp, sends an API Access Credential with a blank password, and specifies a long timeout for CloseBatch. Note that the service can be specified on the URL or inside the request object as another json data item

    The sample above shows the use jQuery cross-domain POST with name/value pairs, sends an API Access Credential with a blank password, and specifies a long timeout for CloseBatch. Note that the service can be specified on the URL or inside the request object as another name/value pair
    $data = array(“username” => “1032”, “password” => “289075” ,
    “siteid” => “0”, “clientid” => “0” );

    $data_string = json_encode($data);

    $ch = curl_init(‘https://stats.slimcd.com/soft/json/jsonscript.asp?service=GetUserClientSite’);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // receive server response …
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    curl_setopt($ch, CURLOPT_HTTPHEADER,
    array(
    ‘Content-Type: application/json’,
    ‘Content-Length: ‘ . strlen($data_string)
    )
    );

    $server_output = curl_exec($ch);

    $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

    if ($http_status != 200 ||
    ($contentType <> ‘text/javascript’ && $contentType <> ‘application/json’)) {

    $reply = (object) array(‘response’=>’Error’, ‘responsecode’=>’2’,
    ‘description’ => $server_output ,
    ‘responseurl’ => curl_getinfo( $ch,
    CURLINFO_EFFECTIVE_URL) ,
    ‘datablock’ => ”);

    $result = (object) array(‘reply’ => $reply) ;
    }
    else {
    $result = json_decode($server_output);
    }
    echo $result->reply->response . ‘:’ . $result->reply->description;

    ?>

    Remarks

    1. None