CATCH LOC Developers


Installation and Get started

Add Library (CatchLoc.php Download)

            Save the downloaded CatchLoc.php file to the desired path,
            Add require or include at the top of the php file you want to implement.

            require '/path/to/CatchLoc.php';

Creating Instance and initialization

            Inject API key and server key to SDK to initialize SDK instance.

            $catchloc = new CatchLoc();

            $catchloc->setApiKey("API KEY");
            $catchloc->setServerKey("SERVER KEY");


            $catchloc->setApiKey("API KEY")->setServerKey("SERVER KEY");


            $catchloc = new CatchLoc("API KEY", "SERVER KEY");

            After initialization, you can run SDK functions that call APIs.

Handle Result (Example)

            Converts json strings into arrays or objects and processes.

            $catchloc = new CatchLoc("API KEY", "SERVER KEY");

            $response = $catchloc->getLastData("member key");

            $resultMap = json_decode($response, true); //$resultMap = json_decode($response);

            1. Check the result value 'ok' in $resultMap
            2. Check the type in $resultMap (map or array)
            3. Processes the result value according to the type value

            $items = $resultMap['message']; //$items = $resultMap->message;

            - When type is array

            foreach ($items as $idx => $item)
                Handle $item...

            - When type is map, You can refer to API Response and process without necessarily looping.