Skip to content

This SDK contains all the logic and connection methods to Sales Layer’s customizable API.

License

Notifications You must be signed in to change notification settings

saleslayer/Sales_Layer_PHP_SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sales Layer for Developers

Sales Layer's PHP SDK

This is the official PHP SDK for Sales Layer's PIM Platform.

Description

This SDK contains all the logic and connection methods to Sales Layer’s customizable API. And you can find more detailed documentation at our website.

Requirements

PHP 5.6 and later

Started

With Github

Access github and download the package.

With Composer

Using Composer is the recommended way to install the Sales Layer SDK for PHP. The SDK is available via Packagist under the saleslayer/saleslayer-php-sdk package. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency:

composer require saleslayer/saleslayer-php-sdk

Examples

<?php

if (!class_exists('SalesLayer_Conn')) require_once 'SalesLayer-Conn.php';

$connector_id = 'CN000H0000C000';
$secret_key   = 'f035324ba8f98a6f33c05ee1ce36ef29';

// Instantiate the class
$SLconn = new SalesLayer_Conn($connector_id, $secret_key);

$SLconn->set_API_version('1.17');

$SLconn->get_info();

if ($SLconn->has_response_error()) {

	echo "<h4>Error:</h4>\n\n Code: ".$SLconn->get_response_error(). "<br>\nMessage: " . $SLconn->get_response_error_message();

} else {

	echo "<h4>Response OK</h4>\n".
		 "<p>".
		 "API version: <b>". $SLconn->get_response_api_version() ."</b><br />\n".
		 "Action: <b>". $SLconn->get_response_action() ."</b><br />\n".
		 "Time: <b>". $SLconn->get_response_time() ."</b> (GMT 0)<br />\n".
		 "Default language: <b>". $SLconn->get_response_default_language() ."</b><br /><br />\n".
		 "Information:<br />". print_r($SLconn->get_response_table_information(), 1) ."<br /><br />\n".
		 "Modified ID's:<br />" .print_r($SLconn->get_response_table_modified_ids(), 1) ."<br /><br />\n".
		 "Deleted ID's:<br />". print_r($SLconn->get_response_table_deleted_ids(), 1)  ."<br /><br />\n".
		 "Data:<br />". print_r($SLconn->get_response_table_data(), 1) ."<br /><br />\n".
		 "List files:<br />". print_r($SLconn->get_response_list_modified_files(), 1)."<br /><br />\n".
		 "</p>\n";
		 
	}
	
?>

Documentation & Important notes

⚠️ A Sales Layer account might be needed to access the documentation

About

This SDK contains all the logic and connection methods to Sales Layer’s customizable API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages