Triggering alerts
This tutorial will walk you through the simple methods of triggering alerts using the Streamlabs API.
1. Setup your workflow
We already assume that you have traversed through Getting Started and are now all ready to to hit the api! Visit the /alerts page to get a snippet of the code you need for your favorite programming language, to get the API to return donations. Here is an example written in Python.
import requests
url = "https://streamlabs.com/api/v2.0/alerts"
querystring = {
"type":"subscription",
"image_href":"https://www.randomwebsite.com/monkey.gif",
"sound_href":"https://www.randomwebsite.com/honksound.wav",
"message":"Your streams are the best!",
"duration":"3000",
"special_text_color":"Orange",
}
response = requests.request("POST", url, params=querystring)
print(response.text)
2. Enjoy
Our recommended limits are 2 alerts per minute per user. Enjoy!
Updated almost 2 years ago