Tenants Profile Management¶
Retrieve the list of tenants with details¶
-
GET
/api/v1/tenants/
¶ Retrieve the list of all tenants, with the possibility to a filter on the type of tenant.
In case of reseller user and the reseller check on Tenant level is enabled (see below) only the Tenants owned by his Reseller will be returned.
The settings APIO_OBJECT_CREATION and TENANT_DATA=true enables the optional external ids data fields parameters.
Example request:
GET /api/v1/tenants/ HTTP/1.1 Host: example.com { "type": "ServiceProvider", "sizeLimit": 10 }
- Request JSON Object:
backendName (string) – See backendName from Search criteria.
backendExternalName (string) – See backendExternalName from Search criteria.
insensitiveExternalId1Equals (string) – See insensitiveExternalId1Equals from Search criteria.
insensitiveExternalId1Contains (string) – See insensitiveExternalId1Contains from Search criteria.
insensitiveExternalId1Starts (string) – See insensitiveExternalId1Starts from Search criteria.
insensitiveExternalId2Equals (string) – See insensitiveExternalId2Equals from Search criteria.
insensitiveExternalId2Contains (string) – See insensitiveExternalId2Contains from Search criteria.
insensitiveExternalId2Starts (string) – See insensitiveExternalId2Starts from Search criteria.
insensitiveExternalId3Equals (string) – See insensitiveExternalId3Equals from Search criteria.
insensitiveExternalId3Contains (string) – See insensitiveExternalId3Contains from Search criteria.
insensitiveExternalId3Starts (string) – See insensitiveExternalId3Starts from Search criteria.
insensitiveExternalId4Equals (string) – See insensitiveExternalId4Equals from Search criteria.
insensitiveExternalId4Contains (string) – See insensitiveExternalId4Contains from Search criteria.
insensitiveExternalId4Starts (string) – See insensitiveExternalId4Starts from Search criteria.
insensitiveResellerIdEquals (string) – See insensitiveResellerIdEquals from Search criteria.
sizeLimit (integer) – (Optional) The number limit of Tenants to be retrieved.
type (string) – (Optional) see type from Tenant Detail Attributes.
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "tenants": [ { "tenantId": "tenantTest", "name": "Tenant Test", "type": "ServiceProvider" } ] }
Example response with optional external ids:
HTTP/1.1 200 OK Content-Type: "application/json" { "tenants": [ { "externalId1": "Test ValueSP", "externalId2": "", "externalId3": "Customer Test", "externalId4": "ExtId SP", "tenantId": "ApioSpTest", "name": "", "type": "ServiceProvider" }, { "tenantId": "EnterpriseDev", "name": "", "type": "Enterprise" }, { "externalId1": "ENT External", "externalId2": "", "externalId3": "APIO ID Test", "externalId4": "", "tenantId": "ApioEntTest", "name": "", "type": "Enterprise" } ] }
Example request with search criteria:
GET /api/v1/tenants/ HTTP/1.1 Host: example.com { "insensitiveExternalId3Contains": "omer" }
Example response with optional external ids:
HTTP/1.1 200 OK Content-Type: "application/json" { "tenants": [ { "externalId1": "Test ValueSP", "externalId2": "", "externalId3": "Customer Test", "externalId4": "ExtId SP", "tenantId": "ApioSpTest", "name": "", "type": "ServiceProvider" } ] }
- Response JSON Object:
tenants (array) – A list of Tenants. See Tenant Attributes in a List.
- Status Codes:
200 OK – no error
Create a tenant¶
-
POST
/api/v1/tenants/
¶ Add a new tenant.
Note that a reseller user is not allowed to create a Tenant.
The settings APIO_OBJECT_CREATION and TENANT_DATA=true enables the optional external ids data fields parameters.
Example request:
POST /api/v1/tenants/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "tenantId": "newEnterpriseTest", "type": "Enterprise", "defaultDomain": "netaxis.be" }
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "type": "Enterprise", "useCustomRoutingProfile": False, "defaultDomain": "netaxis.be", "tenantId": "newEnterpriseTest", "name": "", "supportEmail": "", "useTenantLanguages": False }
Example request with optional external ids:
POST /api/v1/tenants/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "tenantId": "newEnterpriseTest", "type": "Enterprise", "defaultDomain": "netaxis.be" }
Example response with optional external ids:
HTTP/1.1 200 OK Content-Type: "application/json" { "type": "Enterprise", "useCustomRoutingProfile": False, "defaultDomain": "netaxis.be", "tenantId": "newEnterpriseTest", "name": "", "supportEmail": "", "useTenantLanguages": False, "externalId1": "", "externalId2": "", "externalId3": "", "externalId4": "" }
- Request JSON Object:
tenantId (string) – see tenantId from Tenant Detail Attributes.
type (string) – see type from Tenant Detail Attributes.
defaultDomain (string) – see defaultDomain from Tenant Detail Attributes.
useCustomRoutingProfile (boolean) – see useCustomRoutingProfile from Tenant Detail Attributes.
name (string) – see name from Tenant Detail Attributes.
contactInformation (object) – see contactInformation from Tenant Detail Attributes.
addressInformation (object) – see addressInformation from Tenant Detail Attributes.
useTenantLanguages (boolean) – see useTenantLanguages from Tenant Detail Attributes.
resellerId (string) – (Optional) see resellerId from Tenant Detail Attributes.
externalId1 (string) – (Optional) see externalId1 from Tenant Detail Attributes.
externalId2 (string) – (Optional) see externalId2 from Tenant Detail Attributes.
externalId3 (string) – (Optional) see externalId3 from Tenant Detail Attributes.
externalId4 (string) – (Optional) see externalId4 from Tenant Detail Attributes.
templateName (string) – (Optional) The name of the template to be used during the Tenant creation.
backendName (string) – (Optional) the name of the backend where the Tenant has to be created in case of multi-as set-up
backendExternalName (string) – (Optional) the external name of the backend where the Tenant has to be created in case of multi-as set-up (ignored if backendName is provided)
Example response:
- Response JSON Object:
tenantId (string) – See tenantId from Tenant Detail Attributes. It is provided because it can be auto-generated
type (string) – See type from Tenant Detail Attributes.
defaultDomain (integer) – See defaultDomain from Tenant Detail Attributes.
useCustomRoutingProfile (string) – See useCustomRoutingProfile from Tenant Detail Attributes.
name (string) – See name from Tenant Detail Attributes.
contactInformation (object) – See contactInformation from Tenant Detail Attributes.
addressInformation (object) – See addressInformation from Tenant Detail Attributes.
useTenantLanguages (boolean) – See useTenantLanguages from Tenant Detail Attributes.
resellerId (string) – See resellerId from Tenant Detail Attributes.
externalId1 (string) – see externalId1 from Tenant Detail Attributes.
externalId2 (string) – see externalId2 from Tenant Detail Attributes.
externalId3 (string) – see externalId3 from Tenant Detail Attributes.
externalId4 (string) – see externalId4 from Tenant Detail Attributes.
backendName (string) – (Conditional) the name of the backend where the Tenant is defined. Only returned in case of multi-as user.
backendExternalName (string) – (Conditional) the external name of the backend where the Tenant is defined. Only returned in case of multi-as user and if the value is defined in the related Backend object.
- Status Codes:
201 Created – created with no errors
400 Bad Request – unable to create the Tenant. Among others the following error cases can occur:
INVALID_PARAMETERS (2) related to the reselleId field with message “Unknown Reseller and Reseller auto-creation is not enabled”
ALREADY_EXISTS (11) related to tenantId field with message “Already exists.”
NO_BACKEND_AVAILABLE (61) in case the requested backendName or backendExternalName can not be used by the multi-as admin user. Or of the Tenant belongs to a backend that can not be used by the multi-as admin user.
Template Information for Tenant¶
The template category is tenant
Configuration Information for Tenant Creation¶
In the POST API, the APIO can create a TenantData object and can also auto-create a Reseller object with as name the resellerId if not existing.
The following settings is to instruct the APIO how to manage this:
"APIO_OBJECT_CREATION": {
"TENANT_DATA": true,
"RESELLER": true
},
"MULTI_AS_DEFAULT_BACKEND_FOR_TENANT": "MyBackendName",
"DEFAULT_TEMPLATES": {
"TENANT_CREATE": "default_template_template",
},
- Settings description:
APIO_OBJECT_CREATION: is a set of settings for controlling the auto-creation of different objects in APIO DB (more than the ones only displayed here)
RESELLER if true, if a resellerId is received and the corresponding Reseller does not exist it will be created; if false in same conditions it will be rejected. Default is False.
TENANT_DATA if true, a TenantData object will be created when creating a new Tenant. Note that if a resellerId is provided, a TenantData object will be created in all cases.
MULTI_AS_DEFAULT_BACKEND_FOR_TENANT: for Tenant creation, if a value is defined for this settings and there is no backendName and backendExternalName in the input data, this settings will be used as backendName. The default value is nothing configured.
DEFAULT_TEMPLATES: is a set of settings for defining a default provisioning template for some operations. None are defined by default.
TENANT_CREATE: the default template for Tenant create operation. It must of course be of the template category template.
Configuration Information for Tenants List¶
In the GET API, in case of reseller the APIO checks the TenantData objects if the follwowing settings is enable:
"RESELLER_TENANT": true,
"MULTI_AS_BACKEND_IN_SYSTEM_SEARCH_RESULTS": true,
- Settings description:
RESELLER_TENANT if true and the user is a reseller, the reseller check at Tenant level is enabled. For this API it means that the TenantData objects are checked to returns only the tenants beloging to the same Reseller.
MULTI_AS_BACKEND_IN_SYSTEM_SEARCH_RESULTS: if true, the backendName and backendExternalName of the AS hosting the item will be added in each element of the answer. The default value is true as by default a multi-as user is allowed to see what backend is used.