Update a Custom Phone Template

Updates a custom phone template. Only custom templates can be updated, and the configuration values and description can be modified.

Request URL

PUT {base_url}/uc-cautop/api/v1/phone-templates/{id}

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.
Path parameters
Parameter Required Type Description
id Yes String The ID of the custom template. You can obtain the ID using the Search Custom Phone Templates interface.
Body parameters
Parameter Required Type Description
configJson No String The updated configuration values. If this parameter is not specified, the current values are kept.
description No String The updated description. If this parameter is not specified, the current value is kept.
templateContent No String The updated main template content, which applies to advanced templates. If this parameter is not specified, the current value is kept.
linekeys No Array<Linekey_Data> The updated linekey configurations.
configFileResourceId No String The resource ID used to replace the original mac.cfg file. The value 0 keeps the current file. This parameter applies only to custom templates with a system vendor.
templateFileResourceId No String The resource ID used to replace the original zip file. The value 0 keeps the current file. This parameter applies only to custom templates with a custom vendor.
name No String The updated template name. If this parameter is not specified, the current value is kept.
assignTo No Object<Assign_To> The updated assignment scope of the template.
Linekey_Data
Parameter Required Type Description
model No String The phone model that the linekey configuration applies to.
content No String The content of the linekey configuration.
Assign_To
Parameter Required Type Description
myTenantAssignment No Object<My_Tenant_Assignment> The assignment to the own tenant.
resellerAssignment No Object<Reseller_Assignment> The assignment to resellers.
My_Tenant_Assignment
Parameter Required Type Description
enabled No Boolean

Whether to assign the resource to the admin's own tenant.

Valid value:

  • true: Assigned.
  • false (or omitted): Not assigned.
scope No String

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

Valid value:

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

Whether to assign the resource to resellers.

Valid value:

  • true: Assigned.
  • false (or omitted): Not assigned.
scope No String

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

Valid value:

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

The tenant visibility scope under the reseller.

Valid value:

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

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<Phone_Template> The template after the update.
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.

Example

Request example

PUT /uc-cautop/api/v1/phone-templates/371100695713411072 HTTP/1.1
Host: api.cn.novoone.com
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gxDahs9s3p-A02J3zEQrsHDCFM4KtB-9wm8e1j26rl_cfC14BIxo0BeZLSAuAEVnEXwpVdSBEXOu9PA
x-tenant-code: jint
Content-Type: application/json
{
  "description": "ait-doc-updated"
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "0fe4f58eb4667e1ed71668b7785651dc",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "id": "371100695713411072",
    "ucId": "3076913644890832896",
    "ownerType": "admin",
    "ownerId": "3076913644915998720",
    "name": "aitdoc-tpl-44500",
    "templateType": "basic",
    "vendor": "Fanvil",
    "supportedModels": [
      "P103G",
      "P103P",
      "P104G",
      "P101P",
      "P103W"
    ],
    "phoneType": "deskphone",
    "baseTemplateId": "336400601608613888",
    "schemaJson": "(schema json omitted)",
    "configJson": "{}",
    "templateContent": "(template content omitted)",
    "outputFilename": "",
    "outputFormat": "cfg",
    "description": "ait-doc-updated",
    "version": "1.0.4",
    "createdAt": "1792544500",
    "updatedAt": "1792544500",
    "linekeys": [],
    "numberOfHandsets": 0,
    "ownerEmail": "",
    "configFile": null,
    "templateFile": null,
    "assignTo": null
  }
}