NAV
php bash

Info

As chamadas da API devem ser autenticadas usando OAuth 2.0 com o token do usuário (USER_TOKEN). Cada usuário pode gerar seu token pessoal em Conta.

{parâmetro} - obrigatório
{parâmetro?} - opcional

general

Callback

Place a call using callback / Realiza uma ligação usando callback

Example request:


$api_call = 'https://portal.voiicr.com/api/web/callback/{source}/{dest}';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/callback/{source}/{dest}" \
-H "Authorization: Bearer USER_TOKEN"

Parameters

PATH Parameter Type Status Description
source string required Source phone number
dest string required Destination phone number

HTTP Request

GET api/web/callback/{source}/{dest}

POST api/web/callback/{source}/{dest}

HEAD api/web/callback/{source}/{dest}

Balance

Returns user balance / Retorna o saldo do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/balance';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/balance" \
-H "Authorization: Bearer USER_TOKEN"

HTTP Request

GET api/web/balance

HEAD api/web/balance

Create Invoice

Create an invoice for the user to pay / Cria uma fatura a ser paga pelo usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/invoices';
$token = 'USER_TOKEN';
$data = '
    {
      "frm_amount": 100
    }
';

// Create a stream
$opts = array(
  'http'=>array(
    'method'=>"POST",
    'header' => "Authorization: Bearer ".$token."\r\n".
                "Content-type: application/json\r\n".
                "Accept: application/json"."\r\n",
    'content' => $data
  )
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X POST "https://portal.voiicr.com/api/web/invoices" \
-H "Content-type: application/json" \
-H "Authorization: Bearer USER_TOKEN" \
-d '{   "frm_amount": 100 }'

Parameters

POST PATH Parameter Type Status Description
frm_amount int required Valor em reais da fatura (verificar valor mínimo)

HTTP Request

POST api/web/invoices

HEAD api/web/invoices

Invoice Minimum amount

Returns invoice minimum amount value / Retorna o valor mínimo para criar uma fatura

Example request:


$api_call = 'https://portal.voiicr.com/api/web/invoices/minimum';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/invoices/minimum" \
-H "Authorization: Bearer USER_TOKEN"

HTTP Request

GET api/web/invoices/minimum

HEAD api/web/invoices/minimum

Plan Pack

Returns user Plan Pack / Retorna o Plan Pack do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/planpack';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/planpack" \
-H "Authorization: Bearer USER_TOKEN"

HTTP Request

GET api/web/planpack

HEAD api/web/planpack

Tariff Plans

Returns user Tariff Plans / Retorna Tariff Plans do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/tariffplans';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/tariffplans" \
-H "Authorization: Bearer USER_TOKEN"

HTTP Request

GET api/web/tariffplans

HEAD api/web/tariffplans

Search Contacts

Search client contacts / Pesquisa contatos do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/contacts/search/{column}/{query}';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/contacts/search/{column}/{query}" \
-H "Authorization: Bearer USER_TOKEN"

Parameters

PATH Parameter Type Status Description
column string required Column to search (id, name, email, company, zip, number, complement, legalid)
query string required Value to search for

HTTP Request

GET api/web/contacts/search/{column}/{query}

HEAD api/web/contacts/search/{column}/{query}

Import Contacts

Import contacts from an external system to user's account / Importa contatos de um sistema externo para a conta do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/contacts';
$token = 'USER_TOKEN';
$data = '
    {
      "contacts": [
        {
        "params": {
          "name": "Fulano Somebody",
          "email": "somebody@company.com",
          "company": "Company",
          "zip": "05400000",
          "street": "Rua Tal",
          "number": "100",
          "complement": "casa 20",
          "legalid": "22222222222"
        },
        "phones": [
          "5511912345678", "551130303030"
        ]
        }
      ]
    }
';

// Create a stream
$opts = array(
  'http'=>array(
    'method'=>"POST",
    'header' => "Authorization: Bearer ".$token."\r\n".
                "Content-type: application/json\r\n".
                "Accept: application/json"."\r\n",
    'content' => $data
  )
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X POST "https://portal.voiicr.com/api/web/contacts" \
-H "Content-type: application/json" \
-H "Authorization: Bearer USER_TOKEN" \
-d '{   "contacts": [     {     "params": {       "name": "Fulano Somebody",       "email": "somebody@company.com",       "company": "Company",       "zip": "05400000",       "street": "Rua Tal",       "number": "100",       "complement": "casa 20",       "legalid": "22222222222"     },     "phones": [       "5511912345678", "551130303030"     ]     }   ] }'

Parameters

JSON { "contacts": [ { "params": { "name": "Fulano Somebody", "email": "somebody@company.com", "company": "Company", "zip": "05400000", "street": "Rua Tal", "number": "100", "complement": "casa 20", "legalid": "22222222222" }, "phones": [ "5511912345678", "551130303030" ] } ] }

HTTP Request

POST api/web/contacts

Calls

Returns user calls / Retorna as ligações do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/calls/{calledNumber?}';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/calls/{calledNumber?}" \
-H "Authorization: Bearer USER_TOKEN"

Parameters

PATH Parameter Type Status Description
calledNumber string optional Phone number to search for

HTTP Request

GET api/web/calls/{calledNumber?}

HEAD api/web/calls/{calledNumber?}

Call Details

Returns details of a call / Retorna os detalhes de uma ligação

Example request:


$api_call = 'https://portal.voiicr.com/api/web/call/{id}';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/call/{id}" \
-H "Authorization: Bearer USER_TOKEN"

Parameters

PATH Parameter Type Status Description
id string required Call ID

HTTP Request

GET api/web/call/{id}

HEAD api/web/call/{id}

Recordings

Returns user recordings / Retorna as chamadas do usuário

Example request:


$api_call = 'https://portal.voiicr.com/api/web/recordings/{calledNumber?}';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/recordings/{calledNumber?}" \
-H "Authorization: Bearer USER_TOKEN"

Parameters

PATH Parameter Type Status Description
calledNumber string optional Phone number to search for

HTTP Request

GET api/web/recordings/{calledNumber?}

HEAD api/web/recordings/{calledNumber?}

Recording MP3

Returns recording MP3 for download or streaming / Retorna a MP3 da gravação para download ou reprodução

Example request:


$api_call = 'https://portal.voiicr.com/api/web/recordings/mp3/{recordingId}/{playOnly?}';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/recordings/mp3/{recordingId}/{playOnly?}" \
-H "Authorization: Bearer USER_TOKEN"

Parameters

PATH Parameter Type Status Description
recordingId string required Recording ID
plaOnly boolean optional If set to true it returns the file for streaming, if set to false (or unset) it returns it for downloading

HTTP Request

GET api/web/recordings/mp3/{recordingId}/{playOnly?}

HEAD api/web/recordings/mp3/{recordingId}/{playOnly?}

Sub Accounts

Returns user Sub Accounts / Retorna as sub contas de um usuário master

Example request:


$api_call = 'https://portal.voiicr.com/api/web/subaccounts';
$token = 'USER_TOKEN';

// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Bearer ".$token
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X GET "https://portal.voiicr.com/api/web/subaccounts" \
-H "Authorization: Bearer USER_TOKEN"

HTTP Request

GET api/web/subaccounts

HEAD api/web/subaccounts

Create Sub Account

Create a sub account under the user master account / Cria uma sub aconta para um usuário master

Example request:


$api_call = 'https://portal.voiicr.com/api/web/subaccounts';
$token = 'USER_TOKEN';
$data = array('login' => 'value', 'password' => 'value', 'firstName' => 'value', 'lastName' => 'value', 'email' => 'value', 'phone' => 'value');

// Create a stream
$opts = array(
'http'=>array(
'method'=>"POST",
'header' => "Authorization: Bearer ".$token,
'content' => http_build_query($data)
)
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents($api_call, false, $context);

print($file);
print "\n";
curl -X POST "https://portal.voiicr.com/api/web/subaccounts" \
-H "Content-type: application/json" \
-H "Authorization: Bearer USER_TOKEN" \
-d '{   "subaccounts": [     {     "params": {       "login": "somebody",       "password": "abc123",       "firstName": "Fulano",       "lastName": "Somebody",       "email": "somebody@company.com",       "phone": "5511912345678"    }   ] }'

Parameters

POST Parameter Type Status Description
login string required New account login
password string required New account password
firstName string required New user first name
lastName string required New user last name
email string required New account e-mail
phone string required New user phone number

HTTP Request

POST api/web/subaccounts