MOR API v2 cdr export templates

From Kolmisoft Wiki
Jump to navigationJump to search

List and show CDR Export Templates through MOR API v2. Behavior matches SETTINGS → CDR → Export → Templates in the GUI (see CDR Export Templates for column meanings). Templates cannot be created or edited through this API — use the GUI for create/edit.

All endpoints require a valid Bearer token, admin user type, and v2_cdr_export_templates_index or v2_cdr_export_templates_show on the user’s API permission group (section CDR Export).



Quick start =

Obtain a token (see MOR API v2 authentication), then:

# List CDR export templates (admin-owned templates with at least one column)
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://your-mor.example/api/v2/cdr_export_templates"

# Show one template
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://your-mor.example/api/v2/cdr_export_templates/5"



Endpoints =

Method Path Permission Description
GET /cdr_export_templates v2_cdr_export_templates_index List templates owned by the authenticated admin (non-empty column set only).
GET /cdr_export_templates/{id} v2_cdr_export_templates_show Show one template (id, name, columns, column_count).



Example responses =

List (200): array of template objects with id, name, columns, column_count.

Not found (404): { "error": "CDR export template was not found" }

ACL denied (401): { "errors": "API method not permitted: v2_cdr_export_templates_index" }

Unauthorized role (401): { "errors": "Unauthorized" } — accountant and user types cannot call these endpoints.



See also