https://github.com/mirovit/ionic-platform-sdk
PHP Wrapper for using the Ionic Platform API.
https://github.com/mirovit/ionic-platform-sdk
ionic ionic-cloud php-wrapper
Last synced: about 1 month ago
JSON representation
PHP Wrapper for using the Ionic Platform API.
- Host: GitHub
- URL: https://github.com/mirovit/ionic-platform-sdk
- Owner: mirovit
- Created: 2016-07-12T15:33:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T18:58:02.000Z (over 8 years ago)
- Last Synced: 2025-07-09T10:55:08.698Z (7 months ago)
- Topics: ionic, ionic-cloud, php-wrapper
- Language: PHP
- Size: 37.1 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/mirovit/ionic-platform-sdk)
[](https://codeclimate.com/github/mirovit/ionic-platform-sdk)
[](https://codeclimate.com/github/mirovit/ionic-platform-sdk/coverage)
# Ionic Platform API SDK
So a bit of an explanation. There is an API to the services that the Ionic Platform provides and this is a simple PHP wrapper that you can use.
For reference - [http://docs.ionic.io/docs/api-getting-started](API docs on the Ionic.io site).
Still work-in-progress.
## Installation
Using [Composer](http://getcomposer.org):
```
composer require mirovit/ionic-platform-sdk
```
## Contribution
Contributions are welcome, the only thing that is important for me is the expressive syntax and at some point when I've written tests - tests.
## Usage
This package uses a fluent syntax, so it is very easy to read and understand the underlying code.
```php
users()
->get('user-uuid-from-ionic');
// Create an user
$newUser = $sdk
->users()
->create([
'app_id' => 'your_app_id',
'email' => 'john@doe.com',
'password' => 'very_secret_passw0rd',
]);
```
## Available endpoints
### users()
```php
users()
->all();
// http://docs.ionic.io/docs/api-users#users-get
$sdk
->users()
->get('user-uuid');
// http://docs.ionic.io/docs/api-users#users-self
$sdk
->users()
->self();
// http://docs.ionic.io/docs/api-users#users-post
$sdk
->users()
->create([
// required
'app_id' => '',
'email' => '',
'password' => '',
// optional
'name' => '',
'username' => '',
'image' => '',
'custom' => [
'foo' => 'bar',
'what' => 'ever',
],
]);
// http://docs.ionic.io/docs/api-users#users-patch
$sdk
->users()
->update([
// required
'uuid' => '',
'email' => '',
'password' => '',
// optional
'name' => '',
'username' => '',
'image' => '',
'custom' => [
'foo' => 'bar',
'what' => 'ever',
],
]);
// http://docs.ionic.io/docs/api-users#users-delete
$sdk
->users()
->delete('user-uuid');
// http://docs.ionic.io/docs/api-users#users-custom-get
$sdk
->users()
->getCustom('user-uuid');
// http://docs.ionic.io/docs/api-users#users-custom-put
$sdk
->users()
->setCustom([
// required
'uuid' => 'user-uuid',
// optional, whatever data you need to store
'foo' => 'baz',
'bar' => 'foo',
]);
// http://docs.ionic.io/docs/api-users#users-password-reset
$sdk
->users()
->passwordReset();
```
### push()
```php
push()
->notifications()
->all();
// http://docs.ionic.io/docs/api-push#notifications-get
$sdk
->push()
->notifications()
->get('notification-uuid');
// http://docs.ionic.io/docs/api-push#notifications-list-messages
$sdk
->push()
->notifications()
->messages('notification-uuid');
// http://docs.ionic.io/docs/api-push#notifications-post
$sdk
->push()
->notifications()
->create([
]);
// http://docs.ionic.io/docs/api-push#messages-list
$sdk
->push()
->messages()
->all();
// http://docs.ionic.io/docs/api-push#messages-get
$sdk
->push()
->messages()
->get('message-uuid');
// http://docs.ionic.io/docs/api-push#tokens-list
$sdk
->push()
->tokens()
->all();
// http://docs.ionic.io/docs/api-push#tokens-get
$sdk
->push()
->tokens();
// http://docs.ionic.io/docs/api-push#tokens-patch
$sdk
->push()
->tokens()
->validate('token-uuid');
$sdk
->push()
->tokens()
->invalidate('token-uuid');
$sdk
->push()
->tokens()
->changeStatus('token-uuid', 'status');
// http://docs.ionic.io/docs/api-push#tokens-post
$sdk
->push()
->tokens()
->save('token-string', 'user-uuid');
// http://docs.ionic.io/docs/api-push#tokens-delete
$sdk
->push()
->tokens()
->delete('token-uuid');
```
### deploy()
```php
deploy()
->channels()
->all();
// http://docs.ionic.io/docs/api-deploy#channels-get
$sdk
->deploy()
->channels()
->get('channel-uuid');
// http://docs.ionic.io/docs/api-deploy#channels-get-tag
$sdk
->deploy()
->channels()
->tag('tag');
// http://docs.ionic.io/docs/api-deploy#channels-post
$sdk
->deploy()
->channels()
->create([
]);
// http://docs.ionic.io/docs/api-deploy#channels-edit
$sdk
->deploy()
->channels()
->update([
]);
// http://docs.ionic.io/docs/api-deploy#channels-delete
$sdk
->deploy()
->channels()
->delete('channel-uuid');
// http://docs.ionic.io/docs/api-deploy#snapshots-list
$sdk
->deploy()
->snapshots()
->all();
// http://docs.ionic.io/docs/api-deploy#snapshots-get
$sdk
->deploy()
->snapshots()
->get('snapshot-uuid');
// http://docs.ionic.io/docs/api-deploy#snapshots-edit
$sdk
->deploy()
->snapshots()
->update([
]);
// http://docs.ionic.io/docs/api-deploy#deploys-list
$sdk
->deploy()
->deploys()
->all('channel-uuid');
// http://docs.ionic.io/docs/api-deploy#deploys-post
$sdk
->deploy()
->deploys()
->set('channel-uuid', 'snapshot-uuid');
// http://docs.ionic.io/docs/api-deploy#deploys-delete
$sdk
->deploy()
->deploys()
->delete('deploy-uuid');
```