Get a Number
const url = 'https://api.customer.onsim.uk/v1/numbers/example';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.customer.onsim.uk/v1/numbers/example \ --header 'x-api-key: <x-api-key>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The digits of the Number, with the country code and no plus.
Responses
Section titled “Responses”OK
A phone number that you own.
object
The ID of the Number: its digits, with the country code and no plus.
The digits of the Number, with the country code and no plus.
The country of the Number, in English. A number of no one country has none.
The area of the Number.
mobile for a mobile number. landline for every other.
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.
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.
object
The extension, for a party of your own: a User, a Hunt Group or an IVR. Look it up in their lists to learn which, and its name.
The digits of a phone number, for an outside party. withheld when the party hides it. A feature code such as *40 is here too.
The name of one of your own lines that has no extension, such as a SIM in a router. app.onsim shows it in the Account column of its logs.
Each User that shows the Number on the calls that they make, by its extension.
Who takes part in something: who makes a Call, who a Leg reaches, who takes the calls of a Number, which SIM uses data. One of your extensions has extension. An outside party has number. One of your lines with no extension has account. A User who hides their number has extension and number. A party that the record does not name has nothing.
object
The extension, for a party of your own: a User, a Hunt Group or an IVR. Look it up in their lists to learn which, and its name.
The digits of a phone number, for an outside party. withheld when the party hides it. A feature code such as *40 is here too.
The name of one of your own lines that has no extension, such as a SIM in a router. app.onsim shows it in the Account column of its logs.
Example
{ "type": "mobile", "state": "regular"}The request is not valid
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}The API key is missing or not valid, or: This request is not permitted
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}No such resource
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}The request is too large
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}Too many requests, or: The daily quota is used up
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}The request failed
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}Your records are not available now
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}The request took too long
An error, as RFC 9457 Problem Details.
object
A URI that names the kind of error. It is also a page of the docs.
A short summary of the kind of error.
The HTTP status.
What went wrong in this request.
Each parameter that is not valid. Only an invalid-request error has it.
object
The parameter that is not valid.
Why it is not valid.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "detail": "example" } ]}