{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/alerts","auth":"required","results":{"codes":[{"language":"json","code":"{\n\t\"success\": true\n}","name":"","status":200},{"status":400,"language":"json","code":"{\n  \"error\": \"...\",\n  \"message\": \"...\"\n}","name":""}]},"settings":"","examples":{"codes":[{"name":"","code":"<?php\n    \n$client = new GuzzleHttp\\Client();\n\ntry {\n\n  //if using Guzzle 6+ change \"body\" to \"form_params\"\n  $response = $client->post('https://streamlabs.com/api/v1.0/alerts', [\n    'body' => [\n      'access_token' \t\t\t\t=> 'ACCESS_TOKEN_HERE',\n      'type' \t\t\t\t\t\t\t\t=> 'donation',\n      'message' \t\t\t\t\t\t=> '*Billy* bought a *Catarrian Shirt*!',\n      'image_href' \t\t\t\t\t=> 'http://path/to/your/image.png',\n      'sound_href' \t\t\t\t\t=> '',\n      'special_text_color' \t=> '#199dce'\n    ]\n  ]);\n\n} catch (Exception $e) {\n\n  //failed\n  $result = $e->getResponse()->json();\n\n}\n","language":"php"}]},"method":"post","params":[{"name":"type","type":"string","default":"","desc":"This parameter determines which alert box this alert will show up in, and thus should be one of the following: **follow**, **subscription**, **donation**, or **host**","required":true,"in":"body","ref":"","_id":"55bb0840d0736b3100bf105d"},{"name":"image_href","type":"string","default":"","desc":"The href pointing to an image resource to play when this alert shows. If an empty string is supplied, no image will be displayed.","required":false,"in":"body","ref":"","_id":"55bb0a021b0d663700781694"},{"name":"sound_href","type":"string","default":"","desc":"The href pointing to a sound resource to play when this alert shows. If an empty string is supplied, no sound will be played.","required":false,"in":"body","ref":"","_id":"55bb0a021b0d663700781692"},{"name":"message","type":"string","default":"","desc":"The message to show with this alert. If not supplied, no message will be shown. Surround special tokens with \\*s, for example: This is my \\*special\\* alert!","required":false,"in":"body","ref":"","_id":"55bb0aa03f0767230008f54b"},{"name":"duration","type":"int","default":"","desc":"How many seconds this alert should be displayed. Value should be in milliseconds.Ex: 1000 for 1 second","required":false,"in":"body","ref":"","_id":"55bb0d20d0736b3100bf1064"},{"name":"special_text_color","type":"string","default":"","desc":"The color to use for special tokens. Must be a valid CSS color string.","required":false,"in":"body","ref":"","_id":"55bc00e576754617002aa854"}]},"next":{"description":"","pages":[]},"title":"/alerts","type":"endpoint","slug":"alerts","excerpt":"Trigger a custom alert for the authenticated user.","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Default Values\",\n  \"body\": \"If any of the *optional parameters* are not supplied, they will default to the settings the user has selected in the Streamlabs dashboard for the supplied alert `type`.\"\n}\n[/block]","updates":["579c861cf3f4d50e00b547bd","583808f750cb521900127e7a","584fa31c0a65a92300de7740","5868fbcad36a8225002517c5","5868fbcb1f6e632f0029bbd4","5868fbcb3f82a319007df5b9","5868fbde7bb0180f00991fc2","5868fbe245721c1900ae0288","58726d67b753f02d00813eb9","58862f9ce2f28519005a0542","58862f9d2393d50f00f1326b","58862fab16a6351900dcdd7e","588fdd67762db13100dfe6e6","58b0a5a92c149b0f007c9885","58c350072c506d0f00c1b1f9","58e2ab0a6194cf3b00f31166","58ed5e96afceeb2f00ce71f1","5910c7dc85c1bd0f0033b9b8"],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55baf1d51b0d66370078166c","__v":25,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Alerts","slug":"alerts","order":4,"from_sync":false,"reference":true,"_id":"55baf3f01b0d66370078166e","project":"55baca9cd0736b3100bf1008","version":"55baca9cd0736b3100bf100b","createdAt":"2015-07-31T04:05:04.398Z","__v":0},"editedParams":true,"githubsync":"","editedParams2":true,"user":"55baca333f0767230008f4ff","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55baca9dd0736b3100bf100c","55bacba0d0736b3100bf1017","55bad8f33f0767230008f517","55baf3f01b0d66370078166e","55baf4151b0d66370078166f","55f1cca35fe76419007dc794","573e2d6e610a090e00ca2b97","58d97ce57718211b0028e6bc","599b510cb683b50031a35299","5a871c493948fd004697e677"],"_id":"55baca9cd0736b3100bf100b","createdAt":"2015-07-31T01:08:44.540Z","project":"55baca9cd0736b3100bf1008","__v":10,"releaseDate":"2015-07-31T01:08:44.540Z"},"createdAt":"2015-07-31T03:56:05.561Z","parentDoc":null,"project":"55baca9cd0736b3100bf1008"}

post/alerts

Trigger a custom alert for the authenticated user.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

type:
required
string
This parameter determines which alert box this alert will show up in, and thus should be one of the following: **follow**, **subscription**, **donation**, or **host**
image_href:
string
The href pointing to an image resource to play when this alert shows. If an empty string is supplied, no image will be displayed.
sound_href:
string
The href pointing to a sound resource to play when this alert shows. If an empty string is supplied, no sound will be played.
message:
string
The message to show with this alert. If not supplied, no message will be shown. Surround special tokens with \*s, for example: This is my \*special\* alert!
duration:
integer
How many seconds this alert should be displayed. Value should be in milliseconds.Ex: 1000 for 1 second
special_text_color:
string
The color to use for special tokens. Must be a valid CSS color string.

Examples


Result Format


Documentation

[block:callout] { "type": "info", "title": "Default Values", "body": "If any of the *optional parameters* are not supplied, they will default to the settings the user has selected in the Streamlabs dashboard for the supplied alert `type`." } [/block]