Skip to content

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

ParameterTypeDescription
draas_instancestringSee common parameters
uuidstringA system generated unique ID (UUID) identifying the tenant to which the subscription belongs
sub_idintegerIndex of the subscription for which you want to list the locations

URL/Query parameters

N/A

Response

Status codes

ParameterDescription
200One or more locations found
400Error while processing the request
403The API consumer doesn't have sufficient rights to perform this action
500Uncatched error on server side

Success

Body
ParameterTypeDescriptionConditional?
locationsarrayList containing all locations found for the subscriptionno
Location Object
ParameterTypeDescriptionConditional?
idintegerIndex of the locationno
streetstringStreet name of the locationno
numberstringBuilding number of the locationno
postboxstringPostbox number of the locationyes
postalCodeobjectPostal code object as defined by this structureno
Example
json
{
    "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

ParameterTypeDescription
draas_instancestringSee common parameters
uuidstringA system generated unique ID (UUID) identifying the tenant to which the subscription belongs
sub_idintegerIndex of the subscription to which you want to add a location

URL/Query parameters

N/A

Body
ParameterTypeDescriptionRequired
streetstringStreet name of the locationyes
numberstringBuilding number of the locationyes
postboxstringPostbox number of the locationno
postalCodeIdintegerPostal code index as returned by this API callyes

Example

json
{
    "street": "Route des Landes",
    "number": "33",
    "postbox": "5b1",
    "postalCodeId": 1
}

Response

Status codes

ParameterDescription
200The location was created successfully
400Error while creating the location
403The API consumer doesn't have sufficient rights to perform this action
500Uncatched error on server side

Success

Body
ParameterTypeDescriptionConditional
idintegerIndex of the created locationno
Example
json
{
  "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

ParameterTypeDescription
draas_instancestringSee common parameters
uuidstringA system generated unique ID (UUID) identifying the tenant for which you want to modify the location
sub_idintegerIndex of the subscription for which you want to update a location
idintegerIndex of the location you want to update

URL/Query parameters

N/A

Body

ParameterTypeDescriptionRequired
streetstringStreet name of the locationno
numberstringBuilding number of the locationno
postboxstringPostbox number of the locationno
postalCodeIdintegerPostal code index as returned by this API callno

Example

json
{
    "street": "Rue Sainte Claire",
    "number": "14",
    "postbox": "4b2",
    "postalCodeId": 4
}

Response

Status codes

ParameterDescription
200The location was updated successfully
400Error while updating the location
403The API consumer doesn't have sufficient rights to perform this action
404The location does not exist
500Uncatched error on server side

Success

Body
ParameterTypeDescriptionConditional
idintegerIndex of the modified locationno
Example
json
{
  "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

ParameterTypeDescription
draas_instancestringSee common parameters
uuidstringA system generated unique ID (UUID) identifying the tenant that owns the subscription
sub_idintegerIndex of the subscription for which you want to delete a location
idintegerIndex of the customer location you want to delete

URL/Query parameters

N/A

Body

N/A

Response

Status codes

ParameterDescription
204The location was deleted successfully. If the location didn't exist, delete will be considered as being executed successfully
400Error while deleting the location
403The API consumer doesn't have sufficient rights to perform this action
500Uncatched error on server side

Success

Body

N/A