В версиях Node.js < 6.3.0 необходимо запускать с флагом --harmony-proxies
. Например,
node --harmony-proxies script.js
Для начала работы с API Вам необходимо сделать три простых шага:
- Зарегистрироваться в системе Mobizon
- Включить в своем аккаунте доступ к API
- Получить ключ API - после включения доступа к API Вам будет сгенерирован и показан ключ доступа.
Подробнее процесс подключения к API описан на нашем сайте
npm install --save mobizon
Документация с описанием всех доступных на данный момент методов API, их входных параметров, формата возвращаемых данных, списка возможных кодов ответа API доступна по адресу http://docs.mobizon.com/api/.
mobizon = require(mobizon)("Ваш ключ API");
// Получение состояния баланса
mobizon.User.GetOwnBalance({}, callbackFunction(error, data))
// Отправка SMS сообщения
mobizon.Message.SendSMSMessage({recipient: 'PHONE_NUMBER', text: 'Success'}, callbackFunction(error, data))
For Node.js < 6.3.0 you need run node with --harmony-proxies
flag. Example,
node --harmony-proxies script.js
To start sending SMS messages through Mobizon API you should do three simple steps:
- Register account on Mobizon website
- Enable API in your Mobizon account settings
- Copy API key - when you enable API access in your account, system provides you with API key, which you use then in your software.
Details of connection your software to API is described at Mobizon website
npm install --save mobizon
You could review online documentation for detailed description of all currently available API methods, input parameters, result formats, API result codes at http://docs.mobizon.com/api/.
We have started development of typical usage scenarios in docs/examples. If you have own examples of integration, please help us improve our code base - just send us some code examples to [email protected] and we will glad to put your code to our repo.
mobizon = require(mobizon)("YOUR API KEY");
// Get balance amount
mobizon.User.GetOwnBalance({}, callbackFunction(error, data))
// Send SMS message
mobizon.Message.SendSMSMessage({recipient: 'PHONE_NUMBER', text: 'Success'}, callbackFunction(error, data))