The Document API allows a user of the system to attach a document to a student's record. The supported document types are pdf, doc, jpg, gif, rtf, jpeg, png, xls, xlsx, docx, txt and csv. Document storage should be on the filesystem with metadata kept in the database. The filesystem location for document storage should not be web accessible. The only means to manage these documents will be through the API.
Note: Research required of best way to download data stream to client. The API below will require modification depending on solution determined.
Get All Documents for a Person
GET /ssp/api/1/person/{id}/document
Parameters
status : ALL, ACTIVE, INACTIVE, DELETED
start : First result (0-based index) to return
limit : Maximum number of results to return
sort : Property name
sortDirection : Ascending/descending keyword (ASC/DESC or ASCENDING/DESCENDING)
Returns
{"success" : "true", "results" : "100", "rows" : [{"id" : "cb9ae287-0b28-4a3b-aece-2c6d1d974443", "createdBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "createdDate" : "1332216000000", "modifiedBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "modifiedDate" : "1332216000000", "objectStatus" : "ACTIVE", "name" : "High School Transcript", "note" : "This is Billy's high school transcript from Oakwood High School", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}, {"id" : "3a9d3bee-1acf-4af2-92b6-10bf6d6b4da0", "createdBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "createdDate" : "1332216000000", "modifiedBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "modifiedDate" : "1332216000000", "objectStatus" : "ACTIVE", "name" : "Email", "note" : "Email received from Billy on 04/12/12 outlining struggles during Spring term.", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}, ... ] }
Get a Document
GET /ssp/api/1/person/{id}/document/{id}
Returns
Document
{"id" : "cb9ae287-0b28-4a3b-aece-2c6d1d974443", "createdBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "createdDate" : "1332216000000", "modifiedBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "modifiedDate" : "1332216000000", "objectStatus" : "ACTIVE", "name" : "High School Transcript", "note" : "This is Billy's high school transcript from Oakwood High School", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}
Create a Document
POST /ssp/api/1/person/{id}/document
Sample Post
{"name" : "High School Transcript", "note" : "This is Billy's high school transcript from Oakwood High School", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}
Returns
Document
{"id" : "cb9ae287-0b28-4a3b-aece-2c6d1d974443", "createdBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "createdDate" : "1332216000000", "modifiedBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "modifiedDate" : "1332216000000", "objectStatus" : "ACTIVE", "name" : "High School Transcript", "note" : "This is Billy's high school transcript from Oakwood High School", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}
Save a Document
PUT /ssp/api/1/person/{id}/document/{id}
Sample Post
{"id" : "cb9ae287-0b28-4a3b-aece-2c6d1d974443", "createdBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "createdDate" : "1332216000000", "modifiedBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "modifiedDate" : "1332216000000", "objectStatus" : "ACTIVE", "name" : "High School Transcript", "note" : "This is Billy's high school transcript from Oakwood High School", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}
Returns
Document
{"id" : "cb9ae287-0b28-4a3b-aece-2c6d1d974443", "createdBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "createdDate" : "1332216000000", "modifiedBy" : {"id" : "91f46e39-cea8-422b-b215-00f6bcf5d280", "firstName" : "John", "lastName" : "Doe"}, "modifiedDate" : "1332216000000", "objectStatus" : "ACTIVE", "name" : "High School Transcript", "note" : "This is Billy's high school transcript from Oakwood High School", "confidentialityLevelId" : "c57f11e1-7ef2-4989-9ac2-7b0690563995"}
Delete a Document
DELETE /ssp/api/1/person/{id}/document/{id}
Returns
{"success" : "true"}
or
{"success" : "false", "message" : "Message when success is false."}