Skip to content

GetNumbers

Pavel Kuzmin edited this page Aug 10, 2020 · 4 revisions

[<< go back]

Diagram

Diagram

Methods

const driver = new OnlineSimDriver('APIKEY').numbers().{method}();

Example

const driver = new OnlineSimDriver('APIKEY');
const getter = driver.numbers()

getter.tariffs().then((result) => {
  console.log(result);
})
getter.get('3223').then((result) => {
  console.log(result);
})

getter.state().then((result) => {
  console.log(result);
})
// or
getter.stateOne(res.tzid).then((result) => {
  console.log(result);
})

// next message
getter.next(res.tzid).then((result) => {
  console.log(result);
})
...
getter.state().then((result) => {
  console.log(result);
})
...
getter.close(res.tzid).then((result) => {
  console.log(result);
})

Get new number for service

Params Default Description
$service no https://onlinesim.ru/docs/api/ru#getnum
$country 7 country
$reject no exclusion list

price [docs ru] [docs en]

Get service price

Params Default Description
$country 7 country
$service no https://onlinesim.ru/docs/api/ru#getnum

state [docs ru] [docs en]

Get list number for service

Params Default Description
$message_to_code 1 1 - show code, 0 - show full message
$orderby ASC ASC or DESC
$msg_list true true - show all message, false show one message< need next method
$clean true if use msg_list===0 - false - display messages in a circle

stateOne [docs ru] [docs en]

Get selected number for service

Params Default Description
$message_to_code 1 1 - show code, 0 - show full message
$orderby ASC ASC or DESC
$msg_list true true - show all message, false show one message< need next method
$clean true if use msg_list===0 - false - display messages in a circle

next [docs ru] [docs en]

select next message

Params Default Description
$tzid no operation id

close [docs ru] [docs en]

Close selected number for service

Params Default Description
$tzid no operation id

tariffs [docs ru] [docs en]

List tariffs for number for service