Counters

Get Counters

curl "https://example.ziik.io/api/counters"
  -H "Authorization: Bearer aaaaaaaaaa.bbbbbbbbbbb.cccccccccccc"

The above command returns JSON structured like this:

{
    "groups": 1,
    "events": 3,
    "news": 2,
    "messages": 1
}

This endpoint returns the number of unseen group messages, events, news stories and private messages.

Get Counter For A Content Type

curl "https://example.ziik.io/api/counters/debate"
  -H "Authorization: Bearer aaaaaaaaaa.bbbbbbbbbbb.cccccccccccc"

The above command returns a simple integer:

1

This endpoint returns the count of unseen group messages, events, news stories or private messages.

HTTP Request

GET https://example.ziik.io/api/counters/<TYPE>

URL Parameters

ParameterTypeDescription
typestringkey for content type - can be 'debate', 'event', 'news' or 'message'

Clear Unseen Content By Type

curl -i -X DELETE "https://example.ziik.io/api/counters/debate"
  -H "Authorization: Bearer aaaaaaaaaa.bbbbbbbbbbb.cccccccccccc"

The above command returns a 204 No Content header on success:

HTTP/1.0 204 No Content

This endpoint clears the count of unseen group messages, events, news stories or private messages.

HTTP Request

DELETE https://example.ziik.io/api/counters/<TYPE>

URL Parameters

ParameterTypeDescription
typestringkey for content type - can be 'debate', 'event', 'news' or 'message'

Get Unseen Content

curl "https://example.ziik.io/api/counters/groups/unseen"
  -H "Authorization: Bearer aaaaaaaaaa.bbbbbbbbbbb.cccccccccccc"

The above command returns JSON structured like this:

[
    {
      "id":124,
      "content_type":"debate",
      "author":{
          "id":234,
          "name":"Test User",
          "avatar":{
              "id":"345",
              "name":"avatar.png",
              "mime":"image/png",
              "size":"54314",
              "type":"image",
              "source":"https://example.ziik.io/api/file/default_images/avatar.png",
              "versions":{
                  "listing":"https://example.ziik.io/api/file/styles/article_listing/private/default_images/avatar.png",
                  "detail":"https://example.ziik.io/api/file/styles/article_desktop/private/default_images/avatar.png",
                  "thumbnail":"https://example.ziik.io/api/file/styles/media_thumbnail/private/default_images/avatar.png"
              }
          },
          "userType":{
              "id":11,
              "name":"Worker",
              "url":"api/user_types/11"
          },
          "url":"api/users/234"
      },
      "date":1465910290,
      "files":[
          {
              "id":"937",
              "name":"begraensningens-kunst.png",
              "mime":"image/png",
              "size":"8731",
              "type":"image",
              "source":"https://example.ziik.io/api/file/groups/files/begraensningens-kunst.png",
              "versions":{
                  "listing":"https://example.ziik.io/api/file/styles/article_listing/private/groups/files/example.png",
                  "detail":"https://example.ziik.io/api/file/styles/article_desktop/private/groups/files/example.png",
                  "thumbnail":"https://example.ziik.io/api/file/styles/media_thumbnail/private/default_images/avatar.png"
              }
          },

      ],
      "stats":{
          "seen":3,
          "comments":0,
          "likes":3,
          "liked":true
      },
      "body":"This is also a discussion",
      "latest_comment": {
          "id": 45,
          "author": {
              "See user service..."
          },
          "body": "Test comment for debates",
          "files": [{
              "id":"345",
              "name":"filename.png",
              "mime":"image/png",
              "size":"54314",
              "type":"image",
              "source":"https://example.ziik.io/api/file/groups/avatar.png",
              "versions":{
                  "listing":"https://example.ziik.io/api/file/styles/article_listing/private/default_images/avatar.png",
                  "detail":"https://example.ziik.io/api/file/styles/article_desktop/private/default_images/avatar.png",
                  "thumbnail":"https://example.ziik.io/api/file/styles/media_thumbnail/private/default_images/avatar.png"
              }
          }],
          "date": 1476697957,
          "url": "api/comments/45",
          "permissions": {
              "edit": false,
              "delete": true
          }
      },
      "url":"api/debates/124",
      "comments_url":"api/debates/124/comments"
    },
    {
    }
]

This endpoint returns the unseen group messages, events, news stories or private messages.

HTTP Request

GET https://example.ziik.io/api/counters/<TYPE>/unseen

URL Parameters

ParameterTypeDescription
typestringkey for content type - can be 'debate', 'event', 'news' or 'message'