Skip to content

Commit e150622

Browse files
author
Alex Corbi
committed
adapted API definition based on discussion on TransforMap/data.transformap.co#45
1 parent 84f8784 commit e150622

File tree

1 file changed

+55
-72
lines changed

1 file changed

+55
-72
lines changed

app/lib/MMS_API.md

Lines changed: 55 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -9,144 +9,127 @@ Retrieves the list of media files associated with a POI
99
**Payload**: No
1010
**Expected response**: A JSON string containing an array of media file metadata. Each object will contain the currently active version of the media file's metadata, if available.
1111

12-
```json
12+
```json
1313
[
1414
{
15-
"mediaId": "d07d6ab3-4e3f-44ce-accc-b3efc96b3f04",
16-
"title": "some title",
17-
"description": "some description",
18-
"assetUrl": "https://someDomain/someImage.png",
19-
"versionDate": "2017-07-30T16:01:34+00:00"
15+
"mediaId": "d07d6ab3-4e3f-44ce-accc-b3efc96b3f04",
16+
"ipfs": "QmVXmy59f5QqKDGyhpHbRiGnba5SfHaooDPCWhd8Xtgwz2",
17+
"mimetype": "image/jpeg",
18+
"name": "Chaotic connectome replacement image for the large image on the main screen",
19+
"description": "some description",
20+
"versionDate": "2017-07-30T16:01:34+00:00"
2021
},
2122
{
22-
"mediaId": "211345a8-0e28-43ae-99a9-7300040c6399",
23-
"title": "some other title",
24-
"description": "some other description",
25-
"assetUrl": "https://someDomain/someImage.png",
26-
"versionDate": "2017-07-30T16:01:34+00:00"
23+
"mediaId": "0a6afb5c-70b1-40f7-8f46-8dd7e0d94060",
24+
"mimetype": "image.png",
25+
"name": "Transformap Base",
26+
"url": "https://base.transformap.co/images/transformap.png",
27+
"versionDate": "2017-07-30T16:01:34+00:00"
2728
}
2829
]
2930
```
3031

3132
## createNewMediaFileForPOI
3233

33-
Creates a new media file for a certain POI
34+
Uploads a new media file
3435

35-
**Endpoint**: /place/{uuid}/media/
36+
**Endpoint**: /media/
3637
**Request method**: POST
3738
**Payload**: A JSON string containing the metadata of the media file to create
3839

39-
```json
40+
```json
4041
{
41-
"title": "some title",
42+
"name": "some title",
4243
"description": "some description",
43-
"assetUrl": "https://someDomain/someImage.png"
44+
"mimetype": "image.png",
45+
"url": "https://base.transformap.co/images/transformap.png"
4446
}
4547
```
4648

4749
**Expected response**: The complete metadata definition of the media file.
4850

49-
```json
51+
```json
5052
{
51-
"mediaId": "d07d6ab3-4e3f-44ce-accc-b3efc96b3f04",
52-
"status": "active",
53-
"title": "some title",
53+
"mediaId": "0a6afb5c-70b1-40f7-8f46-8dd7e0d94060",
54+
"name": "some title",
5455
"description": "some description",
55-
"assetUrl": "https://someDomain/someImage.png",
56-
"versionDate": "2017-07-30T16:01:34+00:00",
57-
"versions": []
56+
"mimetype": "image.png",
57+
"assignedTo": [],
58+
"url": "https://base.transformap.co/images/transformap.png",
59+
"versionDate": "2017-07-30T16:01:34+00:00"
5860
}
5961
```
6062

6163
## retrieveMetadataForMediaFile
6264

6365
Retrieves the metadata of a particular media file, including all versions
6466

65-
**Endpoint**: /place/{uuid}/media/{mediaId}
67+
**Endpoint**: /media/{mediaId}
6668
**Request method**: GET
6769
**Payload**: No
6870
**Expected response**: The complete metadata definition of the media file.
6971

70-
```json
72+
```json
7173
{
72-
"mediaId": "d07d6ab3-4e3f-44ce-accc-b3efc96b3f04",
73-
"status": "active",
74-
"title": "some title",
74+
"mediaId": "0a6afb5c-70b1-40f7-8f46-8dd7e0d94060",
75+
"name": "some title",
7576
"description": "some description",
76-
"assetUrl": "https://someDomain/someImage.png",
77-
"versionDate": "2017-07-30T16:01:34+00:00",
78-
"versions": [
79-
{
80-
"title": "previous title",
81-
"description": "some description",
82-
"assetUrl": "https://someDomain/someImage.png",
83-
"versionDate": "2017-06-30T16:01:34+00:00"
84-
}
85-
]
77+
"mimetype": "image.png",
78+
"assignedTo": ["0a6afb5c-70b1-40f7-8f46-8dd7e0d94060"],
79+
"url": "https://base.transformap.co/images/transformap.png",
80+
"versionDate": "2017-07-30T16:01:34+00:00"
8681
}
8782
```
8883

