Your systems can do everything the portal’s Order Numbers page does. Each call and its fields are in the full reference. Once a number is yours, routing, emergency addresses, SMS delivery and releasing it are in Managing numbers by API.
Scopes
voice:readfinds areas, searches numbers, reads orders and looks numbers up.voice:createholds a number and places an order.
A key acts for your whole account. A partner’s limits in the portal don’t apply to it.
Ordering a local number for a customer’s address
- Search for the address with
GET /addresses/search. - Send its
fullAddresstoGET /numbers/areas?address=. You get the numbering areas (SZUs) that serve it, best match first. This call can take up to a minute. - Search the first area with
GET /numbers/available?type=fixed&szu=…. AddblockSize=10orblockSize=100for a block. You get up to five numbers, or the block you would get. Each comes with its monthly and setup price per number, shown without GST, as the GST, and with GST. - To pick one of our numbers, hold it with
POST /numbers/holds. It is yours for 24 hours, untilheldUntil, and nobody else can take it. You can’t extend a hold. - Order with
POST /numbers. Send the type, area and size, and either theholdIdor anofferId(see below). Add the trunk’ssipUsernameand the emergency address the number is listed at. AnIdempotency-Keyis required, so a retry never orders twice. - The order answers
202with aLocation. Read it withGET /numbers/orders/{id}until it iscompletedorfailed. A completed order lists each number and its route. A failed one gives the reason.
Leave the hold out and we take the next number we hold. To keep the numbers
on no service, send spare: true instead of a trunk and address. They are
routed to Disconnected until you route them.
Numbers we order in for you
Where we hold no stock for an Australian geographic number, the search shows
numbers we can order in for you. Those results are marked source: offer and
carry an offerId. Nothing is reserved until you order. The order gets the
number, then sets it up as usual. You can’t hold an offered number before
you order it, and you can’t put one in a bundle.
Sometimes the order gets the number and then can’t be placed. The 422 then
gives an error.holdId and error.heldUntil, and we hold the number for you
until that time. Fix what was wrong and order again with that holdId and
the same type, area and size. That order takes the same number.
Orders in a bundle
Send bundle with the bundle’s id to add the order to it. The order is a
draft, and nothing is allocated until the bundle is released. That way the
numbers don’t go live before the service they are for. Once a bundle is
submitted, it takes nothing more.
When a hold has run out
An order naming an expired hold answers 422 with the code hold_expired.
Hold the number again if it is still free, or choose another.
How many numbers you can hold
Your account can hold 50 numbers at once, and numbers being ordered count
toward that. One more hold answers 409 saying you are at your limit. Order
one of the numbers you hold, or wait for a hold to run out, then try again.
Ask us if you need a higher limit.
Looking up a number before a port
POST /numbers/lookup takes a batch of Australian numbers. For each one it
tells you:
- which carrier it was assigned to
- who serves it now
- its numbering area
- whether it is already porting
- whether we already hold it
asAt says how current the answer is. portable is a hint from the last two
answers only. It doesn’t check that a port will be accepted.
Each number counts against your account’s daily lookup allowance. The
portal’s Number Lookup uses the same allowance. A batch that would go over it
is refused whole with 429. error.allowance gives how many you have used,
the limit, and how many you asked for. Retry-After gives the seconds until
the allowance resets at midnight Brisbane time.
Emergency addresses from an address search
When you create or change an emergency address, send the gnafId of an
address search result as serviceAddress.gnafPid. Leave the other address
fields out. We fill in the building, unit, level, street number, street name
and type, locality, state and postcode, in the shape the emergency register
needs. The portal does the same when you pick an address. Any field you send
alongside it wins. A directory address works the same way, as
directoryAddress.gnafPid.