Number blocks and DDIs are going to be treated interchangeably. Bloc are allowed only in powers of 10 (1, 10, 100) etc. If 3 number are requested then 3 blocks of 1 are created, for 32 numbers 3 blocks of 10 and 2 blocks of 1 are created etc…
The assignement of numbers will be constrained by the designation assigned to the number. The designation is a set of information describing the validation rules that should be applied to number.
Each API endpoint will support pagination (where applicable).
In order to authenticate a `POST` request needs to be made to the `/login` endpoint.
curl -XPOST -H 'Content-Type: application/json' -d'{"username": "admin", "password":"admin"}' 'http://localhost:9080/login'
The response will contain an authentication token that needs to be included into every ubsequent call. I.e.:
curl -XGET -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:8080/mna'
GET numbers - list all
curl -XGET -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers'
GET numbers/:id - info on number id
curl -XGET -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers/1'
POST numbers - Create new number
curl -XPOST -H 'Content-Type: application/json' -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers' \
-d'{"number": "4567890", "number_type": "NonGeo", "number_status": "Available", "mna_id": 1, "wlr": false, "is_main_number": false, "ecas":false}'
PUT numbers/:id - Update number with the specfied ID
curl -XPUT -H 'Content-Type: application/json' -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers' \
-d'{"number": "4567890", "number_type": "Geo", "number_status":"Assigned", "mna_id": 1, "wlr": false, "is_main_number": true, "ecas":true}'
DELETE numbers/:id GET numbers/new - find new available number GET numbers/:id/status - show the status of the number GET numbers/search - lookup numbers
GET mna - list all MNAs GET mna/:id - retrive single MNA POST mna - create new MNA PUT mna/:id - update MNA
GET mna/:id/numbers - list all numbers for this MNA DELETE mna/:id - delete MNA
GET rsp - list all RSPs