Import Phone Templates

Imports templates from a .cust file. Upload the file to the storage service to obtain a resource ID first, and this API decrypts the file and imports the templates. Partial success is supported.

Request URL

POST {base_url}/uc-cautop/api/v1/phone-templates/import-cust

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code No String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
resourceId Yes String The resource ID of the .cust file that has been uploaded to the storage service.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Import_Result> The import result.
Import_Result
Parameter Type Description
successCount Integer The number of templates imported successfully.
failedCount Integer The number of templates that fail to be imported.
failures Array<Import_Failure_Item> The list of templates that fail to be imported, with failure reasons.
templates Array<Phone_Template> The list of templates imported successfully.
Import_Failure_Item
Parameter Type Description
index Integer The index of the failed template in the .cust file.
name String The name of the failed template.
code String The error code of the failure.
message String The description of the failure reason.
Phone_Template
Parameter Type Description
id String The unique ID of the template.
ucId String The UC ID of the visible scope. Compare this parameter with the uc_id of the current logged-in user to determine whether the template is created by the user.
ownerType String

The type of the owner:

  • admin: The administrator.
  • reseller: The reseller.
ownerId String The ID of the owner, which determines the ownership together with ownerType.
name String The name of the template, which is unique under the same administrator.
templateType String

The type of the template:

  • default: The system default template, which is synchronized from AppCenter.
  • basic / advanced / custom: The custom template types.
vendor String The identifier of the phone vendor.
supportedModels Array<String> The list of phone models supported by the template.
phoneType String

The type of the device:

  • deskphone: The desk phone.
  • conferencephone: The conference phone.
  • dect: The DECT wireless phone.
baseTemplateId String The ID of the base template, which is returned only for custom templates and points to the default template that the custom template is derived from.
schemaJson String The configuration schema in JSON Schema format, which describes the structure, field types, default values, and validation rules of configJson.
configJson String The user configuration values in JSON format, which is returned only for custom templates.
templateContent String The template content in Go template format. When rendering, the values in configJson are substituted into the template variables to generate the final configuration file.
outputFilename String The output file name pattern, which supports variables such as {mac}. For example, {mac}.cfg.
outputFormat String The format of the output file, such as cfg, xml, or conf.
description String The description of the template.
version String The version number of AppCenter, which is used to detect whether the template has updates.
createdAt String The creation time, in Unix timestamp format (seconds).
updatedAt String The last update time, in Unix timestamp format (seconds).
linekeys Array<Linekey_Data> The linekey configurations of the template.
numberOfHandsets Integer The number of handsets supported by the DECT phone. The value is 0 for non-DECT phones.
ownerEmail String The email address of the owner primary account, which is used by the front end to display the owner field.
configFile Object<File_Resource_Ref> The reference of the original mac.cfg file.
templateFile Object<File_Resource_Ref> The reference of the original zip file.
assignTo Object<Assign_To> The assignment scope of the template.
Linekey_Data
Parameter Type Description
model String The phone model that the linekey configuration applies to.
content String The content of the linekey configuration.
File_Resource_Ref
Parameter Type Description
resourceId String The resource ID of the file.
fileName String The name of the file.
fileSize String The size of the file, in bytes.
Assign_To
Parameter Type Description
myTenantAssignment Object<My_Tenant_Assignment> The assignment to the own tenant.
resellerAssignment Object<Reseller_Assignment> The assignment to resellers.
My_Tenant_Assignment
Parameter Type Description
enabled Boolean

Whether the resource is assigned to the admin's own tenant.

  • true: Assigned.
  • false: Not assigned.
scope String

The assignment scope. This parameter takes effect only when the value of enabled is true.

  • all: Visible to all tenants directly under the admin.
  • specific: Visible only to the tenants specified by tenantCodes.
tenantCodes Array<String> The list of tenant codes. This parameter takes effect only when the value of scope is specific.
Reseller_Assignment
Parameter Type Description
enabled Boolean

Whether the resource is assigned to resellers.

  • true: Assigned.
  • false: Not assigned.
scope String

The assignment scope. This parameter takes effect only when the value of enabled is true.

  • all: Visible to all resellers except those specified by excludedResellerIds.
  • specific: Visible only to the resellers specified by resellers.
resellers Array<Reseller_Assign_Item> The list of reseller assignments. This parameter takes effect only when the value of scope is specific.
excludedResellerIds Array<String> The list of excluded reseller IDs. This parameter takes effect only when the value of scope is all.
Reseller_Assign_Item
Parameter Type Description
resellerId String The user ID of the reseller.
tenantScope String

The tenant visibility scope under the reseller.

  • all: Visible to all tenants under the reseller.
  • specific: Visible only to the tenants specified by tenantCodes.
tenantCodes Array<String> The list of tenant codes. This parameter takes effect only when the value of tenantScope is specific.