Number
A phone number that you own.
Fields
Section titled “Fields”| Field | Type | What it is | On app.onsim |
|---|---|---|---|
id | string | The ID of the Number: its digits, with the country code and no plus. | The number itself. |
number | string | The digits of the Number, with the country code and no plus. | The number beside the mark. It is also in the address of the page. |
countryoptional | string | The country of the Number, in English. A number of no one country has none. | The Country column. |
areaoptional | string | The area of the Number. | Not shown. |
type | "mobile" | "landline" | mobile for a mobile number. landline for every other. | The Type badge on the page of the Number: Mobile or Landline. |
state | "regular" | "legacy" | "unassigned" | regular when an extension takes the calls to the Number. legacy for a Number from before app.onsim, which cannot move to another holder. unassigned when nothing takes its calls. | A Legacy Number has a lock on its page. |
inboundoptional | Party | What takes the calls to the Number: a User, a Hunt Group or an IVR, by its extension. A line with no extension shows by its account. A Number that nothing takes the calls of has none. | The Inbound column. It is empty when nothing takes the calls. |
outbound | list of Party | Each User that shows the Number on the calls that they make, by its extension. | The Outbound column: the Users that show the Number. |
The two sides of a Number
Section titled “The two sides of a Number”Calls come in on a Number, and one thing takes them: inbound. Calls go out from each User that shows the Number: outbound. A User can show a Number that it does not hold, such as the Number of a Hunt Group.
Each is a Party, the object that the whole API uses to point at someone. Most have an extension, which a User, a Hunt Group and an IVR also have. A line with no extension that takes the calls of a Number has an account.
Example
Section titled “Example”{ "id": "442079460123", "number": "442079460123", "country": "United Kingdom", "area": "London", "type": "landline", "state": "regular", "inbound": { "extension": "300" }, "outbound": [ { "extension": "201" }, { "extension": "203" } ]}Methods
Section titled “Methods”The list gives the Numbers of one state, so it needs state: regular, legacy or unassigned. To get every Number, ask one time for each state.
curl "https://api.customer.onsim.uk/v1/numbers?state=regular" \ -H "x-api-key: $ONSIM_API_KEY"The list gives each one with id, number, country, area, type and state only. The get gives every field.
List NumbersGET /v1/numbers
Get a NumberGET /v1/numbers/{id}