1.1.5 • Published 5 years ago

phonet-sdk v1.1.5

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

PHONET SDK

version node yarn

How to use

Setup

Install it:

yarn add phonet-sdk

Initialize:

services/phonet.js

import Phonet from 'phonet-sdk'

const default Phonet({
  domain: 'test4.phonet.com.ua',              
  apiKey: 'bHGbn240QSjFJgydW0WyZ3v6UeNDT8CV'
})

Phonet object recived the following properties:

  • domain - your api server from the Phonet dashboard
  • apiKey - your api key from the Phonet dashboard

Usage

WebSockets

Subscribe for call
import Phonet from 'services/phonet.js'

const id = '007'

const socket = await Phonet.wss.subscribeToCall(id)

subscribeToCall method recived the following properties:

  • id - user id to subscribe

Teler CRM

Write contacts
import Phonet from 'services/phonet.js'

const data = {
  merge : 1, 
  contacts : [{
    id: 7068,
    lastModified: 1443597876359,
    responsibleUserId: 18,
    createUserId: 59,
    fields: [{
      id: 32134,
      enumCode: 'Category',
      values: [{
        id: 12334,
        enumValueCode: 'Category',
        lastModified: 1443597876359,
        value: 'EMPL'
      }]
    }]
  }]
}

const res = await Phonet.teler.postContacts(data)

postContacts method recived the following properties:

  • data - for more information please see Phonet documentation :p
Search contact by phone number
import Phonet from 'services/phonet.js'

const phoneNumber = '+380111222333'

const contact = await Phonet.teler.searchContactByPhoneNumber(phoneNumber)

searchContactByPhoneNumber method recived the following properties:

  • phoneNumber - contact phone number
1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago