4.22 Modify Template

This topic provides information on how to modify the application template itself (api/templates/<id>). See 4.23 Modify Template History for information on how to modify the application template's history/version information (api/templates/<history_pk>/history/<version>).

These are the different methods that you can use to modify an application template:

  • PUT – Creates a new application template version and enables you to modify and save template attribute changes to that version. The previous version is saved in the application template's history.
  • PATCH – Lets you change whether the application template is published; all other template attributes, including the template version, remain unchanged.

In this topic:

4.22.1 PUT Method

In this section:

4.22.1.A URL

PUT /api/templates/<id>/

4.22.1.B Parameters

Parameter Required Type Description Example
id Yes Integer ID of the application template 1

4.22.1.C Example

See 4.17 Create Template for additional parameters you can modify.

4.22.2 PATCH Method

You must the correct content type when using the PATCH API. If not specified, the API will consider the type as 'text/html' which might cause side effects in the request processing code.

In this section:

4.22.2.A URL

PATCH /api/templates/<id>/

4.22.2.B Parameters

Parameter Required Type Description Example
id Yes Integer ID of the application template 1

4.22.2.C JSON Structure

The following table identifies the template attributes that can be changed via a PATCH call.

Name Required Type Description
published No Boolean Application template's status: published or unpublished; if the application template is unpublished, then only owner can use it (not generally visible)

4.22.2.D Example

This section provides an example of how to update application template 1 with the published tag unset.

PATCH /api/templates/1/

Request Body

{
  "published": false
}

Response

Related Topics