...
Aggiefeed REST API: PUT /api/v1/activity
Headers:
Headers | Comments |
---|---|
Authorization: ApiKey <api key> | Requires API KEY |
Request Parameters:
URL | Description |
---|---|
/api/v1/activity/<activity.object.id> | The activity's object.id |
Request Query Parameters:
Parameter | Description |
---|---|
userId | Deprecated per v1.36.0 : User's 'userId' who is updating the activity. The 'userId' has to match the "actor.author.id". |
status | Activity status ["a", "l"] where "a" = "approval" and "l" = "life" |
URL Examples:
URL | Description |
---|---|
/api/v1/activity/1234-5678-9012?userId=user1&status=a | Update activity where "object.id" == "1234-5678-9012" AND "actor.author.id" == "user1" AND activity is in the approval queue |
/api/v1/activity/1234-5678-9012?userId=user1&status=l | Update activity where "object.id" == "1234-5678-9012" AND "actor.author.id" == "user1" AND activity is part of the "life" (published) stream |
Full Example:
Code Block |
---|
Authorization: ApiKey abcdefgh
HTTP PUT https://aggiefeed.ucdavis.edu/api/v1/activity/1234-5678-9012?userId=user1&status=a
BODY = { "activity" : <activity JSON> }
|
POST Body:
Code Block | ||||
---|---|---|---|---|
| ||||
{
"activity" : {
<activity JSON>
}
}
|
Activity fields: |
Key | Type | Comment | Required (R) | priority | Number | Use 0.0 | 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) | R | ||||
actor.objectType | String | One of ["person", "department"] | R | ||||
actor.displayName | String | Department Name | 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 "updatepost" | R | ||||
title | String | Activity Title | R | ||||
object | Object |
| R | ||||
object.id ucdSrcId | String | Unique Source Content ID | R | ||||
object.objectType | String | Use "notification" | R | ||||
object.content | String | Activity content (Text) | R | ||||
object.ucdEdusModel | Object |
| R | ||||
object.ucdEdusModel.url | String | Activity content related URL | O | ||||
object.ucdEdusModel.urlDisplayName | String | Activity content related URL display name | O | ||||
object.ucdEdusModel.eventDate | String | Date the event will occur. | O | ||||
to | Object | NOTE: The "to" field has to have one or both of the following properties: [ groups, users ] | R | ||||
to.groups | Array | Array of group names: "public", "students", "faculty", "staff" | R / O | ||||
to.users | Array | Array of user kNames | R / O | ||||
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"~academic", "~student-life", "campus~campus-life", "~campus-messages"] | R | ||||
ucdEdusMeta.startDate | String | ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ | O | ||||
ucdEdusMeta.endDate | String | ISO-8601 Date format YYYY-MM-DDTHH:mm:ss.SSSZ | O | ||||
ucdEdusMeta.authzId | String | Same as actor.author.id | R | ucdEdusModel | Object |
| R |
ucdEdusModel.url | String | Activity content related URL | O | ||||
ucdEdusModel.urlDisplayName | String | Activity content related URL display name | O | ||||
ucdEdusModel.eventDate | String | Date the event will occur. |
...
O
Sample request body containing the activity (JSON):
Code Block | ||||
---|---|---|---|---|
| ||||
{ "activity" : { "priority": 0.0, "icon": "icon-comment-alt", "actor": { "id" : "department identifier", "objectType": "person", "displayName": "Department Name", "author" : { "id" : "kName", "displayName" : "FirstName LastName" } }, } }, "verb": "updatepost", "title": "Test Notification", "object": { "id "ucdSrcId" : "content identifier", "objectType": "notification", "content": "This is a test notification", "ucdEdusModel" : { "url" }, : "http://ucdavis.edu", "urlDisplayName" : "UC Davis" } }, "to" : { "groups" : ["students", "faculty"], "users" : [] }, "ucdEdusMeta" : { "labels" : ["academic"~academic", "some-label"], "authzId" : "<Same as actor.author.id>", "startDate" : "date string", "endDate" : "date string" }, "ucdEdusModel" : { "url" : "", "urlDisplayName" : "" } } } }} |