CampusAPI Commenting Services API documentation version 0.1.2
Based on OSID version 3.0.0
https://base.url/commenting
Overview
The Commenting service package provides a means of relating user comments and ratings to other Objects.
Commenting may be used as an auxiliary service orchestrated with other service pachages to either provide administrative comments as well as to create a social network style of comment and rating service to various other objects.
This package includes the following entities:
Comments
Comments contain text entries logged by date and Agent. A Comment may also include a rating represented by a Grade defined in a GradeSystem. Rating lookup services may be used to query cumulative scores across an object reference or the entire Book.
Comments are relationships between a commentor and a reference Id. The relationship defines dates for which the comment and/or rating is effective.
Commentors: An Agent comments on something. As a person is represented by a Resource in the Resource service package, the Comments provide access to both the commenting Agent and the related Resource to avoid the need of an additional service orchestration for resolving the Agent
Field | Description | Type |
---|---|---|
id(read‑only) | The unique id of this comment, provided by system. | string(osid‑id) |
uri(read‑only) | The uri of this comment, provided by system. | string(uri) |
displayName | The name of this comment for display. | string |
description | The description of this comment. | string |
genusTypeId (read‑only) | Id of the immutable type of this comment. Default type set by system unless specified in query parameter. | string(osid‑id) |
recordTypeIds (read‑only) | Type Ids of record types available on this comment. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere. | string(osid‑id)[] |
startDate | The starting date of this comment. | string(date‑time) |
endDate | The ending date of this comment. | string(date‑time) |
endReasonId | The reason this comment ended. References a process.State object. | string(osid‑id) |
referenceId (read‑only) | The reference associated with this comment. References an id.Id object. | string(osid‑id) |
commentorId (read‑only) | The commentor associated with this comment. References a resource.Resource object. | string(osid‑id) |
text | The comment text. | string |
ratingId | The Grade. References a grading.Grade object | string(osid‑id) |
Books
Comments are cataloged in Books which may also be grouped hierarchically to federate multiple collections of comments.
Field | Description | Type |
---|---|---|
id(read‑only) | The unique id of this book, provided by system. | string(osid‑id) |
uri(read‑only) | The uri of this book, provided by system. | string(uri) |
displayName | The name of this book for display. | string |
description | The description of this book. | string |
genusTypeId (read‑only) | Id of the immutable type of this book. Default type set by system unless specified in query parameter. | string(osid‑id) |
recordTypeIds (read‑only) | Type Ids of record types available on this book. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere. | string(osid‑id)[] |
providerId | The provider of this book. References a resource.Resource object. | string(osid‑id) |
brandingIds | The branding of this book. References repository.Asset objects. | string(osid‑id)[] |
license | The licensing that applies to this book. | string |
License
CampusAPI REST Documentation Copyright 2020 DXtera Institute. Based on the Open Service Interface Defitions: http://osid.org
/comments
Collection of comments in a system, federation of systems, or in a default book.
Get all comments in the system or default book.
Create a new comment in the default book.
get /comments
Get all comments in the system or default book.
Query Parameters
- offset: (integer - default: 0)
Skip over a number of elements by specifying an offset value for the query
Example:
20
- limit: (integer - default: 10)
Limit the number of elements on the response
Example:
80
- genusTypeId: (string)
The id string to match a genusType
Example:
type.Type%3AexampleCommentType%40dxtera.org
- parentGenusTypeId: (string)
The id string to match a parent genusType
Example:
type.Type%3AparentTypeExampleCommentType%40dxtera.org
- recordTypeId: (string)
The id string to match a recordType
Example:
type.Type%3AexampleCommentType%40campusapi.org
- fromDate: (string)
Get all comments from this date inclusive. Use with toDate to define date range query.
Example:
2020-10-03
- toDate: (string)
Get all comments up to this date inclusive. Use with fromDate to define date range query.
Example:
2020-12-18
- referenceId: (string)
the id string to match a reference.
Example:
resource.Resource%3A504%40base.url
- commentorId: (string)
the id string to match a commentor.
Example:
resource.Resource%3A504%40base.url
- bookId: (string)
The id string to match a book
Example:
commenting.Book%3A8374%40base.url
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
[
{
"id": "commenting.Comment:1595@base.url",
"uri": "http://base.url/open/campusapi/commenting/comment/commenting.Comment%3A1595%40base.url",
"displayName": "Display Name of this Comment",
"description": "The description of this Comment",
"genusTypeId": "type.Type:defaultCommentType@base.url",
"recordTypeIds": [ "type.Type:exampleCommentRecordType@campusapi.org", "..."],
"startDate": "2020-10-03T06:30:00.000Z",
"endDate": "2020-12-18T19:30:00.000Z",
"endReasonId": "process.State:1595@base.url",
"referenceId": "id.Id:8831@base.url",
"commentorId": "resource.Resource:3119@base.url",
"text": "This is the Text",
"ratingId": "grading.Grade:7661@base.url"
},
{
"...": "..."
}
]
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
post /comments
Create a new comment in the default book.
Query Parameters
- referenceId: required(string)
the reference of this comment.
Example:
resource.Resource%3A504%40base.url
- commentorId: required(string)
the commentor of this comment.
Example:
resource.Resource%3A504%40base.url
- genusType: (string)
specify a particular comment type to create
Example:
type.Type%3AexampleCommentType%40dxtera.org
- recordType: (array of )
specify support for one or more comment record types
Example:
[ "type.Type%3AexampleCommentRecordType%40campusapi.org", "..." ]
- bookId: (string)
specify in which book to create this comment
Example:
commenting.Book%3A8374%40base.url
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Comment",
"type": "object",
"properties": {
"id": {
"description": "The unique id of this comment, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this comment, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this comment for display.",
"type": "string"
},
"description": {
"description": "The description of this comment.",
"type": "string"
},
"genusTypeId": {
"description": "Id of the immutable type of this comment. Default type set by system unless specified in query parameter.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this comment. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"startDate": {
"description": "The starting date of this comment.",
"type": "string",
"format": "date-time"
},
"endDate": {
"description": "The ending date of this comment.",
"type": "string",
"format": "date-time"
},
"endReasonId": {
"description": "The reason this comment ended.",
"type": "string",
"format": "osid-id"
},
"referenceId": {
"description": "The reference associated with this comment.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"commentorId": {
"description": "The commentor associated with this comment.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"text": {
"description": "The comment text.",
"type": "string"
},
"ratingId": {
"description": "The Grade.",
"type": "string",
"format": "osid-id"
}
}
}
Example:
{
"displayName": "Display Name of this Comment",
"description": "The description of this Comment",
"startDate": "2020-10-03T06:30:00.000Z",
"endDate": "2020-12-18T19:30:00.000Z",
"endReasonId": "process.State:7365@base.url",
"text": "This is the Text",
"ratingId": "grading.Grade:5946@base.url"
}
Entity representing a comment form metadata.
Get form metadata for creating a new comment.
get /comments/metadata
Get form metadata for creating a new comment.
Query Parameters
- referenceId: required(string)
the reference of this metadatum.
Example:
resource.Resource%3A504%40base.url
- commentorId: required(string)
the commentor of this metadatum.
Example:
resource.Resource%3A504%40base.url
- genusType: (string)
specify a particular comment type to create
Example:
type.Type%3AexampleCommentType%40dxtera.org
- recordType: (array of )
specify support for one or more comment record types
Example:
[ "type.Type%3AexampleCommentRecordType%40campusapi.org", "..." ]
- bookId: (string)
specify in which book to create this comment
Example:
commenting.Book%3A8374%40base.url
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{
"$schema": "http://json-schema.org/draft/2019-9/schema#",
"title": "Comment",
"type": "object",
"required": ["displayName"],
"properties": {
"id": {
"description": "The unique id of this comment, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this comment, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this comment for display.",
"type": "string",
"read-only": false,
"minLength": 1,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:displayName@base.url",
"existingValue": "The Existing Name",
"elementLabel": "Name",
"instructions": "Enter a name for this comment",
"linked": false
},
"description": {
"description": "The description of this comment.",
"type": "string",
"read-only": false,
"minLength": 0,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:displayName@demo.base.url",
"existingValue": "The Existing Description",
"elementLabel": "Description",
"instructions": "Enter a description for this comment",
"linked": false
},
"genusTypeId": {
"description": "Id of the immutable type of this comment. Default type set by system unless specified in query parameter on initial post.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this comment. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"startDate": {
"description": "The starting date of this comment.",
"type": "string",
"format": "date-time",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:startDate@base.url",
"existingValue": "2020-10-03T08:00:00.000Z",
"elementLabel": "Start Date",
"instructions": "Enter a starting date for this comment",
"linked": false
},
"endDate": {
"description": "The ending date of this comment.",
"type": "string",
"format": "date-time",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:endDate@base.url",
"existingValue": "2020-12-18T17:00:00.000Z",
"elementLabel": "End Date",
"instructions": "Enter an ending date for this comment",
"linked": false
},
"endReasonId": {
"description": "The reason this comment ended. A process/State object.",
"type": "string",
"format": "osid-id",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:endReason@base.url",
"existingValue": "process.State:1860@base.url",
"elementLabel": "End Reason",
"instructions": "Select the reason this comment ended",
"linked": false
},
"text": {
"description": "The comment text.",
"type": "string",
"read-only": false,
"minLength": null,
"maxLength": null,
"pattern": "",
"default": "",
"enum": [],
"elementId": "commenting.Comment:text@dxtera.org",
"existingValue": "The existing text",
"elementLabel": "Text",
"instructions": "Enter a text for this comment.",
"linked": false
},
"ratingId": {
"description": "The Grade.",
"type": "string",
"type": "string",
"format": "osid-id",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "commenting.Comment:rating@dxtera.org",
"existingValue": null,
"elementLabel": "Rating",
"instructions": "Enter the Id of the rating for this comment.",
"linked": false
}
}
}
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
Entity representing a comment
Get a comment given its id.
Update a given comment.
Delete a given comment.
get /comments/{commentId}
Get a comment given its id.
URI Parameters
- commentId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{
"id": "commenting.Comment:1595@base.url",
"uri": "http://base.url/open/campusapi/commenting/comment/commenting.Comment%3A1595%40base.url",
"displayName": "Display Name of this Comment",
"description": "The description of this Comment",
"genusTypeId": "type.Type:defaultCommentType@base.url",
"recordTypeIds": [ "type.Type:exampleCommentRecordType@campusapi.org", "..."],
"startDate": "2020-10-03T06:30:00.000Z",
"endDate": "2020-12-18T19:30:00.000Z",
"endReasonId": "process.State:1595@base.url",
"referenceId": "id.Id:8831@base.url",
"commentorId": "resource.Resource:3119@base.url",
"text": "This is the Text",
"ratingId": "grading.Grade:7661@base.url"
}
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "comment not found" }
put /comments/{commentId}
Update a given comment.
URI Parameters
- commentId: required(string)
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Comment",
"type": "object",
"properties": {
"id": {
"description": "The unique id of this comment, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this comment, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this comment for display.",
"type": "string"
},
"description": {
"description": "The description of this comment.",
"type": "string"
},
"genusTypeId": {
"description": "Id of the immutable type of this comment. Default type set by system unless specified in query parameter.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this comment. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"startDate": {
"description": "The starting date of this comment.",
"type": "string",
"format": "date-time"
},
"endDate": {
"description": "The ending date of this comment.",
"type": "string",
"format": "date-time"
},
"endReasonId": {
"description": "The reason this comment ended.",
"type": "string",
"format": "osid-id"
},
"referenceId": {
"description": "The reference associated with this comment.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"commentorId": {
"description": "The commentor associated with this comment.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"text": {
"description": "The comment text.",
"type": "string"
},
"ratingId": {
"description": "The Grade.",
"type": "string",
"format": "osid-id"
}
}
}
Example:
{
"displayName": "Display Name of this Comment",
"description": "The description of this Comment",
"startDate": "2020-10-03T06:30:00.000Z",
"endDate": "2020-12-18T19:30:00.000Z",
"endReasonId": "process.State:7365@base.url",
"text": "This is the Text",
"ratingId": "grading.Grade:5946@base.url"
}
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "The comment has been updated" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "comment not found" }
delete /comments/{commentId}
Delete a given comment.
URI Parameters
- commentId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "The comment has been deleted" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "comment not found" }
Entity representing a comment form metadata for update
Get form metadata for updating an existing comment.
get /comments/{commentId}/metadata
Get form metadata for updating an existing comment.
URI Parameters
- commentId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{
"$schema": "http://json-schema.org/draft/2019-9/schema#",
"title": "Comment",
"type": "object",
"required": ["displayName"],
"properties": {
"id": {
"description": "The unique id of this comment, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this comment, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this comment for display.",
"type": "string",
"read-only": false,
"minLength": 1,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:displayName@base.url",
"existingValue": "The Existing Name",
"elementLabel": "Name",
"instructions": "Enter a name for this comment",
"linked": false
},
"description": {
"description": "The description of this comment.",
"type": "string",
"read-only": false,
"minLength": 0,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:displayName@demo.base.url",
"existingValue": "The Existing Description",
"elementLabel": "Description",
"instructions": "Enter a description for this comment",
"linked": false
},
"genusTypeId": {
"description": "Id of the immutable type of this comment. Default type set by system unless specified in query parameter on initial post.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this comment. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"startDate": {
"description": "The starting date of this comment.",
"type": "string",
"format": "date-time",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:startDate@base.url",
"existingValue": "2020-10-03T08:00:00.000Z",
"elementLabel": "Start Date",
"instructions": "Enter a starting date for this comment",
"linked": false
},
"endDate": {
"description": "The ending date of this comment.",
"type": "string",
"format": "date-time",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:endDate@base.url",
"existingValue": "2020-12-18T17:00:00.000Z",
"elementLabel": "End Date",
"instructions": "Enter an ending date for this comment",
"linked": false
},
"endReasonId": {
"description": "The reason this comment ended. A process/State object.",
"type": "string",
"format": "osid-id",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Comment.Comment:endReason@base.url",
"existingValue": "process.State:1860@base.url",
"elementLabel": "End Reason",
"instructions": "Select the reason this comment ended",
"linked": false
},
"text": {
"description": "The comment text.",
"type": "string",
"read-only": false,
"minLength": null,
"maxLength": null,
"pattern": "",
"default": "",
"enum": [],
"elementId": "commenting.Comment:text@dxtera.org",
"existingValue": "The existing text",
"elementLabel": "Text",
"instructions": "Enter a text for this comment.",
"linked": false
},
"ratingId": {
"description": "The Grade.",
"type": "string",
"type": "string",
"format": "osid-id",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "commenting.Comment:rating@dxtera.org",
"existingValue": null,
"elementLabel": "Rating",
"instructions": "Enter the Id of the rating for this comment.",
"linked": false
}
}
}
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "comment not found" }
/books
Collection of books in a system or federation of systems.
Get all books.
Create a new book.
get /books
Get all books.
Query Parameters
- offset: (integer - default: 0)
Skip over a number of elements by specifying an offset value for the query
Example:
20
- limit: (integer - default: 10)
Limit the number of elements on the response
Example:
80
- genusTypeId: (string)
The id string to match a genusType
Example:
type.Type%3AexampleBookType%40dxtera.org
- parentGenusTypeId: (string)
The id string to match a parent genusType
Example:
type.Type%3AparentTypeExampleBookType%40dxtera.org
- recordTypeId: (string)
The id string to match a recordType
Example:
type.Type%3AexampleBookType%40campusapi.org
- providerId: (string)
Id string to match provider.
Example:
resource.Resource%3A3007%40demo.dxtera.org
- commentId: (string)
Get books mapped to this comment.
Example:
commenting.Comment%3A280%40demo.dxtera.org
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
[
{
"id": "commenting.Book:2177@base.url",
"uri": "http://base.url/open/campusapi/commenting/book/commenting.Book%3A2177%40base.url",
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"genusTypeId": "type.Type:defaultBookType@base.url",
"recordTypeIds": [ "type.Type:exampleBookRecordType@campusapi.org", "..."],
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
},
{
"...": "..."
}
]
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
post /books
Create a new book.
Query Parameters
- genusType: (string)
specify a particular book type to create
Example:
type.Type%3AexampleBookType%40dxtera.org
- recordType: (array of )
specify support for one or more book record types
Example:
[ "type.Type%3AexampleBookRecordType%40campusapi.org", "..." ]
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Book",
"type": "object",
"properties": {
"id": {
"description": "The unique id of this book, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this book, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this book for display.",
"type": "string"
},
"description": {
"description": "The description of this book.",
"type": "string"
},
"genusTypeId": {
"description": "Id of the immutable type of this book. Default type set by system unless specified in query parameter.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this book. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"providerId": {
"description": "The provider of this book.",
"type": "string",
"format": "osid-id"
},
"brandingIds": {
"description": "The branding of this book. A collection of Assets.",
"type": "array",
"items" : {
"type": "string",
"format": "osid-id"
}
},
"license": {
"description": "The licensing that applies to this book.",
"type": "string"
}
}
}
Example:
{
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
}
Entity representing a book form metadata.
Get form metadata for creating a new book.
get /books/metadata
Get form metadata for creating a new book.
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{
"$schema": "http://json-schema.org/draft/2019-9/schema#",
"title": "Book",
"type": "object",
"required": ["displayName"],
"properties": {
"id": {
"description": "The unique id of this book, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this book, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this book for display.",
"type": "string",
"read-only": false,
"minLength": 1,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:displayName@base.url",
"existingValue": "The Existing Name",
"elementLabel": "Name",
"instructions": "Enter a name for this book",
"linked": false
},
"description": {
"description": "The description of this book.",
"type": "string",
"read-only": false,
"minLength": 0,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:displayName@demo.base.url",
"existingValue": "The Existing Description",
"elementLabel": "Description",
"instructions": "Enter a description for this book",
"linked": false
},
"genusTypeId": {
"description": "Id of the immutable type of this book. Default type set by system unless specified in query parameter on initial post.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this book. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"providerId": {
"description": "The provider of this book.",
"type": "string",
"format": "osid-id",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:provider@base.url",
"existingValue": "",
"elementLabel": "Provider",
"instructions": "Enter the provider of this book",
"linked": false
},
"brandingIds": {
"description": "The branding of this book. A list of Assets.",
"type": "array",
"items" : {
"type": "string",
"format": "osid-id",
"pattern": "",
"enum": []
},
"read-only": false,
"default": [],
"elementId": "Book.Book:branding@base.url",
"existingValue": "",
"elementLabel": "Branding",
"instructions": "Enter the branding images for this book",
"linked": false
},
"license": {
"description": "The licensing that applies to this book.",
"type": "string",
"read-only": false,
"minLength": 0,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:license@base.url",
"existingValue": "The Existing License",
"elementLabel": "License",
"instructions": "Include a license for this book",
"linked": false
}
}
}
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
The root books in the book hierarchy. A node with no parents is an orphan. While all book Ids are known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root node or child of another node.
Get all root root-book
get /books/root-book
Get all root root-book
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
[
{
"id": "commenting.Book:2177@base.url",
"uri": "http://base.url/open/campusapi/commenting/book/commenting.Book%3A2177%40base.url",
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"genusTypeId": "type.Type:defaultBookType@base.url",
"recordTypeIds": [ "type.Type:exampleBookRecordType@campusapi.org", "..."],
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
},
{
"...": "..."
}
]
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
Entity representing a book
Get a book given its id.
Update a given book.
Delete a given book.
get /books/{bookId}
Get a book given its id.
URI Parameters
- bookId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{
"id": "commenting.Book:2177@base.url",
"uri": "http://base.url/open/campusapi/commenting/book/commenting.Book%3A2177%40base.url",
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"genusTypeId": "type.Type:defaultBookType@base.url",
"recordTypeIds": [ "type.Type:exampleBookRecordType@campusapi.org", "..."],
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
}
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "book not found" }
put /books/{bookId}
Update a given book.
URI Parameters
- bookId: required(string)
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Book",
"type": "object",
"properties": {
"id": {
"description": "The unique id of this book, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this book, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this book for display.",
"type": "string"
},
"description": {
"description": "The description of this book.",
"type": "string"
},
"genusTypeId": {
"description": "Id of the immutable type of this book. Default type set by system unless specified in query parameter.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this book. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"providerId": {
"description": "The provider of this book.",
"type": "string",
"format": "osid-id"
},
"brandingIds": {
"description": "The branding of this book. A collection of Assets.",
"type": "array",
"items" : {
"type": "string",
"format": "osid-id"
}
},
"license": {
"description": "The licensing that applies to this book.",
"type": "string"
}
}
}
Example:
{
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
}
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "The book has been updated" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "book not found" }
delete /books/{bookId}
Delete a given book.
URI Parameters
- bookId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "The book has been deleted" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "book not found" }
Entity representing a book form metadata for update
Get form metadata for updating an existing book.
get /books/{bookId}/metadata
Get form metadata for updating an existing book.
URI Parameters
- bookId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{
"$schema": "http://json-schema.org/draft/2019-9/schema#",
"title": "Book",
"type": "object",
"required": ["displayName"],
"properties": {
"id": {
"description": "The unique id of this book, provided by system.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"uri": {
"description": "The uri of this book, provided by system.",
"type": "string",
"format": "uri",
"readOnly": true
},
"displayName": {
"description": "The name of this book for display.",
"type": "string",
"read-only": false,
"minLength": 1,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:displayName@base.url",
"existingValue": "The Existing Name",
"elementLabel": "Name",
"instructions": "Enter a name for this book",
"linked": false
},
"description": {
"description": "The description of this book.",
"type": "string",
"read-only": false,
"minLength": 0,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:displayName@demo.base.url",
"existingValue": "The Existing Description",
"elementLabel": "Description",
"instructions": "Enter a description for this book",
"linked": false
},
"genusTypeId": {
"description": "Id of the immutable type of this book. Default type set by system unless specified in query parameter on initial post.",
"type": "string",
"format": "osid-id",
"readOnly": true
},
"recordTypeIds": {
"description": "Type Ids of record types available on this book. Record types define special attributes available on an object to support specific applications or classes of applications and are documented elsewhere.",
"type": "array",
"items": {
"type": "string",
"format": "osid-id"
},
"readOnly": true
},
"providerId": {
"description": "The provider of this book.",
"type": "string",
"format": "osid-id",
"read-only": false,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:provider@base.url",
"existingValue": "",
"elementLabel": "Provider",
"instructions": "Enter the provider of this book",
"linked": false
},
"brandingIds": {
"description": "The branding of this book. A list of Assets.",
"type": "array",
"items" : {
"type": "string",
"format": "osid-id",
"pattern": "",
"enum": []
},
"read-only": false,
"default": [],
"elementId": "Book.Book:branding@base.url",
"existingValue": "",
"elementLabel": "Branding",
"instructions": "Enter the branding images for this book",
"linked": false
},
"license": {
"description": "The licensing that applies to this book.",
"type": "string",
"read-only": false,
"minLength": 0,
"maxLength": 128,
"pattern": "",
"default": "",
"enum": [],
"elementId": "Book.Book:license@base.url",
"existingValue": "The Existing License",
"elementLabel": "License",
"instructions": "Include a license for this book",
"linked": false
}
}
}
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{"message": "book not found" }
Get child books for the given book in the hierarchy.
get /books/{bookId}/children
Get child books for the given book in the hierarchy.
URI Parameters
- bookId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
[
{
"id": "commenting.Book:2177@base.url",
"uri": "http://base.url/open/campusapi/commenting/book/commenting.Book%3A2177%40base.url",
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"genusTypeId": "type.Type:defaultBookType@base.url",
"recordTypeIds": [ "type.Type:exampleBookRecordType@campusapi.org", "..."],
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
},
{
"...": "..."
}
]
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
Add book as child of the given book in the hierarchy.
Remove the given book as a child of the given book in the hierarchy.
put /books/{bookId}/children/{childId}
Add book as child of the given book in the hierarchy.
URI Parameters
- bookId: required(string)
- childId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "The child book has been added to the hierarchy" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{ "message": "book not found" }
delete /books/{bookId}/children/{childId}
Remove the given book as a child of the given book in the hierarchy.
URI Parameters
- bookId: required(string)
- childId: required(string)
Get parent books for the given book in the hierarchy.
get /books/{bookId}/parents
Get parent books for the given book in the hierarchy.
URI Parameters
- bookId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
[
{
"id": "commenting.Book:2177@base.url",
"uri": "http://base.url/open/campusapi/commenting/book/commenting.Book%3A2177%40base.url",
"displayName": "Display Name of this Book",
"description": "The description of this Book",
"genusTypeId": "type.Type:defaultBookType@base.url",
"recordTypeIds": [ "type.Type:exampleBookRecordType@campusapi.org", "..."],
"providerId": "resource.Resource:123@base.url",
"brandingId": "asset.Asset:Book@base.url",
"license": "The license that applies to this Book"
},
{
"...": "..."
}
]
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
Get all comments in this book
get /books/{bookId}/comments
Get all comments in this book
URI Parameters
- bookId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
[
{
"id": "commenting.Comment:1595@base.url",
"uri": "http://base.url/open/campusapi/commenting/comment/commenting.Comment%3A1595%40base.url",
"displayName": "Display Name of this Comment",
"description": "The description of this Comment",
"genusTypeId": "type.Type:defaultCommentType@base.url",
"recordTypeIds": [ "type.Type:exampleCommentRecordType@campusapi.org", "..."],
"startDate": "2020-10-03T06:30:00.000Z",
"endDate": "2020-12-18T19:30:00.000Z",
"endReasonId": "process.State:1595@base.url",
"referenceId": "id.Id:8831@base.url",
"commentorId": "resource.Resource:3119@base.url",
"text": "This is the Text",
"ratingId": "grading.Grade:7661@base.url"
},
{
"...": "..."
}
]
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
Add the given comment to this book
Remove the given comment from the book.
put /books/{bookId}/comments/{commentId}
Add the given comment to this book
URI Parameters
- bookId: required(string)
- commentId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "comment has been added to book" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{ "message": "comment not found" }
delete /books/{bookId}/comments/{commentId}
Remove the given comment from the book.
URI Parameters
- bookId: required(string)
- commentId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: any
Example:
{ "message": "comment has been removed" }
HTTP status code 403
Body
Media type: application/json
Type: any
Example:
{"message": "Permission denied" }
HTTP status code 404
Body
Media type: application/json
Type: any
Example:
{ "message": "comment not found" }