GET /api/report_templates
Lister tous les modèles de rapport

GET /api/locations/:location_id/report_templates
Lister tous les modèles de rapport par emplacement

GET /api/organizations/:organization_id/report_templates
Lister tous les modèles de rapport par organisation

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

search
optionel

filtrer les résultats

Validations:

  • Must be a String

order
optionel

Champ et sens de tri, ex: 'id DESC'

Validations:

  • Must be a String

page
optionel

Numéro de la page, commençant par 1

Validations:

  • Must be a number.

per_page
optionel

Nombre de résultats par page à renvoyer

Validations:

  • Must be a number.

Rechercher les champs

Nom du champ Type Valeurs possibles
default true, false
location
location_id
locked true, false
name
organization
organization_id
snippet true, false
template

GET /api/report_templates/:id
Afficher un modèle de rapport

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/report_templates
Créer un modèle de rapport

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

report_template
requis

Validations:

  • Must be a Hash

report_template[name]
requis

Validations:

  • Must be a String

report_template[description]
optionel , nil autorisé

Validations:

  • Must be a String

report_template[template]
requis

Validations:

  • Must be a String

report_template[snippet]
optionel , nil autorisé

Validations:

  • Must be one of: true, false, 1, 0.

report_template[audit_comment]
optionel , nil autorisé

Validations:

  • Must be a String

report_template[locked]
optionel , nil autorisé

Indique si le modèle peut être modifié

Validations:

  • Must be one of: true, false, 1, 0.

report_template[default]
optionel , nil autorisé

Indique si le modèle est ajouté automatiquement aux nouvelles organisations et aux nouveaux emplacements

Validations:

  • Must be one of: true, false, 1, 0.

report_template[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

report_template[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type


POST /api/report_templates/import
Importer un modèle de rapport

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

report_template
requis

Validations:

  • Must be a Hash

report_template[name]
optionel

Nom de modèle

Validations:

  • Must be a String

report_template[template]
optionel

contenu du modèle, notamment les métadonnées

Validations:

  • Must be a String

report_template[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

report_template[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type

options
optionel

Validations:

  • Must be a Hash

options[force]
optionel , nil autorisé

à utiliser si vous voulez mettre à jour les modèles verrouillés

Validations:

  • Must be one of: true, false, 1, 0.

options[associate]
optionel , nil autorisé

détermine quand le modèle doit associer des objets en fonction de métadonnées, 'nouveau' signifie uniquement lors de la création d'un nouveau modèle, 'toujours' signifie à la fois pour les modèles nouveaux et existants en cours de mise à jour, 'jamais' ignore les métadonnées

Validations:

  • Must be one of: new, always, never.

options[lock]
optionel , nil autorisé

Verrouiller les modèles importés (faux par défaut)

Validations:

  • Must be one of: true, false, 1, 0.

options[default]
optionel , nil autorisé

Définit le modèle par défaut, signifiant qu'il sera automatiquement associé aux nouvelles organisations et nouveaux emplacements (faux par défaut)

Validations:

  • Must be one of: true, false, 1, 0.


GET /api/report_templates/revision

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

version
optionel

version de modèle

Validations:

  • Must be a String


PUT /api/report_templates/:id
Mettre à jour un modèle de rapport

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be a String

report_template
requis

Validations:

  • Must be a Hash

report_template[name]
optionel

Validations:

  • Must be a String

report_template[description]
optionel , nil autorisé

Validations:

  • Must be a String

report_template[template]
optionel

Validations:

  • Must be a String

report_template[snippet]
optionel , nil autorisé

Validations:

  • Must be one of: true, false, 1, 0.

report_template[audit_comment]
optionel , nil autorisé

Validations:

  • Must be a String

report_template[locked]
optionel , nil autorisé

Indique si le modèle peut être modifié

Validations:

  • Must be one of: true, false, 1, 0.

report_template[default]
optionel , nil autorisé

Indique si le modèle est ajouté automatiquement aux nouvelles organisations et aux nouveaux emplacements

Validations:

  • Must be one of: true, false, 1, 0.

report_template[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

report_template[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type


DELETE /api/report_templates/:id
Supprimer un modèle de rapport

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be a String


POST /api/report_templates/:id/clone
Cloner un modèle

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

report_template
requis

Validations:

  • Must be a Hash

report_template[name]
requis

Nom de modèle

Validations:

  • Must be a String


GET /api/report_templates/:id/export
Exporter un modèle de rapport vers ERB

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/report_templates/:id/generate
Générer un rapport à partir d'un modèle

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

input_values
optionel

Le hachage des valeurs d'entrée où key est le nom de l'entrée, value est la valeur de cette entrée

Validations:

  • Must be a Hash

gzip
optionel

Compresser le rapport avec gzip

Validations:

  • Must be one of: true, false, 1, 0.

report_format
optionel

Report format, defaults to 'csv'

Validations:

  • Must be one of: csv, json, yaml, html.


POST /api/report_templates/:id/schedule_report
Planifier la génération d'un rapport

The reports are generated asynchronously. If mail_to is not given, action returns an url to get resulting report from (see report_data).

Exemples

POST /api/report_templates/:id/schedule_report/
200
{
  "job_id": UNIQUE-REPORT-GENERATING-JOB-UUID
  "data_url": "/api/v2/report_templates/1/report_data/UNIQUE-REPORT-GENERATING-JOB-UUID"
}

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

input_values
optionel

Le hachage des valeurs d'entrée où key est le nom de l'entrée, value est la valeur de cette entrée

Validations:

  • Must be a Hash

gzip
optionel

Compresser le rapport avec gzip

Validations:

  • Must be one of: true, false, 1, 0.

mail_to
optionel

If set, scheduled report will be delivered via e-mail. Use ',' to separate multiple email addresses.

Validations:

  • Must be a String

generate_at
optionel

UTC time to generate report at

Validations:

  • Must be a String

report_format
optionel

Report format, defaults to 'csv'

Validations:

  • Must be one of: csv, json, yaml, html.


GET /api/report_templates/:id/report_data/:job_id
Télécharger un rapport généré

Returns the report data as a raw response. In case the report hasn't been generated yet, it will return an empty response with http status 204 - NoContent.

Paramètres

Nom du paramètre Description
location_id
optionel

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optionel

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

job_id
requis

ID assigned to generating job by the schedule command

Validations:

  • Must be a String