Reddit Connector
These endpoints control the Reddit Connector module.
Note
For the Reddit Connector module, the base URL for the API gateway endpoints is https://gateway.cycloptux.com/api/v1/bots/:appClientId/servers/:serverId/modules/reddit.
Get Reddit Feeds
HTTP Request Example
GET /feeds HTTP/1.1
User-Agent: <YOUR_USER_AGENT>
Host: gateway.cycloptux.com
Accept: application/json
Authorization: <ACCESS_TOKEN> HTTP Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"feeds": [
{
"id": "5ffecffcdd4f55cb3def6e09",
"feed_identifier": "discordapp",
"webhook_options": {
"filter_flair": [
"official post"
],
"filter_mode": "OR",
"filter_words": null,
"filter_excl": false,
"nsfw": null,
"custom_header": null,
"webhook-name": null,
"no-username-overwrite": false,
"no-avatar-overwrite": false
},
"webhook_info": {
"name": "Reddit",
"avatar": null,
"channel_id": "697506961540907059"
}
},
...
]
} This endpoint retrieves the list of feeds for a server.
HTTP Request
GET https://gateway.cycloptux.com/api/v1/bots/:appClientId/servers/:serverId/modules/reddit/feeds
HTTP Response
The response contains the feeds array. Each element of the array has the following parameters:
| Parameter | Type | Description |
|---|---|---|
| id | String | The feed unique ID. |
| feed_identifier | String | The feed-specific identifier. |
| webhook_options | Object | The feed-specific webhook options. |
| webhook_info | Object | The information about the webhook the feed is streaming to. |
The webhook_options object contains the following parameters:
| Parameter | Type | Description |
|---|---|---|
| filter_flair | ?Array<String> | An array of Reddit flairs to filter (i.e. whitelist) when posting items to the feed. null means that the filter is disabled. |
| filter_mode | String | The filter behavior when more than one word is added to the whitelist filter (filter_words). This can be either AND or OR. |
| nsfw | ?String | The NSFW behavior to apply when posting items to the feed if they are marked as NSFW on Reddit. null means that the NSFW behavior is disabled. When populated, this can be either censor, skip or only. |
| filter_words | ?Array<String> | An array of words to filter (i.e. whitelist or blacklist, depending on filter_excl) when posting items to the feed. null means that the filter is disabled. |
| filter_excl | Boolean | When set to true, items will be posted to the feed only if they do not contain the filtered word(s). When set to false, items will be posted to the feed only if they do contain the filtered word(s). |
| custom_header | ?String | A custom template to use as message content when posting items to the feed. Custom headers can have a maximum of 1024 characters. null means that the default header will be used. |
| webhook-name | ?String | A custom name to use as webhook name (i.e. author) when posting items to the feed. Custom names can have a maximum of 32 characters. null means that the default webhook name will be used. |
| no-username-overwrite | Boolean | When set to true, the webhook name defined within the "Integrations" section of Discord will not be overwritten by the default or custom webhook name. |
| no-avatar-overwrite | Boolean | When set to true, the webhook avatar defined within the "Integrations" section of Discord will not be overwritten by the default webhook avatar. |
The webhook_info object contains the following parameters:
| Parameter | Type | Description |
|---|---|---|
| name | String | The name of the webhook. |
| avatar | String | The avatar hash of the webhook. |
| channel_id | String | The ID of the channel the webhook belongs to. |
Create Reddit Feed
HTTP Request Example
POST /feeds HTTP/1.1
User-Agent: <YOUR_USER_AGENT>
Host: gateway.cycloptux.com
Accept: application/json
Authorization: <ACCESS_TOKEN>
{
"feed_identifier": "movies",
"webhook_channel": "697506961540907059",
"webhook_options": {
"filter_flair": ["ama"]
}
} HTTP Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "625206abd39ad73f8a4c369f",
"feed_identifier": "movies",
"webhook_options": {
"filter_flair": [
"ama"
],
"filter_words": null,
"filter_mode": "OR",
"filter_excl": false,
"nsfw": null,
"custom_header": null,
"webhook-name": null,
"no-username-overwrite": false,
"no-avatar-overwrite": false
},
"webhook_info": {
"name": "GiselleBot Social Feeds",
"avatar": null,
"channel_id": "697506961540907059"
}
} This endpoint creates a new feed in a server.
HTTP Request
POST https://gateway.cycloptux.com/api/v1/bots/:appClientId/servers/:serverId/modules/reddit/feeds
Request body parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| feed_identifier | String | true | The feed-specific identifier. |
| webhook_channel | String | true* | The ID of the channel the feed will be posted to. If the channel ID is specified, the bot will attempt to create a webhook in that channel (if a usable one isn't already present). At least one between webhook_channel and webhook_url must be filled. |
| webhook_url | String | true* | The URL of the webhook the feed will be posted to. At least one between webhook_channel and webhook_url must be filled. |
| webhook_options | Object | false | The options for the feed, as described in the corresponding object in Get Reddit Feeds. If you don't pass one or more options, or don't pass the whole object, default options will be used. |
HTTP Response
The response consists of a feed object.
Refer to Get Reddit Feeds for the full list of parameters.
Update Reddit Feed
HTTP Request Example
PATCH /feeds/625206abd39ad73f8a4c369f HTTP/1.1
User-Agent: <YOUR_USER_AGENT>
Host: gateway.cycloptux.com
Accept: application/json
Authorization: <ACCESS_TOKEN>
{
"webhook_options": {
"filter_flair": ["ama", "news"]
}
} HTTP Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "625206abd39ad73f8a4c369f",
"feed_identifier": "movies",
"webhook_options": {
"filter_flair": [
"ama",
"news"
],
"filter_words": null,
"filter_mode": "OR",
"filter_excl": false,
"nsfw": null,
"custom_header": null,
"webhook-name": null,
"no-username-overwrite": false,
"no-avatar-overwrite": false
},
"webhook_info": {
"name": "GiselleBot Social Feeds",
"avatar": null,
"channel_id": "697506961540907059"
}
} This endpoint updates a feed in a server.
HTTP Request
PATCH https://gateway.cycloptux.com/api/v1/bots/:appClientId/servers/:serverId/modules/reddit/feeds/:feedId
You must send a body with the updated webhook_options object. Refer to Get Reddit Feeds for the full list of parameters. You cannot update the feed_identifier, webhook_channel or webhook_url for an existing feed.
HTTP Response
The response consists of a feed object.
Refer to Get Reddit Feeds for the full list of parameters.
Delete Reddit Feed
HTTP Request Example
DELETE /feeds/625206abd39ad73f8a4c369f HTTP/1.1
User-Agent: <YOUR_USER_AGENT>
Host: gateway.cycloptux.com
Accept: application/json
Authorization: <ACCESS_TOKEN> HTTP Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true
} This endpoint deletes a feed in a server.
HTTP Request
DELETE https://gateway.cycloptux.com/api/v1/bots/:appClientId/servers/:serverId/modules/reddit/feeds/:feedId
HTTP Response
The response consists of an atomic object, containing a success parameter (Boolean) indicating whether the feed was successfully deleted.