Allocate a number

The example below demonstrates how to search, purchase and set forwarding for a new number.

Purchasing a number via the API is a multi-step process. Firstly you need to search for the number you'd like to buy and add it to your basket. You'll then need to add a credit card to your account if you have already done so to pay for the number. Finally, you can purchase the number and forward it to your chosen destination.

Authenticate and perform a number search.

Request

<?xml version="1.0"?>
<NoveroRequest>
  <Request target="Auth" name="SessionLogin" id="SessionRequest">
    <Username>[email protected]</Username>
    <Password>MySuperSecretPassword</Password>
    <VKey>a75ac3289b7a145579bec8ad5ec60a</VKey>
  </Request>
  <Request target="NoveroNumberSearch" name="Search" id="Request1">
    <Range>01245</Range>
    <Limit>1</Limit>
    <Band>00</Band>
  </Request>
</NoveroRequest>

Response

<?xml version="1.0"?>
<NoveroResponse>
  <Response target="Auth" name="SessionLogin" Code="200" RequestId="SessionRequest">
    <SessionId>75ad4013e0ea4340c0b5c28b4aad96a9</SessionId>
  </Response>
  <Response target="NoveroNumberSearch" name="Search" Code="200" RequestId="Request1">
    <Numbers>
      <Number>
        <RawNumber>01245835013</RawNumber>
        <alpha></alpha>
        <band>00</band>
        <code>g</code>
        <range>01245</range>
        <tariff>Chelmsford</tariff>
        <number>01245 835 013</number>
      </Number>
    </Numbers>
    <BandCounts>
      <BandCount Band="00">7,859</BandCount>
      <BandCount Band="10">1,115</BandCount>
      <BandCount Band="20">324</BandCount>
      <BandCount Band="30">266</BandCount>
      <BandCount Band="40">39</BandCount>
      <BandCount Band="50">12</BandCount>
    </BandCounts>
    <BandPrice>£10</BandPrice>
    <BandRewnewalPrice>£10</BandRewnewalPrice>
    <BandRewnewalFreq>yearly</BandRewnewalFreq>
  </Response>
</NoveroResponse>

Add the number to the basket, and exchange a card for a TokenId.

Request

<NoveroRequest>
  <SessionId>75ad4013e0ea4340c0b5c28b4aad96a9</SessionId>
  <Request target="Order" name="AddToBasket" id="Request1">
    <number>01245835013</number>
    <type>number</type>
  </Request>
  <Request target="NoveroUser" name="AddCard" id="Request2">
    <CardName>Mr Joe Blogs</CardName>
    <CardNumber>44012345678901234</CardNumber>
    <ExpiryMonth>05</ExpiryMonth>
    <ExpiryYear>15</ExpiryYear>
    <CV2>123</CV2>
    <Type>VISA</Type>
    <Address1>10 Some Street</Address1>
    <City>London</City>
    <Postcode>E1 1AB</Postcode>
    <Country>UK</Country>
  </Request>
</NoveroRequest>

Response

<?xml version="1.0"?>
<NoveroResponse>
  <Response target="Order" name="AddToBasket" Code="200" RequestId="Request1">
    <ResponseMessage>Added to Basket</ResponseMessage>
    <Success>Added to Basket</Success>
  </Response>
  <Response target="NoveroUser" name="AddCard" Code="200" RequestId="Request2">
    <Token>
      <TokenId>12345</TokenId>
    </Token>
  </Response>
</NoveroResponse>

Purchase the number using the TokenId from the previous request, and route it to a destination.

Request

<NoveroRequest>
  <SessionId>75ad4013e0ea4340c0b5c28b4aad96a9</SessionId>
  <Request target="Order" name="PlaceOrder" id="Request1">
    <TokenId>12345</TokenId>
    <CV2>123</CV2>
  </Request>
  <Request target="NoveroNumbers" name="SetDestination" id="Request2">
    <Number>01245835013</Number>
    <Destination>08004681000</Destination>
  </Request>
</NoveroRequest>

Response

<NoveroResponse>
  <Response target="Order" name="PlaceOrder" Code="200" RequestId="Request1">
    <OrderStatus>OK</OrderStatus>
    <InvoiceId>12345</InvoiceId>
  </Response>
  <Response target="NoveroNumbers" name="SetDestination" Code="200" RequestId="Request2">
    <ResponseMessage>Destination Set Successfully</ResponseMessage>
    <Success>Destination Set Successfully</Success>
  </Response>
</NoveroResponse>