Aggiefeed REST API POST api_v1_activity
Aggiefeed REST API: POST /api/v1/activity
Headers:
Headers | Comments |
---|---|
Authorization: ApiKey <api key> | Requires API KEY |
Full Example:
Authorization: ApiKey abcdefgh HTTP POST https://aggiefeed.ucdavis.edu/api/v1/activity BODY = { "activity" : <activity JSON> }
POST Body:
{ "activity" : { <activity JSON> } }
Activity fields:
Aggiefeed Activity Model:
Key | Type | Comment | Required (R) |
---|---|---|---|
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.image | Object | O | |
actor.image.color | String | HEX 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 | |
generator | Object | 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.id | String | References the activity source connectorId. | R |
object.id | String | If not provided, the server will generate the "id" using: crypto.createHash('sha256').update(activity.actor.id + activity.object.ucdSrcId).digest('hex') | O |
object.hash | String | Server sets this for activity of type "event" crypto.createHash("sha256").update(activity.title + activity.object.content + activity.object.ucdEdusModel.event.startDate + | 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.contentImage | Object | O | |
object.contentImage.dimensions | Object | Object holds information for a "normal" and "high" resolution image | R |
object.contentImage.dimensions.normal | Object | Object holds information for the "normal" resolution image max-width: 400px; max-height: 300px | R |
object.contentImage.dimensions.normal.url | String | Image url NOTE:
| R |
object.contentImage.dimensions.normal.width | Number | This is the image width | R |
object.contentImage.dimensions.normal.height | Number | This is the image height | R |
object.contentImage.dimensions.high | Object | 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.url | String | Image url NOTE:
| R |
object.contentImage.dimensions.high.width | Number | This is the image width | R |
object.contentImage.dimensions.high.height | Number | This is the image height | R |
object.contentImage.source | String | Source is a predefined string that identifies the image's storage location:
| 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.hasStartTime | Boolean | Set this to false if the activity is an all day event, without a start time. Otherwise true. | R |
object.ucdEdusModel.event.hasEndTime | Boolean | Set this to false if the activity is an all day event, without an end time. Otherwise true. | R |
object.ucdEdusModel.event.location | String | NOTE: Eventually, this will be deprecated. See object.location object | R |
object.ucdEdusModel.event.startDate | String | 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 | R |
object.ucdEdusModel.event.endDate | String / 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 | O |
object.ucdEdusModel.event.isAllDay | Boolean | true or false | O |
object.location | Object | O | |
object.location.displayName | String | Location display name | R |
object.location.geo | Object | O | |
object.location.geo.latitude | String | "27.9881" | R |
object.location.geo.longitude | String | "86.9253" | R |
object.location.geometry | Object | O | |
object.location.geometry.type | String | "Point" | R |
object.location.geometry.coordinates | Array | [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 | 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"] | R |
ucdEdusMeta.startDate | String / null | ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ 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 | O |
Sample request body containing the activity (JSON):
{ "activity" : { "icon": "icon-comment-alt", "actor": { "id" : "department identifier", "objectType": "person", "displayName": "Department Name", "author" : { "id" : "kName", "displayName" : "FirstName LastName" } }, "verb": "post", "title": "Test Notification", "object": { "ucdSrcId" : "content identifier", "objectType": "notification", "content": "This is a test notification", "ucdEdusModel" : { "url" : "http://ucdavis.edu", "urlDisplayName" : "UC Davis" } }, "to" : [ { "id": "public", "g": true, "i": false ], "ucdEdusMeta" : { "labels" : ["~academic", "some-label"], "authzId" : "<Same as actor.author.id>", "startDate" : "date string", "endDate" : "date string" } }}