Table of Contents

API : Change Log Get

Introduction

This request will return a single change log entry, with a comparison to the next change of the same item (or its current state).

Request

URL https://api.telecomx.dk/log/changelog/ID
Method GET
Access level VIEWER, MANAGER or OWNER if looking up for own customer
RESELLER if customer belongs to the reseller or a subreseller
RESELLER_ADMIN for any customer and system wide entries (shared PbxMusicOnHold entries are visible to all roles).
Params ID Id of the change log entry.

Query examples

https://api.telecomx.dk/log/changelog/1234567890ABCDEF12345678

Response

Log object (JSON)
_id Id Unique event id.
customer Id Customer the event happened on, null for system-scoped entries.
employee Id Id of the employee who caused the event, null if caused by the system.
when Date Date and time the event took place.
where String Name of the section where the event happened. See the valid section names on List.
what String Type of event: CREATE, UPDATE, DELETE or OTHER.
description String Optional description of what happened, human-readable English language.
hasComparison Boolean Whether a newer state of the item existed to compare against (a later change-log entry, or the item's current state).
changes Change[] One entry per property of this entry's data snapshot (and the compared state). Always included; the `changed` flag marks the properties that differ.
changes[].key String Name of key, e.g ratePlan, name, notes.
changes[].oldValue any The value in this entry's snapshot.
changes[].newValue any The value in the next change of the item (or its current state). Absent when there is nothing to compare to.
changes[].changed Boolean True when the value differs between the two states.
data Object The item as it looked like at creation (if what=CREATE) or how the item looked like before it was updated or deleted (what=UPDATE or DELETE). Always included.
impersonatedBy Id Id of impersonator, if user was impersonated.
impersonatedBySystem Boolean If the user was impersonated by the system, e.g a scheduled job is performed on the user's behalf.

Note that properties holding no value may be omitted from the object.

Example

{
  "_id": "1234567890ABCDEF12345678",
  "customer": "2234567890ABCDEF12345678",
  "employee": "1234574890ABCDEF12345678",
  "when": "2014-01-01T12:34:56.123Z",
  "where": "Employees",
  "what": "UPDATE",
  "description": "Password has been reset",
  "hasComparison": true,
  "data": {
    "_id": "3234567890ABCDEF12345678",
    "name": "Jens Mogensen"
  },
  "changes": [
    {
      "key": "name",
      "oldValue": "Jens Mogensen",
      "newValue": "Jens M. Mogensen",
      "changed": true
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
404 not_found Not found
422 id Id is not a valid change log id.
500 internal_error <Unspecified>