Skip to content

Commit 379e18c

Browse files
committed
Update README with documentation of API requests and responses
1 parent 15e7fa4 commit 379e18c

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,102 @@ A simple Node application to store and retrieve IIIF manifests via REST API. It
3131
| /api/manifests/:manifestId | PUT | Update manifest with id |
3232
| /api/manifests/:manifestId | DELETE | Delete manifest with id (currently not implemented) |
3333

34+
### Get a List of All Manifests ###
35+
36+
**Request:** GET /api/manifests
37+
38+
Example URL: http://localhost:3001/api/manifests
39+
40+
**HTTP Status Code:** 200 OK
41+
42+
**Response:**
43+
44+
```javascript
45+
{"manifests":
46+
[
47+
{"uri":"http://localhost:3001/api/manifests/6b3bf0a8-b8f6-452a-bcbf-f336ff335c93"},
48+
{"uri":"http://localhost:3001/api/manifests/db45e27f-edbf-446b-8794-eb9070c3647e"},
49+
{"uri":"http://localhost:3001/api/manifests/example-manifest"}
50+
]
51+
}
52+
```
53+
54+
### Create a Manifest ###
55+
56+
**Request:** POST /api/manifests
57+
58+
Example URL: http://localhost:3001/api/manifests
59+
60+
**HTTP Status Code:** 201 Created
61+
62+
**Response:**
63+
64+
```javascript
65+
{
66+
"uri": "http://localhost:3001/api/manifests/f20c81a0-be0f-4cc6-bf48-891429faad11"
67+
}
68+
```
69+
70+
### Update a Manifest ###
71+
72+
**Request:** PUT /api/manifests/manifestId
73+
74+
Example URL: http://localhost:3001/api/manifests/example-manifest
75+
76+
**HTTP Status Code:** 200 OK
77+
78+
**Response:**
79+
80+
```javascript
81+
{
82+
"message": "Manifest successfully updated"
83+
}
84+
```
85+
86+
87+
### Get a Single Manifest ###
88+
89+
**Request:** GET /api/manifests/manifestId
90+
91+
Example URL: http://localhost:3001/api/manifests/example-manifest
92+
93+
**HTTP Status Code:** 200 OK
94+
95+
**Response:**
96+
97+
```javascript
98+
{
99+
{
100+
"@context": "http://iiif.io/api/presentation/2/context.json",
101+
"@id": "example-manifest",
102+
"@type": "sc:Manifest",
103+
"label": "Example Manifest",
104+
"metadata": [],
105+
"description": [
106+
{
107+
"@value": "Example Description",
108+
"@language": "en"
109+
}
110+
],
111+
"license": "https://creativecommons.org/licenses/by/3.0/",
112+
"attribution": "Example Attribution",
113+
"sequences": [
114+
{
115+
"@id": "example-sequence",
116+
"@type": "sc:Sequence",
117+
"label": [
118+
{
119+
"@value": "Example Sequence Label",
120+
"@language": "en"
121+
}
122+
],
123+
"canvases": []
124+
}
125+
],
126+
"structures": []
127+
}
128+
}
129+
```
130+
131+
132+

0 commit comments

Comments
 (0)