api.sigimera.org/v1/comments

Comments Endpoint

The /comments endpoints allows you to get the latest comments, but also create comments or deleted them. A comment could be related to different resource, e.g. crises, missing people or the feature page.

GET /comments[.format]

Formats

json
/comments OR /comments.json

Parameters

auth_token
REQUIRED The authentication token is needed in order to permit you access.
entity_id
OPTIONAL The identifier of the resource that is related to this comment.
entity_type
OPTIONAL This value is the same as the endpoint of the related entitiy, e.g. for the endpoint /crises the entity type is crises, for /missing_people it is missing_people.

Example Call (with curl)

$ curl -i http://api.sigimera.org/v1/comments?auth_token=YourSecretToken
HTTP/1.1 200 OK
X-API-Version: 1.14.1
Date: Sat, 25 Feb 2017 04:29:49 GMT
Server: Apache
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Cache-Control: public, must-revalidate, max-age=60
ETag: "30b72df6e5e413bedf7080aae0ab125f7a08b128"
Status: 200
Content-Type: application/json;charset=utf-8

[{"_id":"5024d19ef0f88241f7000002","body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus","created_at":"2012-08-10T11:17:18+02:00","creator_id":"4f92f89af0f8823155000017","data_schema_version":"3.0.0.beta","entity_id":"1234567890","entity_type":"testingResource","updated_at":"2012-08-10T11:17:18+02:00"},{"_id":"501bdb94f0f8821861000023","body":"This is a testing comment for the feature page...","created_at":"2012-08-03T16:09:24+02:00","creator_id":"4f92f89af0f8823155000017","data_schema_version":"3.0.0.beta","entity_id":"","entity_type":"features","updated_at":"2012-08-03T16:09:24+02:00"}]

Output

[
   {
      "_id":"5024d19ef0f88241f7000002",
      "body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus",
      "created_at":"2012-08-10T11:17:18+02:00",
      "creator_id":"4f92f89af0f8823155000017",
      "data_schema_version":"3.0.0.beta",
      "entity_id":"1234567890",
      "entity_type":"testingResource",
      "updated_at":"2012-08-10T11:17:18+02:00"
   },
   {
      "_id":"501bdb94f0f8821861000023",
      "body":"This is a testing comment for the feature page...",
      "created_at":"2012-08-03T16:09:24+02:00",
      "creator_id":"4f92f89af0f8823155000017",
      "data_schema_version":"3.0.0.beta",
      "entity_id":"",
      "entity_type":"features",
      "updated_at":"2012-08-03T16:09:24+02:00"
   }
]

Do you need more help?

Community:
Sigimera Team:
Contact us under

GET /comments/:id[.format]

Formats

json
/comments/:id OR /comments/:id.json

Parameters

auth_token
REQUIRED The authentication token is needed in order to permit you access.

Example Call (with curl)

$ curl -i http://api.sigimera.org/v1/comments?auth_token=YourSecretToken
HTTP/1.1 200 OK
Link: <http://crises.sigimera.org/testingResource/1234567890>; rel="related crisis"
X-API-Version: 1.14.1
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Content-Type: application/json;charset=utf-8
Cache-Control: public, must-revalidate, max-age=60
Last-Modified: Fri, 10 Aug 2012 09:17:18 GMT
ETag: "b4e0898f3d8fb0bd811fd0a935cbe3e65efdb83b"
Content-Length: 334
Connection: keep-alive
Server: thin 1.4.1 codename Chromeo

{"_id":"5024d19ef0f88241f7000002","body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus","created_at":"2012-08-10T11:17:18+02:00","creator_id":"4f92f89af0f8823155000017","data_schema_version":"3.0.0.beta","entity_id":"1234567890","entity_type":"testingResource","updated_at":"2012-08-10T11:17:18+02:00"}

Output

{
   "_id":"5024d19ef0f88241f7000002",
   "body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus",
   "created_at":"2012-08-10T11:17:18+02:00",
   "creator_id":"4f92f89af0f8823155000017",
   "data_schema_version":"3.0.0.beta",
   "entity_id":"1234567890",
   "entity_type":"testingResource",
   "updated_at":"2012-08-10T11:17:18+02:00"
}

Do you need more help?

Community:
Sigimera Team:
Contact us under

POST /comments[.format]

Formats

json
/comments OR /comments.json

Parameters

auth_token
REQUIRED The authentication token is needed in order to permit you access.

Example Call (with curl)

$ curl -iH "Content-Type: application/json" -X POST -d @comment.json http://api.sigimera.org/v1/comments?auth_token=YourSecretToken
HTTP/1.1 201 Created
Location: http://crises.sigimera.org/comments/5024d19ef0f88241f7000002
X-API-Version: 1.14.1
Content-Length: 0
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Content-Type: application/json;charset=utf-8
Cache-Control: public, must-revalidate, max-age=60
Connection: keep-alive
Server: thin 1.4.1 codename Chromeo

Input

{
    "body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus",
    "entity_id":"1234567890",
    "entity_type":"testingResource"
}

Do you need more help?

Community:
Sigimera Team:
Contact us under

DELETE /comments[.format]

Formats

json
/comments/:id OR /comments/:id.json

Parameters

auth_token
REQUIRED The authentication token is needed in order to permit you access.

Example Call (with curl)

$ curl -i -X DELETE http://api.sigimera.org/v1/comments/5024d19ef0f88241f7000002?auth_token=YourSecretToken
HTTP/1.1 204 No Content
X-API-Version: 1.14.1
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Cache-Control: public, must-revalidate, max-age=60
Connection: close
Server: thin 1.4.1 codename Chromeo

Do you need more help?

Community:
Sigimera Team:
Contact us under