client.templates.post_scripts

A method of the Templates endpoint.

post_scripts(script_id: int, name: str, *, note: str = None, ui_report_id: int = None, archived: bool = None, hidden: bool = None) Response

Create a Script Template

API URL: POST /templates/scripts

import civis
client = civis.APIClient()
response = client.templates.post_scripts(...)
Parameters:
script_idint

The id of the script that this template uses.

namestr

The name of the template.

notestr, optional

A note describing what this template is used for; custom scripts created off this template will display this description.

ui_report_idint, optional

The id of the report that this template uses.

archivedbool, optional

Whether the template has been archived.

hiddenbool, optional

The hidden status of the item.

Returns:
civis.Response
  • id : int

  • publicbool

    If the template is public or not.

  • script_idint

    The id of the script that this template uses.

  • script_typestr

    The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)

  • user_contextstr

    The user context of the script that this template uses.

  • paramsList[civis.Response]

    A definition of the parameters that this template’s backing script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valueobject

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valuesList[civis.Response]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • namestr

    The name of the template.

  • categorystr

    The category of this template.

  • notestr

    A note describing what this template is used for; custom scripts created off this template will display this description.

  • created_at : str (time)

  • updated_at : str (time)

  • use_countint

    The number of uses of this template.

  • ui_report_idint

    The id of the report that this template uses.

  • tech_reviewedbool

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedbool

    Whether the template has been archived.

  • hiddenbool

    The hidden status of the item.

  • authorcivis.Response
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.