Connecting to the Web API using PHP

Former Member
Former Member $organization

Hi Everyone,

Very basic stuff - but was wondering if anyone could give me a hand showing how they are connecting to the Web API and/or using some of the methods using PHP?

Thanks,
Caspian 

Parents
  • The cURL is what I use. You can read about it here.http://php.net/manual/en/book.curl.php

    Looks something like this (this gets a session key).

    <?php

    $session = curl_init();
    curl_setopt ($session, CURLOPT_URL, 'http://SOME_IP_ADDRESS/testapi/tessiturasimpletype.asmx/GetNewSessionKey?sIP=string');
    curl_setopt($session, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($session, CURLOPT_CONNECTTIMEOUT, 0);


    $response = curl_exec($session);

    if(curl_errno($session))
    {
        echo 'Curl error: Unable to obtain session ID ' . curl_error($session);
    }

    curl_close($session);

    ?>

    Travis



    [edited by: Travis Armbuster at 3:28 PM (GMT -6) on 12 Nov 2013]
  • Former Member
    Former Member $organization in reply to Travis Armbuster

    Thanks Travis! I've managed to connect and run a couple of methods using that.

    Cheers,

    Caspian

Reply Children