Skip to content

Instantly share code, notes, and snippets.

@joesankey
Created October 28, 2016 19:42
Show Gist options
  • Save joesankey/0f06e60f15e14f68c9b24508e9372b1f to your computer and use it in GitHub Desktop.
Save joesankey/0f06e60f15e14f68c9b24508e9372b1f to your computer and use it in GitHub Desktop.

Adhoc Metrics API

Naming

The name of the metric is composed of the resource, prefixed with the adjective and suffixed with the action.

For example the "number of people who created a room" metric is totalRoomsCreated.

  • total = adjective

  • rooms = resource

  • created = action

Number of People that favorited a room = totalRoomsFavorited

Querying

start - (specified in UTC, ISO8601) start date for computing metrics 
end - (specified in UTC, ISO8601) end date for computing metrics 
interval - (day, week, month) the length of the period to calculate metrics from the start date, rounding up to the complete the interval
max - the maximum number of results to return

GET https://api.ciscospark.com/metrics/adhoc?start=YYYYMMdd&end=YYYYMMdd&interval=day&max=10

{
	items: [
			{
				start: 2016-10-28T00:00:00.000Z,
				end: 2016-10-29T00:00:00.000Z,
				totalRoomsCreated: 500, 
				directRoomsCreated: 150,
				groupRoomsCreated: 350,
				averageRoomsCreated: 10	
				...
			}, 
			{
				start: 2016-10-28T00:00:00.000Z,
				end: 2016-10-29T00:00:00.000Z,
				totalRoomsCreated: 500,
				directRoomsCreated: 150,
				groupRoomsCreated: 350,
				averageRoomsCreated: 10	
				...
			}
			...
	]
}

###Pagination

Pagination should be supported as outlined in the developer docs : https://developer.ciscospark.com/pagination.html

More examples


	totalRoomsCreated -> numberOfPeopleThatCreatedRoom
	totalContentCreated -> numberOfPeopleThatSharedContent
	totalMessagesCreated -> numberOfPeopleThatPostedAMessage
	totalMessagesRead -> numberOfPeopleThatReadAMessage
	totalMeetingsJoined -> numberOfPeopleThatJoinedAMeeting
	totalMeetingsCreated -> numberOfPeopleThatPlacedAMeeting
	totalRoomsFavorited -> numberOfPeopleThatFavoritedARoom
	totalUCMeetingsCreated -> numberOfPeopleThatPlacedASparkUCMeeting
	totalSparkActions -> unionOfAllPeopleWhoHaveDoneTheAbove
	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment