Giter Site home page Giter Site logo

comagic-api's Introduction

CoMagic & Uiscom API php client

CoMagic php client for:

Installation

To get started, install package via the Composer package manager:

composer require pashamesh/comagic-api

Usage

Configuring

Array is using to configure Rest API and Call API clients.

$config = [
    // required for Rest API and optional for Call API
    'login' => 'put_login_here',
    'password' => 'put_password_here',
    // required for Call API if login and password not specified
    'access_token' => 'put_access_token_here',
];

You also need to change domain if you client of Uiscom by specifying endpoint:

$config = [
    // required for Rest API and optional for Call API
    'login' => 'put_login_here',
    'password' => 'put_password_here',
    'endpoint' => [
        'rest_api' => 'https://api.uiscom.ru/api/'
    ],
    // required for Call API if login and password not specified
    'access_token' => 'put_access_token_here',
];

Do not foreget to add Call API permissions to user if you want to use login and password authorization for Call API

Rest API

use CoMagic\RestApiClient;

$restApi = new RestApiClient($config);
var_dump(
    $restApi->call(['date_from' => '2017-01-10', 'date_till' => '2017-01-13'])
);

Call API

API Methods names need to be specified in CamelCase

$callApi = new CallApiClient($config);
var_dump($callApi->listCalls());

It's possible to get response metadata after API request is made

var_dump($callApi->metadata());

comagic-api's People

Contributors

dependabot[bot] avatar pashamesh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.