Locations
Once a tenant has a subscription, you have to define one or more physical addresses for this tenant. These addresses will define the locations that are allowed when using geographical numbers bound to a specifc region in a country.
List all locations of a subscription
Use this endpoint to retrieve all locations currently assigned to a subscription.
Request
Endpoint
GET
/api/v01/draas/{draas_instance}/tenants/{uuid}/subscriptions/{subscription_id}/locations
Authorization
Required role
tenants.instance.subscriptions.locations.list
Path Parameters
Parameter | Type | Description |
---|---|---|
draas_instance | string | See common parameters |
uuid | string | A system generated unique ID (UUID) identifying the tenant to which the subscription belongs |
sub_id | integer | Index of the subscription for which you want to list the locations |
URL/Query parameters
N/A
Response
Status codes
Parameter | Description |
---|---|
200 | One or more locations found |
400 | Error while processing the request |
403 | The API consumer doesn't have sufficient rights to perform this action |
500 | Uncatched error on server side |
Success
Body
Parameter | Type | Description | Conditional? |
---|---|---|---|
locations | array | List containing all locations found for the subscription | no |
Location Object
Parameter | Type | Description | Conditional? |
---|---|---|---|
id | integer | Index of the location | no |
street | string | Street name of the location | no |
number | string | Building number of the location | no |
postbox | string | Postbox number of the location | yes |
postalCode | object | Postal code object as defined by this structure | no |
Example
{
"locations": [
{
"id": 19,
"street": "Dreeflaan",
"number": "33",
"postalCode": {
"id": 2006,
"code": "3925BB",
"city": "Scherpenzeel",
"state": "Drenthe",
"region": {
"id": 122,
"name": "Wolvega"
},
"country": {
"id": 155,
"name": "Netherlands",
"isoCode": "NL"
}
}
},
{
"id": 21,
"street": "Blindstraat",
"number": "11",
"postbox": "4b2",
"postalCode": {
"id": 2017,
"code": "1300AD",
"city": "Almere",
"state": "Flevoland",
"region": {
"id": 70,
"name": "Almere"
},
"country": {
"id": 155,
"name": "Netherlands",
"isoCode": "NL"
}
}
}
]
}
Create a new location
Use this endpoint to associate a new location to a subscription
Request
Endpoint
POST
/api/v01/draas/{draas_instance}/tenants/{uuid}/subscriptions/{subscription_id}/locations
Authorization
Required role
tenants.instance.subscriptions.locations.create
Path Parameters
Parameter | Type | Description |
---|---|---|
draas_instance | string | See common parameters |
uuid | string | A system generated unique ID (UUID) identifying the tenant to which the subscription belongs |
sub_id | integer | Index of the subscription to which you want to add a location |
URL/Query parameters
N/A
Body
Parameter | Type | Description | Required |
---|---|---|---|
street | string | Street name of the location | yes |
number | string | Building number of the location | yes |
postbox | string | Postbox number of the location | no |
postalCodeId | integer | Postal code index as returned by this API call | yes |
Example
{
"street": "Route des Landes",
"number": "33",
"postbox": "5b1",
"postalCodeId": 1
}
Response
Status codes
Parameter | Description |
---|---|
200 | The location was created successfully |
400 | Error while creating the location |
403 | The API consumer doesn't have sufficient rights to perform this action |
500 | Uncatched error on server side |
Success
Body
Parameter | Type | Description | Conditional |
---|---|---|---|
id | integer | Index of the created location | no |
Example
{
"id": 15
}
Modify an existing location
Use this endpoint to modify an existing location for a subscription.
Request
Endpoint
PUT
/api/v01/draas/{draas_instance}/tenants/{uuid}/subscriptions/{subscription_id}/locations/{id}
Authorization
Required role
tenants.instance.subscriptions.locations.instance.update
Path Parameters
Parameter | Type | Description |
---|---|---|
draas_instance | string | See common parameters |
uuid | string | A system generated unique ID (UUID) identifying the tenant for which you want to modify the location |
sub_id | integer | Index of the subscription for which you want to update a location |
id | integer | Index of the location you want to update |
URL/Query parameters
N/A
Body
Parameter | Type | Description | Required |
---|---|---|---|
street | string | Street name of the location | no |
number | string | Building number of the location | no |
postbox | string | Postbox number of the location | no |
postalCodeId | integer | Postal code index as returned by this API call | no |
Example
{
"street": "Rue Sainte Claire",
"number": "14",
"postbox": "4b2",
"postalCodeId": 4
}
Response
Status codes
Parameter | Description |
---|---|
200 | The location was updated successfully |
400 | Error while updating the location |
403 | The API consumer doesn't have sufficient rights to perform this action |
404 | The location does not exist |
500 | Uncatched error on server side |
Success
Body
Parameter | Type | Description | Conditional |
---|---|---|---|
id | integer | Index of the modified location | no |
Example
{
"id": 14
}
Delete a location
Use this endpoint to delete an existing location for a subscription on the platform.
Request
Endpoint
DELETE
/api/v01/draas/{draas_instance}/tenants/{uuid}/subscriptions/{subscription_id}/locations/{id}
Authorization
Required role
tenants.instance.subscriptions.locations.instance.delete
Path Parameters
Parameter | Type | Description |
---|---|---|
draas_instance | string | See common parameters |
uuid | string | A system generated unique ID (UUID) identifying the tenant that owns the subscription |
sub_id | integer | Index of the subscription for which you want to delete a location |
id | integer | Index of the customer location you want to delete |
URL/Query parameters
N/A
Body
N/A
Response
Status codes
Parameter | Description |
---|---|
204 | The location was deleted successfully. If the location didn't exist, delete will be considered as being executed successfully |
400 | Error while deleting the location |
403 | The API consumer doesn't have sufficient rights to perform this action |
500 | Uncatched error on server side |
Success
Body
N/A