Create Audit Log Subscription

Create a subscription to receive an event every time a setting is changed (audit log).

POST/?object=event&action=create&model=auditlog

Request URL

POST
https://uc.hopdial.com/ns-api/?object=event&action=create&model=auditlog

Send your access token in the Authorization: Bearer header. Body parameters are sent as application/x-www-form-urlencoded. New to the API? Start with authentication and rate limits.

Event payload fields

ParametersDescription
time_stampTime of change in GMT
by_domainDomain of the user who made the change
by_clientThe API client who made the change
by_ipThe IP address of the user who made the change
actionThe action performed. Example: create, update, delete
target_hostNMS host where change took place
target_domainDomain of the object that was changed
target_userUser of the object that was changed
target_objectThe type of object that was affected. Examples: Subscriber, Hunt Group, ...
parameterThe parameters of the Object after the change
territoryThe territory of the object changed

Parameters

NameTypeDescription
model
requiredbody
string

Must be "auditlog". This will stream any changes to the audit log, adds, updates and deletes for all objects.

domain
requiredbody
string

Specify which domain you would like to receive events for. Use * to receive events for all domains.

user
requiredbody
string

Specify which user to receive events for. Use * to receive for all users

post_url
requiredbody
string

HTTP or HTTPS endpoint. This is where HopDial will POST the events

expires
requiredbody
string (date)

Specifies when the subscription will expire. (Set date a couple days in the future as server time calculates the expiration incorrectly)

Example request

text
curl https://uc.hopdial.com/ns-api/ \
   -H 'Authorization: Bearer 7bet078rqljh451l31uh34lsd0f80dsf' \
   -d object='event' \
   -d action='create' \
   -d model='auditlog' \
   -d domain='abc-company.11111.service' \
   -d user='*' \
   -d post_url='https://events.example.com/auditlogs'
   -d expires='2016-11-20 00:00:00'

Responses

200 · application/json
[  
   {  
      "time_stamp":"2016-06-02 13:59:47",
      "by_domain":"0000.11111.service",
      "by_user":"abc.company",
      "by_client":"11111.client",
      "by_ip":"1.2.3.4",
      "action":"delete",
      "target_host":"pbx.example.net",
      "target_domain":"abc-company.11111.service",
      "target_user":"9005",
      "target_object":"Hunt Group",
      "parameter":"aor=\"sip:[email protected]\", opt=\"manual\", ans=\"no\", ord=\"55\"pri=\"55\"",
      "territory":"11111"
   }
]

More Subscriptions endpoints

Webhooks: get call, CDR, recording, presence, agent, and audit events POSTed to your own URL.

Need a Client ID and Client Secret or help with this endpoint? Contact HopDial support or call (866) 305-0407.