getChannelActions - kewalsk/My-OpenPeriscope GitHub Wiki

List of channel history (actions)

GET https://channels.pscp.tv/v1/channels/{cid}/actions

The getChannelActions give information about the history of actions taken on channel, i.e. when the channel was created, who was added and removed, who renamed the channel and who shared or made private broadcast. For long list of channel history the results are given in batches. The first call returns no more than batchSize objects, the tag HasMore is set to true and the Cursor has the value. To get the next batch simply supply the value of Cursor in next call as the query. The batch size is optional but usually cannot be bigger than default value - you can only create smaller batches than default.

The list of actions seems to be sent in reverse chronological order so if the all batches were cached locally there is a need to get only the first one of few of them to get the update.

Request parameters

Place Name Type Description Optional
@Header Authorization String The authorization token got from authorizeToken No
@Path CID String The unique identification number of the channel No
@Query batchSize int The size of one response Yes
@Query cursor String The cursor id from previous batch Yes

Response

Name Type Description Optional
Actions List<PsChannelAction> List of channel information objects No
Cursor String The cursor value if next batch if available Yes
HasMore boolean Indicate if next batch is available Yes

PsChannelAction Fields

Name Type Description Optional
ActionType String The action type No
BroadcastId String The broadcast id if applicable No
CID String The channel id No
ChannelName String The channel named if applicable (for rename action) No
Time datetime The date and time of action No
MemberId String The user id if applicable (i.e. for add and remove actions) No
ById String The user id of member who did the action No
ActorDetails * PsActorDetail The Actor Detail class Yes
BroadcasterUserID * String Should be the user id of broadcaster but has no value Yes
TagName * String ? Yes
CategoryName * String ? Yes
Note * String ? Yes
BannedUserID * String ? Yes
BanReasonCode * int ? Yes
BotmakerDeviceID * String ? Yes

The fields marked by * are not present in application sources, but the server is sending them in response. However most of them has no meaningful value currently.

ActionType values

Value Description
c The channel was created
a User was added to the channel
r User was removed from the channel
s The broadcast was shared to the channel
b The private broadcast was sent to the channel
u The channel name was changed

Error responses

HTTP Result HTTP Message Body message Description
400 Bad Request {"success":false,"msg":"Bad Request"} The request has some improper arguments, for example token is wrong
401 Unauthorized Token did not validate:token is expired The authorization token is expired - get the new one
401 Unauthorized Requires authorization header There is no Authorization header in request
401 Unauthorized Token did not validate:token contains an invalid number of segments The authorization token is wrong
405 Method Not Allowed Wrong HTTP method was used, i.e. POST instead of GET

Example

Sending request (set $token to the proper value first):

curl -H "Authorization: $token" https://channels.pscp.tv/v1/channels/***/actions

