Aggiefeed REST API

Aggiefeed Activity


Resource Representation

{
    "activity" : {
        "icon": "icon-comment-alt",
		"actor": {
        	"id" : "department identifier",
        	"objectType": "person",
        	"displayName": "Department Name",
        	"author" : {
            	"id" : "kName",
            	"displayName" : "FirstName LastName"
        	},
			"image" : {
				"color" : "#f1c40f"
			}
    	},
    	"verb": "post",
    	"title": "Test Event",
    	"object": {
        	"ucdSrcId" : "content identifier",
        	"objectType": "notification",
       		"content": "This is a test notification",
			"contentImage" : {
				"source" : "aggiefeed",
   				"dimensions" : {
       				"normal" : { 
           				"url": "/content/uploads-normal/someId.jpg",
           				"width": 400,
           				"height": 280
       				},
       				"high" : {
           				"url": "/content/uploads-hight/someId.jpg",
           				"width": 650,
           				"height": 460
       				}
			},
        	"ucdEdusModel" : {
       	    	"url" : "http://ucdavis.edu",
            	"urlDisplayName" : "UC Davis",
				"event" : {
					"location": "Event Location",
					"hasStartTime" : true,
					"startDate": "date string",
					"endDate": "date string",
					"isAllDay": false,
					"iCalendar" : "iCal string",
					"addToGoogleCalendar": "string"
				}
        	},
			"location" : {
				"displayName": "Mount Everest",
				"geo" : {
					"latitude": "27.9881",
					"longitude": "86.9253"
				},
				"geometry" : {
					"type": "Point",
					"coordinates": [86.9253, 27.9881]
				}
			}
    	},
    	"to" : [
        	{
				"id": "<kName>",
				"g": false,
				"i": false
			}
    	],
    	"ucdEdusMeta" : {
        	"labels" : ["~academic", "some-label"],
        	"startDate" : "date string",
        	"endDate" : "date string"
    	}
}}


Aggiefeed Activity Model:

Key

Type

Comment

Required (R)
Optional (O)

icon

String

Any available Twitter Bootstrap icon name

R

actor

Object


R

actor.id

String

Unique Actor ID (This will be provided by the Aggie Feed Team). This should be set to the "sourceId".

R

actor.objectType

String

One of ["person", "department"]

R

actor.displayName

String

Department Name

R

actor.imageObject
O
actor.image.colorStringHEX color value e.g. "#f1c40f"R

actor.author

Object


R

actor.author.id

String

Unique Author ID (kName)

R

actor.author.displayName

String

Author Name (FirstName LastName)

R

verb

String

Use "post"

R

title

String

Activity Title

R

object

Object


R

generatorObject

References external aggiefeed activity generator source. e.g. Trumba, Google Calendar, Facebook, RSS, etc.

NOTE: This property is not set for activities that were created via the aggiefeed create post form

O
generator.idStringReferences the activity source connectorId.R
object.idString

If not provided, the server will generate the "id" using:

crypto.createHash('sha256').update(activity.actor.id + activity.object.ucdSrcId).digest('hex')

O
object.hashString

Server sets this for activity of type "event"

crypto.createHash("sha256").update(activity.title + activity.object.content + activity.object.ucdEdusModel.event.startDate +
activity.object.ucdEdusModel.event.endDate + activity.object.ucdEdusModel.urlDisplayName + activity.object.ucdEdusModel.url + activity.object.ucdEdusModel.event.location).digest('hex');

O

object.ucdSrcId

String

Unique Source Content ID

If a source supplies a GUID for the content used in post creation, utilize the provided GUID. If the GUID is not already in UUID v4 format, generate a UUID v4 ID for consistency.

e.g. For RSS aggregation, use the RSS item GUID and convert it to UUID v4

R

object.objectType

String

Use "notification"

R

object.content

String

Activity content (Text)

R

object.contentImageObject
O
object.contentImage.dimensionsObject

Object holds information for a "normal" and "high" resolution image

R
object.contentImage.dimensions.normalObjectObject holds information for the "normal" resolution image max-width: 400px; max-height: 300pxR
object.contentImage.dimensions.normal.urlString

Image url

NOTE:

  • if "object.contentImage.source" = "aggiefeed", then this is a relative URL. e.g. /content/uploads-normal/someId.jpg
  • if "object.contentImage.source" != " aggiefeed", then this is an absolute URL. e.g. https://facebook.com/images/someId.jpg
R
object.contentImage.dimensions.normal.widthNumberThis is the image widthR
object.contentImage.dimensions.normal.heightNumberThis is the image heightR
object.contentImage.dimensions.highObject

Object holds information for the "high" resolution image max-width: 650px; max-height: 490px

NOTE: This is currently only supported if the image was uploaded via aggiefeed. "object.contentImage.source" = "aggiefeed"

O
object.contentImage.dimensions.high.urlString

Image url

NOTE:

  • if "object.contentImage.source" = "aggiefeed", then this is a relative URL. e.g. /content/uploads-normal/someId.jpg
R
object.contentImage.dimensions.high.widthNumberThis is the image widthR
object.contentImage.dimensions.high.heightNumberThis is the image heightR
object.contentImage.sourceString

Source is a predefined string that identifies the image's storage location:

  • aggiefeed
  • facebook
  • campus-calendar
  • etc.


R

object.ucdEdusModel

Object


R

object.ucdEdusModel.url

String

Activity content related URL

O

object.ucdEdusModel.urlDisplayName

String

Activity content related URL display name

This is required if object.ucdEdusModel.url is set.

R

object.ucdEdusModel.event

Object


O

object.ucdEdusModel.event.hasStartTimeBooleanSet this to false if the activity is an all day event, without a start time. Otherwise true.R
object.ucdEdusModel.event.hasEndTimeBooleanSet this to false if the activity is an all day event, without an end time. Otherwise true.R
object.ucdEdusModel.event.locationStringNOTE: Eventually, this will be deprecated. See object.location objectR
object.ucdEdusModel.event.startDateString

Note: If this is an all day event without a start time, set the start time to 8 AM. Also set "hasStartTime" accordingly.

ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ
The date needs to be in Zulu Time
e.g.
2013-07-01T17:00:00.000Z

R
object.ucdEdusModel.event.endDateString / null

Note: If there is no endDate, set it to null and NOT the empty string("").

ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ
The date needs to be in Zulu Time
e.g.
2013-07-01T17:00:00.000Z

O
object.ucdEdusModel.event.isAllDayBooleantrue or falseO
object.locationObject
O
object.location.displayNameStringLocation display nameR
object.location.geoObject
O
object.location.geo.latitudeString
"27.9881"
R
object.location.geo.longitudeString
"86.9253"
R
object.location.geometryObject
O
object.location.geometry.typeString"Point"R
object.location.geometry.coordinatesArray

[86.9253, 27.9881]

 Type: [longitude:number, latitude:number]

R

to

Array

This holds objects of the following form:

Specific User(s) :

{"id": "<kerberos id>", "g": false, "i": false}


Specific Group(s):

{"id": "public", "g": true, "i": false}



R

published

String

ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ
The date needs to be in Zulu Time
e.g.
2013-07-01T17:00:00.000Z

O

ucdEdusMeta

Object


R

ucdEdusMeta.labels

Array

Array of strings. The array needs to contain at least one of the following labels: ["~academic", "~student-life", "~campus-life", "~campus-messages"]
Additional labels that don't have a tilda '~' prefix are allowed.
e.g.
 ["~academic", "hold", "financial-aid"]

R

ucdEdusMeta.startDate

String / null

ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ 
The date needs to be in Zulu Time 
e.g. 
2013-07-01T17:00:00.000Z

NOTE: If this is not set, aggiefeed sets ucdEdusMeta.startDate to the current date & time

O

ucdEdusMeta.endDate

String / null

ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ 
The date needs to be in Zulu Time 
e.g. 
2013-07-01T17:00:00.000Z

O

Methods:



METHOD

HTTP METHOD

URI

Comments

get

GET

/api/v1/activity

Get selected activities based on the used query string parameters

create

POST

/api/v1/activity

Create an activity

update

PUT

/api/v1/activity

Update an activity

delete

DELETE

/api/v1/activity

Delete an activity


Hosts:

Environment

URL

Comments

Production

https://aggiefeed.ucdavis.edu

Ready

Test

https://aggiefeed-test.ucdavis.edu

Ready