Skip to content

teamforus/poc-ipfs

Repository files navigation

note: work in progress, beware of the dragons 🐉

This repository is maintained by: @jastam

api.forus.io-ipfs

Document store

The document store provides storage for arbitrary JSON documents. The id in the URL corresponds to the id field in the document. When there is a conflict between these, the value in the URL takes precedence.

/api/v1/docs/{document_type}/{id}

Get document [GET]

  • Response 200 (application/json)
    • Body { "id": 1 "name": "message", "value": "Hello world!" }

Create or replace document [PUT]

  • Request (application/json)

    • Body { "id": 1 (optional) "name": "message", "value": "Message to add" }
  • Response 200

    • Body { "result":"true" }
  • Response 400

    • Body { "result":"false","error":"No valid message given" }
  • Response 500

    • Body { "result":"false","error":"Server error message" }

Delete document [DELETE]

  • Response 200

    • Body { "result":"true" }
  • Response 400

    • Body { "result":"false","error":"No valid message given" }
  • Response 500

    • Body { "result":"false" }

/api/v1/docs/{document_type}

Get list of documents [GET]

  • Response 200 (application/json)
    • Body [ { "id": 1 "name": "message 1", "value": "Something" } { "id": 2 "name": "message 2", "value": "Something else" } ]

Add documents [POST]

If no id field is given in the body of the document, a random value will be generated for the id field.

  • Request (application/json)

    • Body { "name": "message", "value": "Message to add" }
  • Response 200

    • Body { "result":"true", "id": "3" }
  • Response 400

    • Body { "result":"false","error":"No valid message given" }
  • Response 500

    • Body { "result":"false" }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published