mysmile / apiclient
Rest api client for MySmile CMS
v1.3.0
2015-01-01 19:55 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.3.*
This package is not auto-updated.
Last update: 2024-11-09 17:40:25 UTC
README
Rest api client Client for MySmile CMS.
Requirements
- PHP 5.3+
- Curl
Installation
The best way to install MySmile Api Client is use composer:
- Update your
composer.json
{ "require": { "mysmile/apiclient": "dev-master" } }
- Run
composer update
Usage
Manager configuration
$endpoint = 'http://demo.mysmile.com.ua/api'; // please set your endpoint instead of demo $manager = Manager::getInstance() ->setEndpoint($endpoint);
For developing purpose it's possible to configure proxy:
$proxy = 'http://127.0.0.1:8888';
$manager = Manager::getInstance()
->setProxy();
Get language list
$language = new Language($manager); $response = $language->getData();
Get contact
$contact = new Contact($manager); $response = $contact->getData();
Get content list
$params = array('lang' => 'en');// list of available languages can be get using Language Resource $content = new Content($manager); $response = $content->getData($params);
Get content by slug
$params = array('lang' => 'en', 'slug' => 'index'); // how to get list of available slugs is presented in the example above $content = new Content($manager); $response = $content->getData($params);
Example
Mobile version of MySmile that is based on MySmile Api Client can be found here /doc/example
.
Installation
Run composer update
in /doc/example
.
License
BSD-3-Clause