Skip to content

Commit bcc0ef8

Browse files
committed
added readme files and how to use the api
1 parent b27f1e5 commit bcc0ef8

File tree

1 file changed

+73
-2
lines changed

1 file changed

+73
-2
lines changed

README.md

+73-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,73 @@
1-
# php-sipwise-api
2-
Sipwise Api client library
1+
# PHP Sipwise API
2+
3+
[![Build Status](https://travis-ci.org/nophaa/php-sipwise-api.svg?branch=master)](https://travis-ci.org/nophaa/php-sipwise-api)
4+
[![StyleCI](https://styleci.io/repos/3948501/shield?style=flat)](https://styleci.io/repos/153237868)
5+
[![Latest Stable Version](https://poser.pugx.org/nophaa/php-sipwise-api/v/stable)](https://packagist.org/packages/nophaa/php-sipwise-api)
6+
[![Total Downloads](https://poser.pugx.org/nophaa/php-sipwise-api/downloads)](https://packagist.org/packages/nophaa/php-sipwise-api)
7+
[![Latest Unstable Version](https://poser.pugx.org/nophaa/php-sipwise-api/v/unstable)](https://packagist.org/packages/nophaa/php-sipwise-api)
8+
[![Monthly Downloads](https://poser.pugx.org/nophaa/php-sipwise-api/d/monthly)](https://packagist.org/packages/nophaa/php-sipwise-api)
9+
[![Daily Downloads](https://poser.pugx.org/nophaa/php-sipwise-api/d/daily)](https://packagist.org/packages/nophaa/php-sipwise-api)
10+
11+
A simple Object Oriented wrapper for Sipwise Server API, written with PHP.
12+
13+
Tested with Sipwise version mr6.4.1, and for testing you can use vagrant file include in the repo. For more information about sipwise server you can go to http://sipwise.com.
14+
15+
## Requirements
16+
17+
* PHP >= 5.6
18+
* A [HTTP client](https://packagist.org/providers/php-http/client-implementation)
19+
* A [PSR-7 implementation](https://packagist.org/providers/psr/http-message-implementation)
20+
* A Guzzle http client for custom http client
21+
* (optional) PHPUnit to run tests.
22+
23+
## Install
24+
25+
Via Composer:
26+
27+
```bash
28+
$ composer require nophaa/php-sipwise-api php-http/guzzle6-adapter
29+
```
30+
31+
Why `php-http/guzzle6-adapter`? We are decoupled from any HTTP messaging client with help by [HTTPlug](http://httplug.io/). Read about clients in our [docs](doc/customize.md).
32+
33+
## Basic usage of `php-sipwise-api` client
34+
35+
```php
36+
<?php
37+
38+
// This file is generated by Composer
39+
require_once __DIR__ . '/vendor/autoload.php';
40+
41+
$client = new \Sipwise\Client();
42+
$adapter = Http\Adapter\Guzzle6\Client::createWithConfig(['verify'=>false]);
43+
$apiClient = Sipwise\Client::createWithHttpClient($adapter);
44+
$apiClient->authenticate('username','password');
45+
$apiClient->setUrl('https://127.0.0.1:1443');
46+
$apiClient->api('subscriber')->all(['username' => xxx]);
47+
```
48+
From `$apiClient` object, you can access sipwise api.
49+
50+
## Using Sipwise Vagrant
51+
using Vagrant file you can run sipwise server
52+
53+
```bash
54+
$ vagrant up
55+
```
56+
to remote the server
57+
58+
```bash
59+
vagrant ssh
60+
```
61+
62+
shutdown sipwise vagrant server
63+
64+
```bash
65+
vagrant halt
66+
```
67+
68+
sipwise api by default run in port 1443
69+
70+
## License
71+
72+
`php-sipwise-api` is licensed under the MIT License - see the LICENSE file for details
73+

0 commit comments

Comments
 (0)