Intro
Welcome to the Yokkit API!
Our API endpoint allows for the creation of streams and the issuance of tickets for the yokkit.live video streaming service.
Please reach out to [email protected] for an API key and limit requests to under 10/s.
Streams
Create Stream
curl -X POST "https://api-dev.yokkit.live/v1/streams" \
-H "Authorization: Bearer <API_Token>" \
-d '{
"title": "New Stream",
"tabURL": "Yokkit Home@https://yokkit.com|Yokkit TV@https://yokkit.tv",
"expiration": "2029-12-25 15:27:33"
}'
JSON Response
{
"streamID": "256",
"rtmpURL": "rtmps://rtmp.yokkit.stream/live/",
"rtmpKey": "mkBeiKuffGNp"
}
Create a new stream instance using the provided details. The response will contain a unique streamID
for the stream, as well as a RTMP URL + Key to push a RTMP video stream.
HTTP Request
POST https://api-dev.yokkit.live/v1/streams
Parameters (JSON)
Parameter | Type | Description |
---|---|---|
title * | string |
The title for the stream |
tabURL | string |
Optional page to be displayed in the sidebar. Multiple tabs can be displayed in the sidebar along with named title elements in the format of title@url |title@url . Each tab title and corresponding url are separated by the @ symbol, while those tab pairs are delineated by | |
expiration | string |
Optional UTC Date and time in the format of YYYY-MM-DD HH:MM:SS . Defaults to +1 month after creation. |
introImg | string |
Optional URL to an introductory image shown to viewers prior to the official start of a video stream session. |
playbackURL | string |
Optional URL to a YouTube video or custom video stream to be shown to viewers. |
Get Stream Details
curl "https://api-dev.yokkit.live/v1/streams/<streamID>" \
-H "Authorization: Bearer <API_Token>"
JSON Response
{
"streamID": "253",
"title": "New Stream",
"tabURL": "Yokkit Home@https://yokkit.com|Yokkit TV@https://yokkit.tv",
"expiration": "2023-05-23T11:17:24.594673Z",
"created": "2023-04-23T11:17:24.594673Z",
"rtmpURL": "rtmps://rtmp.yokkit.stream/live/",
"rtmpKey": "GmcpUqQHvrPh",
"tickets": 3
}
Get the details of a specific stream given the streamID
.
HTTP Request
GET https://api-dev.yokkit.live/v1/streams/<streamID>
Parameters
Parameter | Type | Description |
---|---|---|
streamID * | int |
The id of the stream |
Update Stream
curl -X PATCH "https://api-dev.yokkit.live/v1/streams/<streamID>" \
-H "Authorization: Bearer <API_Token>" \
-d "title=New Stream&tabURL=Yokkit Home@https://yokkit.com|Yokkit TV@https://yokkit.tv&expiration=2029-12-25 15:27:33"
HTTP Response
200 OK
Updates the details for an existing stream. All parameters are optional: if any parameters are omitted, the original value remains.
HTTP Request
PATCH https://api-dev.yokkit.live/v1/streams/<streamID>
Parameters
Parameter | Type | Description |
---|---|---|
title * | string |
The title for the stream. |
tabURL | string |
A URL for a page to be displayed in the sidebar. Multiple tabs can be displayed in the sidebar along with named title elements in the format of title@url |title@url . Each tab title and corresponding url are separated by the @ symbol, while those tab pairs are delineated by | |
expiration | string |
Optional UTC Date and time in the format of YYYY-MM-DD HH:MM:SS . Default to +1 if on creation. |
Get All Streams
curl "https://api-dev.yokkit.live/v1/streams" \
-H "Authorization: Bearer <API_Token>"
JSON Response
{
"streams": [
{
"streamid": "253",
"title": "New Stream",
"created": "2023-04-23T11:17:24.594673Z",
"tickets": 4,
},
{
"streamid": "254",
"title": "New Stream",
"created": "2023-04-23T11:17:24.594673Z",
"tickets": 0,
},
]
}
Get all streams associated with the API key.
HTTP Request
GET https://api-dev.yokkit.live/v1/streams
Tickets
Create Tickets
curl -X POST "https://api-dev.yokkit.live/v1/streams/<streamID>/tickets" \
-H "Authorization: Bearer <API_Token>" \
-d '{
"name":"Test",
"email":"[email protected]",
"expiration":"2029-12-25 13:59:59"
}'
JSON Response
{
"ticketID": "7682",
"passcode": "58530865",
"name": "Test",
"email": "[email protected]",
"expiration": "2023-05-23T13:17:34.672407Z"
}
Create a new ticket for the given stream. Each ticket represents a unique viewer and the passcode
is entered by the user in order to get access to the associated stream.
HTTP Request
POST https://api-dev.yokkit.live/v1/streams/<streamID>/tickets
Parameters
Parameter | Type | Description |
---|---|---|
streamID * | int |
The id of the stream to add the viewer to (in url) |
name | string |
Optional name to associate with the ticket |
string |
Optional email to associate with the ticket | |
expiration | string |
Optional expiration date. The date and time is in UTC in the format of YYYY-MM-DD HH:MM:SS . Defaults to +1 month on creation. |
Get Ticket Details
curl "https://api-dev.yokkit.live/v1/tickets/<ticketID>" \
-H "Authorization: Bearer <API_Token>"
JSON Response
{
"ticketID": "7682",
"streamID": "253",
"passcode": "58530865",
"name": "Test",
"email": "[email protected]",
"expiration": "2023-05-23T13:17:34.672407Z"
}
Get the details associated with a given ticketID
. Note that the name
and email
would only be available provided that they were passed to us when the ticket was initially created.
If a ticket has not been used, the firstEntry
field in the response will be empty string. Otherwise, it will be set to the date/time in UTC (ISO 8601 format).
HTTP Request
GET https://api-dev.yokkit.live/v1/tickets/<ticketID>
Parameters
Parameter | Type | Description |
---|---|---|
ticketID * | int |
The id of the ticket to be looked up |
Get All Tickets
curl "https://api-dev.yokkit.live/v1/streams/<streamID>/tickets" \
-H "Authorization: Bearer <API_Token>"
JSON Response
{
"tickets": [
{
"ticketID": "1001",
"name": "Name",
"firstEntry": "",
},
{
"ticketID": "1002",
"name": "Name",
"firstEntry": "2023-05-23T13:17:34.672407Z",
}
]
}
Get all tickets associated with the given streamID
.
HTTP Request
GET https://api-dev.yokkit.live/v1/streams/<streamID>/tickets
Parameters
Parameter | Type | Description |
---|---|---|
streamID * | int |
The id of the stream |
Cancel Ticket
Cancels and removes the given ticket. This would also immediately kick a user off the stream if they happen to be actively viewing it.
curl -X DELETE "https://api-dev.yokkit.live/v1/tickets/<ticketID>" \
-H "Authorization: Bearer <API_Token>"
HTTP Response
200 OK
HTTP Request
DELETE https://api-dev.yokkit.live/v1/tickets/<ticketID>
Parameters
Parameter | Type | Description |
---|---|---|
ticketID * | int |
The id of the ticket to be removed |
Restore Ticket
Restores and re-activates a given ticket if it has been previously removed.
curl -X POST "https://api-dev.yokkit.live/v1/tickets/<ticketID>" \
-H "Authorization: Bearer <API_Token>"
HTTP Response
200 OK
HTTP Request
POST https://api-dev.yokkit.live/v1/tickets/<ticketID>
Parameters
Parameter | Type | Description |
---|---|---|
ticketID * | int |
The id of the ticket to be restored |
Reverse Lookup
curl "https://api-dev.yokkit.live/v1/tickets/lookup/<passcode>" \
-H "Authorization: Bearer <API_Token>"
JSON Response
{
"streamID": "253",
"ticketID": "7681"
}
Given a passcode, look up the associated ticketID
and streamID
HTTP Request
GET https://api-dev.yokkit.live/v1/tickets/lookup/<passcode>
Parameters
Parameter | Type | Description |
---|---|---|
passcode * | string |
The passcode the viewer enters to view the stream. |
Errors
Error Code | Name | Diagnosis |
---|---|---|
400 | Bad Request | Malformed request. |
401 | Unauthorized | Your API key is wrong. |
404 | Not Found | The API endpoint does not exist |
405 | Method Not Allowed | Incorrect method for the API request. |
429 | Throttled | Too many requests within a short time. Please slow down! |
500 | Internal Server Error | We had a problem with our server. Please try again later. |
503 | Service Unavailable | We're temporarily offline for maintenance/upgrades. Please try again later. |