As the topic says, i cant make it work.
Im using this script in JS in streamlabs:
$.ajax({
url: “https://api.nightbot.tv/1/channel/send ”,
method: “POST”,
headers: {
“Authorization”:“Bearer “””,
},
data: “message={name} is now following!”
});
And inside “” next to bearer i should have my nightbot token but i cant seem to find it. I tried with client secret and client id but doesnt work.
Can someone help me before i go crazy?
Thanks in advance.
Emily
February 19, 2024, 4:05pm
2
Hey @prevgoat !
Remove the extra quotes "
, according to the documentation , and usual API workflow, it should be:
"Authorization": "Bearer ACCESS_TOKEN"
You need to generate the ACCESS TOKEN
with your CLIENT_SECRET
and CLIENT_ID
.
If it’s unclear, I have a guide where I explain how to get the ACCESS_TOKEN
, even though it’s for another use of the API, it may help.
I seriously recommend reading through the entire OAuth 2
section of the API documentation.
The code you provided here uses JQuery, I don’t know if Streamlabs supports it, I doubt it. Have you tried generating that code with an AI? I recommend against it, the AI aren’t aware of the context your code will be used in, therefore it won’t work most of the time.
By the way, this should interest you:
Intro
Are you wondering how to set up Nightbot to automatically welcome your new followers, notify you of any channels hosting you, tip you off about recent donations, or announce new subscribers to your chat? And are you too lazy to set up another bot that probably already has these functions built in? Well today is your lucky day because this is possible to do with the use of Streamlabs! Setting up in-chat alerts for Nightbot will take some work on your part, but I am sure you will not mind if…
Okey thanks alot, will try it out!
system
Closed
March 5, 2024, 1:31am
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.