-
Notifications
You must be signed in to change notification settings - Fork 15
Shift Spec
{ "type": "shift", "createdBy": <string>, "userName": <string>, "href": <string>, "domain": <string>, "space": { "name": <string>, "version": <string>, }, "summary": <string>, "created": <string: utc format parseable date string>, "modified": <string: utc format parseable date string>, "broken": <bool>, "publishData": { "draft": <bool>, "publishTime": <string: utc format parseable date string>, "private": <bool>, "streams": <array: strings> }, "content": <hash-map> }
createdBy: a user id
userName: a user name
href: the url where the shift was created
domain: the domain where the shift was created
space.name: the name of the space
space.version: the version fo the space
summary: user supplied summary of the shift’s content.
created: creation date string. cannot be modified after shift is created.
modified: the last time the shift was modified.
broken: set by the system if the an exception was thrown while attempting to show the shift to a user.
publishData.draft: bool specifying whether the user has published the shift.
publishData.private: bool specifying whehter the publish shift is public.
publishData.publishTime: time the shift was published.
publishData.streams: list of streams the shift is being published to.
content: schemaless hash-map of the shift’s values. Used only by the client to recreate the shift.
Creates a new shift for the logged in user. The Content-type header must be set to application/json.
POST /shift
A JSON string that complies to the Shift schema.
The newly created shift.
Returns the data for a shift if the user has adequate permissions to view it. In order to a view a shift the user must be running as admin, have created the shift, the shift was published to the user, or the user belongs to a stream that the shift was published to. See Also Stream, Permission.
POST /shift/id
A Shift.
Update a shift. The Contente-type header must be set application/json. The JSON string must match the schema.
PUT /shift/id
A JSON string which matches the Shift schema.
The updated shift.
Delete’s a shift as long as there are no comments on this shift.
DELETE /shift/id
ack
Creates a comment on a shift for the loggedin user. The shift must be readable by the user. The Content-type header must be set to application/json.
POST /shift/id/comment
A JSON string with a text field, no other fields are allowed.
The newly created Event.
Returns all the comment Events on the comment Stream for a shift. The user must have read permission for the shift.
GET /shift/id/comments
An array of Events.
Updates the logged in user’s notify array field. If the comment stream is in the user’s notify array field, he/she will be sent a message (Event) to their inbox (message Stream).
POST /shift/id/notify
The updated User.
Removes the shift’s comment stream from the user’s notify array field.
POST /shift/id/unnotify
The updated User.
Publish a shift. Header Content-type must be set to application/json. Can only be done by the creator of the shift or a user running as admin. The shift can be made public (anyone can see it), or shift can be published to a stream.
POST /shift/id/publish
A JSON string with private field or streams array field.
The updated Shift.
Unpublish a shift. Can only be done by the creator of the shift or a user running as admin. This is not possible if someone has commented on the shift.
POST /shift/id/unpublish
The updated Shift.
Adds a Shift to the user’s list of favorites. This can only be done if the logged in user has read permissions for the Shift.
POST /shift/id/favorite
ack