8984
## updateMedataForMediaFile
9085

9186
Updates the metadata of a particular media file
9287

93-
**Endpoint**: /place/{uuid}/media/{mediaId}
88+
**Endpoint**: /media/{mediaId}
9489
**Request method**: PUT
9590
**Payload**: A JSON string containing the metadata of the media file to update with.
9691

97-
```json
92+
```json
9893
{
99-
"title": "some new title",
100-
"description": "some new description",
101-
"assetUrl": "https://someDomain/someNewImage.png"
94+
"name": "some new title"
10295
}
10396
```
10497

10598
**Expected response**: The complete metadata definition of the media file.
10699

107-
```json
100+
```json
108101
{
109-
"mediaId": "d07d6ab3-4e3f-44ce-accc-b3efc96b3f04",
110-
"status": "active",
111-
"title": "some new title",
112-
"description": "some new description",
113-
"assetUrl": "https://someDomain/someNewImage.png",
114-
"versionDate": "2017-08-30T16:01:34+00:00",
115-
"versions": [
116-
{
117-
"title": "previous title",
118-
"description": "previous description",
119-
"assetUrl": "https://someDomain/someOtherImage.png",
120-
"versionDate": "2017-06-30T16:01:34+00:00"
121-
}
122-
]
102+
"mediaId": "0a6afb5c-70b1-40f7-8f46-8dd7e0d94060",
103+
"name": "some new title",
104+
"description": "some description",
105+
"mimetype": "image.png",
106+
"url": "https://base.transformap.co/images/transformap.png",
107+
"versionDate": "2017-07-30T16:01:34+00:00"
123108
}
124109
```
125110

126111
## deleteMediaFile
127112

128113
Deletes a media file moving it to a moderated trash
129114

130-
**Endpoint**: /place/{uuid}/media/{mediaId}
115+
**Endpoint**: /media/{mediaId}
131116
**Request method**: DELETE
132117
**Payload**: No
133118
**Expected response**: The complete metadata definition of the media file.
134119

135-
```json
120+
```json
136121
{
137122
"mediaId": "d07d6ab3-4e3f-44ce-accc-b3efc96b3f04",
138-
"status": "deleted",
139-
"title": "some new title",
123+
"deleted": true,
124+
"name": "some new title",
125+
"assignedTo": ["0a6afb5c-70b1-40f7-8f46-8dd7e0d94060"],
140126
"description": "some new description",
141-
"assetUrl": "https://someDomain/someNewImage.png",
142-
"versionDate": "2017-08-30T16:01:34+00:00",
143-
"versions": [
144-
{
145-
"title": "previous title",
146-
"description": "previous description",
147-
"assetUrl": "https://someDomain/someOtherImage.png",
148-
"versionDate": "2017-06-30T16:01:34+00:00"
149-
}
150-
]
127+
"mimetype": "image.png",
128+
"url": "https://base.transformap.co/images/transformap.png",
129+
"versionDate": "2017-07-30T16:01:34+00:00"
151130
}
152131
```
132+
133+
## retrieveJournaledMediaFilesForPOI
134+
135+
TBD

0 commit comments

Comments
 (0)