Broadcast Receivers

Freckle is now Noko! Learn how to migrate your apps here

Not implemented yet!

This is just a sneak peek into how this resource might work. Attempting to call any actions will return a 404 error.

This API allows you to manage your broadcast receivers entirely from the API, so you can set up your integrations automatically without requiring any user configuration.

List Broadcast Receivers

Get all broadcast receivers, sorted by the most recently created

GET /v2/broadcast_receivers
name
Optional string
Only broadcast receivers containing this text in their name are returned.
Example: name=Notifier
subjects
Optional string
A comma-separated list of subjects to filter by.
Example: subjects=entry.updated,entry.updated.approved
state
Optional string
Only broadcast receivers in this state will be returned. Accepted Values are:
  • enabled
  • disabled

Response

Status: 200 OK
Link: <https://api.nokotime.com/v2/broadcast_receivers?page=2>; rel="next",
 <https://api.nokotime.com/v2/broadcast_receivers?page=5>; rel="last"
[
  {
    "id": 77885522,
    "name": "Da Best Timer Sync",
    "state": "enabled",
    "subjects": [
      "timer"
    ],
    "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
    "url": "https://api.nokotime.com/v2/broadcast_receivers/987654",
    "add_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/add_subjects",
    "remove_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/remove_subjects",
    "reroll_secret_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/reroll_secret",
    "enable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/enable",
    "disable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/disable"
  }
]

Get a single Broadcast Receiver

GET /v2/broadcast_receivers/:id
Status: 200 OK
{
  "id": 77885522,
  "name": "Da Best Timer Sync",
  "state": "enabled",
  "subjects": [
    "timer"
  ],
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
  "url": "https://api.nokotime.com/v2/broadcast_receivers/987654",
  "add_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/add_subjects",
  "remove_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/remove_subjects",
  "reroll_secret_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/reroll_secret",
  "enable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/enable",
  "disable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/disable"
}

Create a Broadcast Receiver

POST /v2/broadcast_receivers/

Inputs

name
Required string
The name of the Broadcast Receiver
payload_uri
Required string
The URI to send the payloads to.
subjects
Required array of strings
The subjects this broadcast receiver should be subscribed to.
You can also specify '*', which is a wildcard for all current and future subjects.
{
  "name": "Da Best Timer Sync",
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
  "subjects": [
    "timer"
  ]
}

Response

Status: 201 Created
Location: https://api.nokotime.com/v2/broadcast_receivers/123456
{
  "id": 77885522,
  "name": "Da Best Timer Sync",
  "state": "enabled",
  "subjects": [
    "timer"
  ],
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
  "url": "https://api.nokotime.com/v2/broadcast_receivers/987654",
  "add_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/add_subjects",
  "remove_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/remove_subjects",
  "reroll_secret_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/reroll_secret",
  "enable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/enable",
  "disable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/disable",
  "secret": "gfds-64563-secret-value"
}

Storing your broadcast receiver’s secret.

You will only receive the broadcast receiver’s secret when first creating the broadcast receiver, so make sure to store it!

Edit a Broadcast Receiver

PUT /v2/broadcast_receivers/:id

Inputs

name
Optional string
The name of the Broadcast Receiver
payload_uri
Optional string
The URI to send the payloads to.
{
  "name": "Da Best Timer Sync",
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages"
}

Response

Status: 200 OK
{
  "id": 77885522,
  "name": "Da Best Timer Sync",
  "state": "enabled",
  "subjects": [
    "timer"
  ],
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
  "url": "https://api.nokotime.com/v2/broadcast_receivers/987654",
  "add_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/add_subjects",
  "remove_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/remove_subjects",
  "reroll_secret_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/reroll_secret",
  "enable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/enable",
  "disable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/disable"
}

Add subjects to a Broadcast Receiver

PUT /v2/broadcast_receivers/:id/add_subjects

Inputs

subjects
Required array of strings
The subjects this broadcast receiver should be subscribed to. Any subjects the broadcast receiver is already subscribed to will be ignored and will not affect the response.
You can also specify '*', which is a wildcard for all current and future subjects.
{
  "subjects": [
    "timer"
  ]
}

Response

Status: 200 OK
{
  "id": 77885522,
  "name": "Da Best Timer Sync",
  "state": "enabled",
  "subjects": [
    "timer"
  ],
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
  "url": "https://api.nokotime.com/v2/broadcast_receivers/987654",
  "add_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/add_subjects",
  "remove_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/remove_subjects",
  "reroll_secret_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/reroll_secret",
  "enable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/enable",
  "disable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/disable"
}

Remove subjects from a Broadcast Receiver

PUT /v2/broadcast_receivers/:id/remove_subjects

Inputs

subjects
Required array of strings
The subjects this broadcast receiver should not be subscribed to. Any subjects the broadcast receiver is not already subscribed to will be ignored and will not affect the response.
{
  "subjects": [
    "timer"
  ]
}

Response

Status: 200 OK
{
  "id": 77885522,
  "name": "Da Best Timer Sync",
  "state": "enabled",
  "subjects": [
    "timer"
  ],
  "payload_uri": "http://dabestnokoapp.com/broadcasts/timer_messages",
  "url": "https://api.nokotime.com/v2/broadcast_receivers/987654",
  "add_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/add_subjects",
  "remove_subjects_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/remove_subjects",
  "reroll_secret_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/reroll_secret",
  "enable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/enable",
  "disable_url": "https://api.nokotime.com/v2/broadcast_receivers/987654/disable"
}

Re-roll a Broadcast Receiver’s secret

PUT /v2/broadcast_receivers/:id/reroll_secret

Response

Status: 200 OK
{
  "secret": "gfds-64563-secret-value"
}

Disable a Broadcast Receiver

PUT /v2/broadcast_receivers/:id/disable

Response

Status: 204 No Content

Enable a Broadcast Receiver

PUT /v2/broadcast_receivers/:id/enable

Response

Status: 204 No Content

Delete a Broadcast Receiver

DELETE /v2/broadcast_receivers/:id

Response

Status: 204 No Content