Skip to content

Latest commit

 

History

History
71 lines (63 loc) · 1.37 KB

README.md

File metadata and controls

71 lines (63 loc) · 1.37 KB

messaging

  • The current implementation requires the credentials.json file

Service to write/update/delete records stored inside Firebase Firestore.

Simulate API Requests with curl

POST /api/messaging

curl -X POST http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "collectionPath": "chats/SAM101/sec01/room/messages",
    "content": "This is written RIGHT NOW!",
    "author": "Jie Chen",
    "authorPhotoURL": "www."
}'

Response

{
    "messageID": uuid
}

GET /api/messaging

curl -X GET http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "fullMessagePath": "chats/SAM101/sec01/room/messages/{messageID}"
}'

Response

{
    "author": string,
    "content": string,
    "firstCreated": Date,
    "lastUpdated": Date
}

PATCH /api/messaging

curl -X PATCH http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "fullMessagePath": "chats/SAM101/sec01/room/messages/{messageID}",
    "content": "This is a revised version"
}

Response

{
    "UpdateTime": Date
}

DELETE /api/messaging

curl -X DELETE http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "fullMessagePath": "chats/SAM101/sec01/room/messages/{messageID}"
}'

Response

{
    "removedFullMessagePath": string
}