Streams

GET /api/streams
get a list of this user's streams

Success Response Code: 200

Response Fields

streams array of stream definitions Array<Stream>
stream[id] numeric ID for this stream Integer
stream[name] name of this stream String
stream[new_updates] whether this stream contains new updates for the requesting user Boolean
stream[default] whether this stream is the default for the requesting user Boolean
stream[custom_stream] whether this is a custom stream defined by the user or a system-generated one Boolean
stream[last_interacted_at] the time this stream was last interacted with, expressed as an epoch timestamp in UTC Integer
stream[group] the stream's group if the stream is associated with a group Group

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/streams.json"

Examples

GET /api/streams.json
200
{
  "streams": [
    {
      "id": 21,
      "name": "Home",
      "new_updates": false,
      "default": true,
      "custom_stream": false,
      "last_interacted_at": 0
    },
    {
      "id": 22,
      "name": "@Mentions",
      "new_updates": false,
      "default": false,
      "custom_stream": false,
      "last_interacted_at": 0
    },
    {
      "id": 23,
      "name": "Bookmarked",
      "new_updates": false,
      "default": false,
      "custom_stream": false,
      "last_interacted_at": 0
    },
    {
      "id": 24,
      "name": "Sent",
      "new_updates": false,
      "default": false,
      "custom_stream": false,
      "last_interacted_at": 0
    },
    {
      "id": 25,
      "name": "Company",
      "new_updates": false,
      "default": false,
      "custom_stream": false
    },
    {
      "id": 26,
      "name": "test&grøup1",
      "new_updates": false,
      "default": false,
      "custom_stream": false,
      "group": {
        "id": 1,
        "name": "test&grøup1",
        "html_name": "test&amp;grøup1",
        "url": "https://socialcast.socialcast.test/groups/1-testgr%C3%B8up1",
        "type": "Group",
        "avatars": {
          "is_system_default": true,
          "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square16-de52f6166f708e54b1b832ef06f92e409ae6b09976b4afc3dddbec820123214e.png",
          "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square30-c3483c74bd99384e67bb1c52a48b68e5e5ff04286e3abdbff3a228ee6f40d08b.png",
          "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square45-a31ef7e33bb699a3663623cd7c8244144c7779f6fb34757b1247bb720addbc32.png",
          "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square70-1886d205945147e3e2a37feb87db68bf29603fc508a049c5defa65a0c79e86cd.png",
          "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square140-3f77aeb71272a1df5c7c0e3a0141e91358b3654f9ff918f4974b77e230cab10e.png"
        },
        "username": "testgrøup1",
        "groupname": "testgrøup1",
        "private": false,
        "external_contributor": false,
        "chat_enabled": false,
        "post_enabled": true,
        "activity_url": "https://socialcast.socialcast.test/groups/1-testgr%C3%B8up1/messages_activity",
        "admin_ids": [
          5
        ],
        "description": null,
        "state": "active",
        "permission": "public",
        "group_type": "standard",
        "member_count": 1,
        "role_key": "admin",
        "can_request_membership": false,
        "can_cancel_membership_request": false,
        "can_join": false,
        "can_leave": false,
        "can_administer": true,
        "chat_stream_id": null,
        "post_stream_id": 26
      },
      "last_interacted_at": 0
    }
  ]
}

GET /api/streams/primary
get the user's primary stream

Note: This API is expected to return a 404 if the user does not have a primary stream (e.g. if the user is an external contributor and does not belong to any groups)

Success Response Code: 200

Response Fields

stream[id] numeric ID for this stream Integer
stream[name] name of this stream String
stream[new_updates] whether this stream contains new updates for the requesting user Boolean
stream[default] whether this stream is the default for the requesting user Boolean
stream[custom_stream] whether this is a custom stream defined by the user or a system-generated one Boolean
stream[last_interacted_at] the time this stream was last interacted with, expressed as an epoch timestamp in UTC Integer
stream[group] the stream's group if the stream is associated with a group Group

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/streams/primary.json"

Examples

GET /api/streams/primary.json
200
{
  "stream": {
    "id": 21,
    "name": "Home",
    "new_updates": false,
    "default": true,
    "custom_stream": false,
    "last_interacted_at": 0
  }
}
GET /api/streams/primary.json
200
{
  "stream": {
    "id": 26,
    "name": "test&grøup1",
    "new_updates": false,
    "default": true,
    "custom_stream": false,
    "group": {
      "id": 1,
      "name": "test&grøup1",
      "html_name": "test&amp;grøup1",
      "url": "https://socialcast.socialcast.test/groups/1-testgr%C3%B8up1",
      "type": "Group",
      "avatars": {
        "is_system_default": true,
        "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square16-de52f6166f708e54b1b832ef06f92e409ae6b09976b4afc3dddbec820123214e.png",
        "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square30-c3483c74bd99384e67bb1c52a48b68e5e5ff04286e3abdbff3a228ee6f40d08b.png",
        "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square45-a31ef7e33bb699a3663623cd7c8244144c7779f6fb34757b1247bb720addbc32.png",
        "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square70-1886d205945147e3e2a37feb87db68bf29603fc508a049c5defa65a0c79e86cd.png",
        "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_group_square140-3f77aeb71272a1df5c7c0e3a0141e91358b3654f9ff918f4974b77e230cab10e.png"
      },
      "username": "testgrøup1",
      "groupname": "testgrøup1",
      "private": false,
      "external_contributor": false,
      "chat_enabled": false,
      "post_enabled": true,
      "activity_url": "https://socialcast.socialcast.test/groups/1-testgr%C3%B8up1/messages_activity",
      "admin_ids": [
        5
      ],
      "description": null,
      "state": "active",
      "permission": "public",
      "group_type": "standard",
      "member_count": 1,
      "role_key": "admin",
      "can_request_membership": false,
      "can_cancel_membership_request": false,
      "can_join": false,
      "can_leave": false,
      "can_administer": true,
      "chat_stream_id": null,
      "post_stream_id": 26
    },
    "last_interacted_at": 0
  }
}
GET /api/streams/primary.json
404
true