There are three main endpoints in the /img section.
/img/upload
Used to upload an image to the Compensation API servers.
Images must be Base64 encoded then placed in the body of the request.
Multiple query parameters are required:
- room_id
- others
- tags
URL:
https://api.compensationvr.tk/img/upload?room_id=<room_id>&others=["1", "0"]&tags=["test"]
Headers:
Content-Type: text/plain
Content-Length: <length>
Authentication: Bearer <auth token>
Body:
<Base 64 encoded image>
/img/<image_id>/
Used to fetch an image from the Compensation API.
You can use the base64 query parameter to fetch in a base-64 encoded format instead of a standard one.
Request
URL:
https://api.compensationvr.tk/img/0/
Headers: N/A
Body: N/A
The server should respond with:
URL:
https://api.compensationvr.tk/img/1?base64=true
Headers: N/A
Body: N/A
/img/<image_id>/info
Used to fetch image metadata from the Compensation API. All data is JSON-formatted.
Request
URL:
https://api.compensationvr.tk/img/1/info
Headers: N/A
Body: N/A
The server (should) respond with:
Response
{
"_id": 1,
"internalPathRef": "images/1.jpg",
"takenBy": {
"id": "2",
"nickname": "Raven",
"username": "Raven"
},
"takenInRoomId": "0",
"others": [],
"room": {
"id": "0",
"creator": "0",
"name": "Apartment"
},
"infoPath": "/img/1/info",
"filePath": "/img/1",
"takenOn": {
"unixTimestamp": 1657232966511,
"humanReadable": "Thu, 07 Jul 2022 22:29:26 GMT"
},
"social": {
"comments": [],
"votes": 0,
"tags": [
"photo"
]
}
}