Add a Custom Phone Template
Adds a custom phone template, which is derived from a system template and inherits the schema and template content of the base template.
Request URL
POST {base_url}/uc-cautop/api/v1/phone-templates/custom
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 name Yes String The name of the template, which must be unique under the same administrator. type Yes String The type of the custom template.
Valid value:
basicadvancedcustom
baseTemplateId No String The ID of the base default template. This parameter is required for basic, advanced, and custom templates with a system vendor, and is prohibited for custom templates with a custom vendor. You can obtain the ID using the Search Default Phone Templates interface. configJson No String The user custom configuration values in JSON format. This parameter is required for basic templates, optional for advanced templates, and parsed and written back by the server for custom templates. vendor No String The phone vendor. This parameter is required for custom templates and is prohibited for basic and advanced templates. model No String The phone model. This parameter is required for custom templates. For a custom template with a system vendor, the server automatically appends the _CUST suffix. phoneType No String The type of the device. This parameter is required for custom templates.
Valid value:
deskphoneconferencephonedect
configFileResourceId No String The resource ID of the original mac.cfg file. This parameter is required for custom templates with a system vendor and is prohibited for other branches. templateFileResourceId No String The resource ID of the original zip file. This parameter is required for custom templates with a custom vendor and is prohibited for other branches. templateContent No String The main content of the advanced template in Go template format. This parameter is required for advanced templates. linekeys No Array<Linekey_Data> The linekey configurations. description No String The description of the template. assignTo No Object<Assign_To> The 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 the assignment to the own tenant is enabled. scope No String The assignment scope. tenantCodes No Array<String> The list of tenant codes.
- Reseller_Assignment
-
Parameter Required Type Description enabled No Boolean Whether the assignment to resellers is enabled. scope No String The assignment scope. resellers No Array<String> The list of resellers. excludedResellerIds No Array<String> The list of excluded reseller IDs.
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.
|
| 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 created custom template. |
- 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.
Example
Request example
POST /uc-cautop/api/v1/phone-templates/custom HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkaXN0cmlidXRvcmV4YW1wbGVAb3V0bG9vay5jb20iLCJhcHBfa2V5Ijoic2xOdnQzaHc1NXB2Vm5HRlNhR2ZOVTNmMWxYQ3lpa08iLCJncmFudF90eXBlIjoib3BlbmFwaSIsImNsaWVudF9leHQiOnsiZGVzY3JpcHRpb24iOiLnrKzkuInmlrnlkIjkvZzkvJnkvLTlupTnlKgiLCJwYXJ0bmVyIjoi56S65L6L5ZCI5L2c5LyZ5Ly0In0sImNsaWVudF90eXBlIjoib3BlbmFwaSIsImV4cCI6MTc5MjU2NjA5OSwiaWF0IjoxNzkyNTQ0NDk5LCJqdGkiOiI3NjY2ZWU3Ny0zZTYwLTQxMGEtOTQyMy1hOTRlZmNlZjYwMjYiLCJjbGllbnRfaWQiOiJub3ZvLW9wZW4tcGxhdGZvcm0iLCJ1c2VyX2V4dCI6eyJyb2xlSWRzIjpbM10sInN0eXBlIjoiQURNSU4iLCJ0ZW5hbnRDb2RlIjpudWxsLCJ0eXBlIjoiUF9BQ0NPVU5UIiwidXNlcklkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJlbWFpbCI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInVzZXJuYW1lIjoiZGlzdHJpYnV0b3JleGFtcGxlQG91dGxvb2suY29tIiwidWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5Nn19.zQ5trUGZLZpONqSK-W4IYwft0hfjEAEQ1Yltse27gR0Wfec--msHIKXs3Ukvc9kKdU04IplkNgtjj_iHr31STcCdu_XAfU3E3A2AiNzkcd1f6jwIqs3_ZVOkQLLgwUkpRY_6vWkhOmwlyU8L4ue2n03eoYRU__IdHlECXTSh9P-QmPUWF2Sxti8zctDpA6QqeoSnIO5ChKHC8n8IG9k82HKfigG5SrFkD9MR6EOUjw3feqFH9mVJvuL61ZPYBhJ29hHo7hsgxDahs9s3p-A02J3zEQrsHDCFM4KtB-9wm8e1j26rl_cfC14BIxo0BeZLSAuAEVnEXwpVdSBEXOu9PA
Content-Type: application/json
{
"name": "aitdoc-tpl-44500",
"type": "basic",
"baseTemplateId": "336400601608613888",
"configJson": "{}",
"description": "ait-doc-test"
}
Response example
HTTP/1.1 200 OK { "requestId": "7704a066cd5a259ebe51483038751a6b", "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-test", "version": "1.0.4", "createdAt": "1792544500", "updatedAt": "1792544500", "linekeys": [], "numberOfHandsets": 0, "ownerEmail": "", "configFile": null, "templateFile": null, "assignTo": null } }