GithubHelp home page GithubHelp logo

telnyx-php-sdk's Introduction

Introduction

This is an SDK for the Telnyx API v2

NOTE Because the v2 API is still in development some of the v1 endpoints will exist in the \Lonnylot\Telnyx\Legacy namespace.

Installation

Composer

You can install the bindings via Composer. Run the following command:

composer require lonnylot/telnyx-php-sdk dev-master

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Dependencies

The library requires the CrudSugar library.

Getting Started

This library was made so you can interact with the Telnyx APIs.

Table of Contents

  1. Setup Client
  2. Available Resources
  3. Available Endpoints
  4. Use Endpoint

Available Resources

The resources are named as follows:

  1. index - Telnyx "List"
  2. show - Telnyx "Retrieve"
  3. update - Telnyx "Update"
  4. delete - Telnyx "Delete"
  5. store - Telnyx "Create"

Available Endpoints

  1. messagingProfile
  2. numberOrder
  3. numberSearch
  4. phoneNumber
  5. phoneNumberMessaging
  6. phoneNumberVoice

Setup Client

Non Laravel

$client = \Lonnylot\Telnyx\Client::getInstance('telnyx');
$client->setApiKey('<your key>');

Laravel

To use with Laravel you need to set your Telnyx API key in app/config/services.php

[
  'telnyx' => [
    'api_key' => env('TELNYX_API_KEY', ''),
  ]
]

Now you can dependency inject \Lonnylot\Telnyx\Client in your Laravel application and it will be ready to use.

Use Endpoint

To use an endpoint you simply call the endpoint from your client followed by the resource you want to use.

NOTE Keep in mind the resource mapping in the Available Resources section

$client->numberSearch->index(['filter' => ['limit' => 3, 'features' => ['sms', 'mms']]]);

telnyx-php-sdk's People

Contributors

lonnylot avatar

Watchers

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