Result is shortened and edited to show different actions (the original order could be changed):

 {
    "Actions": [
        {
            "ById": "1DLKBgwDMDmjJ",
            "ActionType": "a",
            "CID": "***",
            "Time": "2019-08-11T10:36:21.993210927Z",
            "ActorDetails": {
                "class_name": "",
                "id": "",
                "created_at": null,
                "is_beta_user": false,
                "is_employee": false,
                "is_twitter_verified": false,
                "twitter_screen_name": "",
                "username": "",
                "display_name": "",
                "description": "",
                "profile_image_urls": null,
                "initials": "",
                "n_followers": 0,
                "n_following": 0,
                "n_hearts": 0
            },
            "MemberId": "1xkQDgmGOwPEz",
            "BroadcastId": "",
            "ChannelName": "",
            "BroadcasterUserID": "",
            "TagName": "",
            "CategoryName": "",
            "Note": "",
            "BannedUserID": "",
            "BanReasonCode": 0,
            "BotmakerDeviceID": ""
        },
        {
            "ById": "1DLKBgwDMDmjJ",
            "ActionType": "a",
            "CID": "***",
            "Time": "2019-08-11T09:41:06.393926841Z",
            "ActorDetails": {
                "class_name": "",
                "id": "",
                "created_at": null,
                "is_beta_user": false,
                "is_employee": false,
                "is_twitter_verified": false,
                "twitter_screen_name": "",
                "username": "",
                "display_name": "",
                "description": "",
                "profile_image_urls": null,
                "initials": "",
                "n_followers": 0,
                "n_following": 0,
                "n_hearts": 0
            },
            "MemberId": "1XJjkvJkJyDKL",
            "BroadcastId": "",
            "ChannelName": "",
            "BroadcasterUserID": "",
            "TagName": "",
            "CategoryName": "",
            "Note": "",
            "BannedUserID": "",
            "BanReasonCode": 0,
            "BotmakerDeviceID": ""
        },
 ...
        {
            "ById": "1wBKAYXXLJZKP",
            "ActionType": "r",
            "CID": "***",
            "Time": "2019-08-11T06:07:45.850343187Z",
            "ActorDetails": {
                "class_name": "",
                "id": "",
                "created_at": null,
                "is_beta_user": false,
                "is_employee": false,
                "is_twitter_verified": false,
                "twitter_screen_name": "",
                "username": "",
                "display_name": "",
                "description": "",
                "profile_image_urls": null,
                "initials": "",
                "n_followers": 0,
                "n_following": 0,
                "n_hearts": 0
            },
            "MemberId": "1wBKAYXXLJZKP",
            "BroadcastId": "",
            "ChannelName": "",
            "BroadcasterUserID": "",
            "TagName": "",
            "CategoryName": "",
            "Note": "",
            "BannedUserID": "",
            "BanReasonCode": 0,
            "BotmakerDeviceID": ""
        },
 ...
        {
            "ById": "1mMKPRVRqgyEG",
            "ActionType": "s",
            "CID": "***",
            "Time": "2019-08-11T09:11:16.086766418Z",
            "ActorDetails": {
                "class_name": "",
                "id": "",
                "created_at": null,
                "is_beta_user": false,
                "is_employee": false,
                "is_twitter_verified": false,
                "twitter_screen_name": "",
                "username": "",
                "display_name": "",
                "description": "",
                "profile_image_urls": null,
                "initials": "",
                "n_followers": 0,
                "n_following": 0,
                "n_hearts": 0
            },
            "MemberId": "",
            "BroadcastId": "1MYxNdMeDnpGw",
            "ChannelName": "",
            "BroadcasterUserID": "",
            "TagName": "",
            "CategoryName": "",
            "Note": "",
            "BannedUserID": "",
            "BanReasonCode": 0,
            "BotmakerDeviceID": ""
        },
 ...
        {
            "ById": "1drjerdZpgyEb",
            "ActionType": "b",
            "CID": "***",
            "Time": "2019-08-11T07:11:49.649169581Z",
            "ActorDetails": {
                "class_name": "",
                "id": "",
                "created_at": null,
                "is_beta_user": false,
                "is_employee": false,
                "is_twitter_verified": false,
                "twitter_screen_name": "",
                "username": "",
                "display_name": "",
                "description": "",
                "profile_image_urls": null,
                "initials": "",
                "n_followers": 0,
                "n_following": 0,
                "n_hearts": 0
            },
            "MemberId": "",
            "BroadcastId": "1lPKqoOPOzEJb",
            "ChannelName": "",
            "BroadcasterUserID": "",
            "TagName": "",
            "CategoryName": "",
            "Note": "",
            "BannedUserID": "",
            "BanReasonCode": 0,
            "BotmakerDeviceID": ""
        },
 ...
        {
            "ById": "1zYKbLbeRzkEe",
            "ActionType": "a",
            "CID": "***",
            "Time": "2019-08-11T03:12:39.736568616Z",
            "ActorDetails": {
                "class_name": "",
                "id": "",
                "created_at": null,
                "is_beta_user": false,
                "is_employee": false,
                "is_twitter_verified": false,
                "twitter_screen_name": "",
                "username": "",
                "display_name": "",
                "description": "",
                "profile_image_urls": null,
                "initials": "",
                "n_followers": 0,
                "n_following": 0,
                "n_hearts": 0
            },
            "MemberId": "1xeKWPepegajP",
            "BroadcastId": "",
            "ChannelName": "",
            "BroadcasterUserID": "",
            "TagName": "",
            "CategoryName": "",
            "Note": "",
            "BannedUserID": "",
            "BanReasonCode": 0,
            "BotmakerDeviceID": ""
        }
    ],
    "Cursor": "eyJjaWQiOnsiQiI6bnVsbCwiQk9PTCI6bnVsbCwiQlMiOm51bGwsIkwiOm51bGwsIk0iOm51bGwsIk4iOm51bGwsIk5TIjpudWxsLCJOVUxMIjpudWxsLCJTIjoiMTM5NjY3NzI4NTEyNDA4Njk5MTUiLCJTUyI6bnVsbH0sInRpbWUiOnsiQiI6bnVsbCwiQk9PTCI6bnVsbCwiQlMiOm51bGwsIkwiOm51bGwsIk0iOm51bGwsIk4iOiIxNTY1NDkzMTU5NzM2NTY4NjE2IiwiTlMiOm51bGwsIk5VTEwiOm51bGwsIlMiOm51bGwsIlNTIjpudWxsfX0=",
    "HasMore": true
 }
⚠️ **GitHub.com Fallback** ⚠️