2013-07-18 22:26:53 +00:00
|
|
|
<?php
|
|
|
|
// api.test.php - Example usage of the API, to be replaced with API front end
|
|
|
|
// At the moment, the API has two features: Create a short link, and Delete a short link
|
|
|
|
|
|
|
|
require('api.backend.php');
|
|
|
|
require('dbsettings.php');
|
|
|
|
|
|
|
|
$unpsAPI = new api();
|
|
|
|
|
2013-07-27 03:54:27 +00:00
|
|
|
//echo $unpsAPI->shorten($apidb, '580658027', $shortdb, '[Full URL]'); // Shorten link
|
|
|
|
//echo $unpsAPI->delShort($apidb, '580658027', $shortdb, '[Short link Code Only]]'); // Delete link
|
2013-07-20 03:31:45 +00:00
|
|
|
|
2013-07-27 03:54:27 +00:00
|
|
|
//echo $unpsAPI->upImage($apidb, '580658027', $imgdb, 'dc0de', 'This is a test', 'test', 0, imgdata); // Upload image
|
2013-07-27 03:44:05 +00:00
|
|
|
|
2013-07-27 03:54:27 +00:00
|
|
|
//echo $unpsAPI->regUser($apidb, '580658027', $udb, 'David', 'password123', 'tehfoxy.c0de@gmail.com'); // Register users
|
2013-07-27 04:35:47 +00:00
|
|
|
//echo $unpsAPI->regAPI($apidb, '580658027', 'UnPS-GAMA Link Shortener', 'tehfoxy.c0de@gmail.com', '1,0,0,0'); // Register API user
|
|
|
|
|
2013-07-27 04:47:51 +00:00
|
|
|
//echo $unpsAPI->resetAPI($apidb, '580658027', 'UnPS-GAMA Link Shortener', 'tehfoxy.c0de@gmail.com', '279qit9'); // test reset api key
|
2013-07-27 05:05:28 +00:00
|
|
|
//echo $unpsAPI->resetPass($apidb, '580658027', $udb, 'David', 'tefoxy.c0de@gmail.com', 'password1234s'); // Test change password
|
2013-07-18 22:26:53 +00:00
|
|
|
|
|
|
|
?>
|