CenterForDigitalHumanities / TPEN-services

Services required by TPEN interfaces in order to interact with data
1 stars 0 forks source link

POST /line/{annotationpageid} route and tests #24

Open thehabes opened 9 months ago

thehabes commented 9 months ago

The application needs to add POST method handling to the /lineroute. The endpoint will be handed a JSON object that represents an Annotation to be included in an Annotation Page. The URL will include the AnnotationPage id from a particular page (Canvas) from a particular TPEN Project Entity. For example:

POST {"type":"Annotation"}
http://localhost:3001/line/987

Then endpoint will do various bits of logic (TBD at a later time) and ultimately return a JSON Object representing an Annotation.

This endpoint requires authentication and so will need to process a user and user permissions from the Authorization header's Bearer Token which came is as part of the request. If this header is not present or is invalid the endpoint should respond 401 Unauthorized.

This route will need CORS headers as described by #9.

Tests could include