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<br>
start : First result (0-based index) to return<br>
limit : Maximum number of results to return<br>
sort : Property name<br>
sortDirection : Ascending/descending keyword (ASC/DESC or ASCENDING/DESCENDING)
Returns
List<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", "confidentialityLevel" : "EVERYONE"}, {"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.", "confidentialityLevel" : "EVERYONE"}, ... ]
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", "confidentialityLevel" : "EVERYONE"}
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", "confidentialityLevel" : "EVERYONE"}
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", "confidentialityLevel" : "EVERYONE"}
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", "confidentialityLevel" : "EVERYONE"}
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", "confidentialityLevel" : "EVERYONE"}
Delete a Document
DELETE /ssp/api/1/person/{id}/document/{id}
Returns
{"success" : "true"}
or
{"success" : "false", "message" : "Message when success is false."}