Coder Social home page Coder Social logo

chabok-php-demo's Introduction

Chabok API for PHP

Integrate your app with Chabok messaging & push api seamlessly

Upgrade Notes to v1.1.0 (MUST READ)

  • Change all Swagger prefix to Chabok
  • You should set 'App_ID' on Chabok Configuration to connect in the right way

Requirements

PHP 5.4.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/chabokpush/chabok-php-demo.git"
    }
  ],
  "require": {
    "chabok-php": "dev-master"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/chabok-php-demo/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ApiSecurity,  Get your 'YOUR_API_KEY' from http://sandbox.push.adpdigital.com/front/account/edit 
Chabok\Client\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY');
// Get your 'App_ID' from http://sandbox.push.adpdigital.com/front/account/edit 
Chabok\Client\Configuration::getDefaultConfiguration()->setAppId('App_ID');
// Make Dev mode enable If you want to test your App on Development environment or don't have Chabok premium account
Chabok\Client\Configuration::getDefaultConfiguration()->setDevMode(true);
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Chabok\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer');

$api_instance = new Chabok\Client\Api\InstallationApi();
$user_id = "user_id_example"; // string | 
$tag_name = "tag_name_example"; // string | 

try {
    $result = $api_instance->installationAddTag($user_id, $tag_name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstallationApi->installationAddTag: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://sandbox.push.adpdigital.com/api

Class Method HTTP request Description
InstallationApi installationAddTag GET /installations/addTag/{userId}/{tagName} Add tag to all devices of a user
InstallationApi installationFetchById GET /installations/fetchById/{installationId} Find device installation data by installationId
InstallationApi installationFetchByUserId GET /installations/fetchByUserId/{userId} Find devices of a specific user
InstallationApi installationGroupBySubscription GET /installations/channels List of unique channel names
InstallationApi installationRemoveTag GET /installations/removeTag/{userId}/{tagName} Remove a tag from devices of a UserId
InstallationApi installationTags GET /installations/tags List of unique tag names
MessageApi messageFetchById GET /messages/fetchById/{messageId} Fetch a pushed message by id
PushApi pushByQuery POST /push/byQuery Push a text message to a segment of devices
PushApi pushToUsers POST /push/toUsers Push multiple text messages to users
VerificationApi verificationRequestCodeGet GET /verification/requestCode/{userId} Request a verification code to be sent to a user
VerificationApi verificationVerifyGetVerificationVerifyCodeuserIdcode GET /verification/verifyCode/{userId}/{code} Verify user's verification code

Documentation For Models

Documentation For Authorization

ApiSecurity

  • Type: API key
  • API key parameter name: access_token
  • Location: URL query string

chabok-php-demo's People

Contributors

behrad avatar jalalazimi 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.