Skip to content

HTTP Server

Nathan edited this page Aug 16, 2021 · 3 revisions

You'll be able to setup an HTTP listener within CPH to make HTTP queries to execute actions and query for data.

HTTP Server Settings

Most methods mirror the Websocket Server requests that you can make

Available Methods

/GetActions (GET)

This is a very basic request, and will get you a list of the actions in CPH, this mirrors the Websocket server request.

"actions": [
  {
    "id": "<action guid>",
    "name": "<action name>"
  },
]

/DoAction (POST)

This will allow you to execute an action, it returns no data, only a 204 No Content response, it is a POST method and requires the following data

{
  "action": {
    "id": "<guid>",
    "name": "<name>"
  },
  "args": {
    "key": "value",
  }
}

/GetCredits (GET)

You can retrieve the credits data via this request.

Request results will be

{
  "Events": {
    "Follows": [],
    "Cheers": [],
    "Subs": [],
    "ReSubs": [],
    "GiftSubs": [],
    "GiftBombs": [],
    "Raided": [],
    "RewardRedemptions": [],
    "GoalContributions": [],
    "GameUpdates": [],
    "Pyramids": []
  },
  "HypeTrainConductor": [],
  "HypeTrainContributors": [],
  "User": {
    "Editors": [],
    "Moderator": [],
    "Subscriber": [],
    "VIPs": [],
    "Users": [],
    "regulars": []
  },
  "Custom": {},
  "TopBits": {
    "All": [],
    "Month": [],
    "Week": []
  },
  "TopChannelRewards": []
}

/TestCredits (GET)

This will provide a credits data but with dummy data filled in so you can do testing

/ClearCredits (GET)

This will clear the credits, and return a 204 No Content response

/ClearFirstWordsCache (GET)

This will clear the first words cache, and return a 204 No Content response

Clone this wiki locally