Skip to content

joshcom/sparkapi4p2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Spark API - version 2

A PHP wrapper for the Spark REST API. This version has enough differences from version 1 that upgrading will require changes to existing code.

Documentation

For additional information on the PHP client, visit the wiki.

For full information on the API, see http://sparkplatform.com/docs

Usage Examples

// include the Spark core which autoloads other classes as necessary
require_once("lib/Core.php");

// connect using Spark API authentication
$api = new SparkAPI_APIAuth("api_key_goes_here", "api_secret_goes_here");

// identify your application (optional)
$api->SetApplicationName("MyPHPApplication/1.0");

// authenticate
$result = $api->Authenticate();
if ($result === false) {
    echo "API Error Code: {$api->last_error_code}<br>\n";
    echo "API Error Message: {$api->last_error_mess}<br>\n";
    exit;
}

// get your listings
$result = $api->GetMyListings();

/*
	Alternatively, if you cannot find the appropriate helper method,
	try our "get", "post", "put", or "delete" methods from Core.php. 
*/
$result = $api->get("my/listings");

// see the included examples.php for more complete usage

Error Codes

A list of all API error codes can be found here.

About

A PHP wrapper for the flexmls REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%