Example API calls for Event Manager


This page contains a few examples for both

  • the API calls for Event Manager in cURL.
  • Example event notifications for different services

To see all available APIs please go to the resources page.


Example API Calls

Operation Example Call
Create a Delivery Configuration
curl -X POST 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]" 
-H "Content-Type: application/json" 
-d '{
"del-cfg-nm":"",
"del-prtcl-cd":"REST",
"addr":"",
"del-fmt-cd":"JSON","is-active":true
}' 
"https://api.syniverse.com/ess/v1/delivery-configurations"
		
Get available topics
 curl -X GET 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]"  
"https://api.syniverse.com/ess/v1/topics/"
		
Create a topic subscription
 curl -X POST 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]" 
-H "Content-Type: application/json"
-d '{
    "del-cfg-id": "",
    "start-date": "",
    "end-date": null
}'
 "https://api.syniverse.com/ess/v1/topics/SCG-Message/subscriptions"
		
Get all delivery configurations
 curl -X GET 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]"
"https://api.syniverse.com/ess/v1/delivery-configurations"
		
Get summary of Event Deliveries
 curl -X GET 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]"
"https://api.syniverse.com/ess/v1/event-deliveries/summary"
		
Get a count of how many unique phone numbers are being monitored for lifecycle events
curl -X GET 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]" 
"https://api.syniverse.com/ess/v1/topic-subscriptions/uniqueMdnCount"
		
An example JSON Response when only one unique phone number is monitored
{ "topic-name": "NIS-Events", "activeCount": 1 }
Check whether a phone number is being monitored for lifecycle events
curl -X GET 
-H "Authorization: Bearer [YOUR ACCESS TOKEN]"  
"https://api.syniverse.com/ess/v1/topic-subscriptions/mdn?topicId=NIS-Events&matchingCriteria=number%20=%20%27%2B447860438585%27"
		
The query url includes two parameters. The topicID is set to NIS-Events. The matchingCriteria is set to number = '+447860438585' which is urlencoded to number%20=%20%27%2B447860438585%27 . The phone number is in international format which includes the leading + sign and the country code.

An example JSON Response for the above query is
{ "paged-result": { "offset": 0, "limit": 50 }, "mdn": "number = '+447860438585'", "topic-name": "NIS-Events", "subscriptions": [ { "delivery-cfg-id": "676", "delivery-cfg-nm": "NumberMonitoring", "events": [ "porting_event" ] } ] }

Example Notifications

Use Case Example Notification
Phone Number Event Notification
Method: POST
Headers
  "X-ESS-EVENT-KEY": "+178XXXXXXXX,",
  "X-ESS-EVENT-TIMESTAMP": "2017-07-12T20:21:00.129Z",
  "CONTENT-TYPE": "application/json; charset=UTF-8"
BODY/PAYLOAD
{"topic":"NIS-Events","attempt":1,"event":{"fld-val-list":{"number":"+178XXXXXXXX","previous_carrier_id":"1025",
"previous_carrier_name":"AT@$# T WIRELESS","tracking_id":"1655272074","deactivation_date":"2017-06-03T04:00:00Z"},
"evt-tp":"deactivation_event","timestamp":"2017-07-12T20:21:00.129Z"},"event-id":"d0qgWF8ERLGn_7JJOGhqNQ"}
		
Mobile Originated SMS Message
Method: POST
Content : application/json
Charset= UTF-8
BODY/PAYLOAD
{"topic":"SCG-Message","attempt":1,"event":{"fld-val-list":{"sender_id_alias":"yKTJEeK90YX01O69igsea1",
"mo_price":0.0025,"company-id":92,"sender_id_id":"yKTJEeK90YX01O69igsea1","message_body":"lc500",
"message_id":"MGNXPPYsA9J0K4ylm4A4a5","to_address":"66863","has_attachment":false,"from_address":"+140XXXXXXXX"},
"evt-tp":"mo_message_received","timestamp":"2017-09-19T20:56:54.519Z"},"event-id":"hU5gsQfhQ2qxkaa6_wKAcA"}
		
True Disconnect Report ready for download
includes the file uri to download the report
Method: POST
Content : application/json
Charset= UTF-8
BODY/PAYLOAD
{ "topic": "MSS-Messages", "attempt": 1, "event": {"fld-val-list": {"creation_time": "2017-10-19T18:46:32Z",
"file_retention_time": 30, "app_name": "ESS", "company-id": 3743, "modified_time": "2017-10-19T18:46:33Z",
"file_uri": "https://lab-api.syniverse.com/mediastorage/v1/files/0d1a9e0f-934e-408b-868c-063653f21e3f/content",
"file_status": "COMPLETE", "file_name": "TRUE_DISCONNECT_EVENT-092017-20171019184626.dat", 
"file_id": "0d1a9e0f-934e-408b-868c-063653f21e3f", "file_tags": "ESS", "expire_time": "2017-11-18T18:46:32Z",     
"file_size": 44 }, "evt-tp": "event_file_complete", "timestamp": "2017-10-19T18:46:33.491Z" },
"event-id": "iagOyZRqRFq7aHgDspCTwg" }
		

Copyright © 2017 Syniverse Technologies