No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/SolidShopsApi
test
README.md
composer.json

README.md

#SolidShops PHP API client

A SolidShops API client for PHP created and maintained by @SolidShops

##Installation You can download the latest version or use composer:

{
	"require": {
		"solidshops/solidshops-api-php": "dev-master"
	}
}

##Authorisation You can create an authentication object once and pass it to the constructor of each class.


$obj_auth = new \SolidShopsApi\Http\Auth\BasicAuthentication ( "apikey", "apipassword" );

$obj_products = new \SolidShopsApi\Services\Products ( $obj_auth );
$obj_pages = new \SolidShopsApi\Services\Pages ( $obj_auth );
$obj_orders = new \SolidShopsApi\Services\Orders ( $obj_auth );
$obj_categories = new \SolidShopsApi\Services\Categories ( $obj_auth );
$obj_webhooks = new \SolidShopsApi\Services\Webhooks ( $obj_auth );

##Methods

###Pages

#####getlist


$obj_jsonresponse = $obj_pages->getlist ( $arr_filter );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####get


$obj_jsonresponse = $obj_pages->get ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####create


$obj_jsonresponse = $obj_pages->create ( '{
	"name": "a page name",
	"content": "the first content of the page",
	"active": 1
}' );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####update


$obj_jsonresponse = $obj_pages->update ( $id_to_update, '{
	"name": "a page name",
	"content": "the second content of the page",
	"active": 1
}' );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####delete


$obj_jsonresponse = $obj_pages->delete ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

###Products

#####getlist


$obj_jsonresponse = $obj_products->getlist ( $arr_filter );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####get


$obj_jsonresponse = $obj_products->get ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

###Orders

#####getlist


$obj_jsonresponse = $obj_orders->getlist ( $arr_filter );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####get


$obj_jsonresponse = $obj_orders->get ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

###Categories

#####getlist


$obj_jsonresponse = $obj_categories->getlist ( $arr_filter );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####get


$obj_jsonresponse = $obj_categories->get ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

###Webhooks

#####getlist


$obj_jsonresponse = $obj_webhooks->getlist ( $arr_filter );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####get


$obj_jsonresponse = $obj_webhooks->get ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####create


$obj_jsonresponse = $obj_webhooks->create ( '{
	"name": "a page name",
	"content": "the first content of the page",
	"active": 1
}' );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####update


$obj_jsonresponse = $obj_webhooks->update ( $id_to_update, '{
	"name": "a page name",
	"content": "the second content of the page",
	"active": 1
}' );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}

#####delete


$obj_jsonresponse = $obj_webhooks->delete ( 1 );
if ($obj_jsonresponse->getSuccess ()) {
	var_dump($obj_jsonresponse->getData ());
} else {
	var_dump($obj_jsonresponse->getErrors ());
}