Introduction
Welcome to the StreamDetails API! You can use our API to access StreamDetails API endpoints. You can view code examples in the dark area to the right.
Authorization
To authorize, use Authorization header:
curl -X POST "https://streamdetails.com/api/v1/{endpoint}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
const axios = require('axios');
const endpoint = 'YOUR_ENDPOINT';
const apiKey = 'YOUR_API_TOKEN';
axios.post(`https://streamdetails.com/api/v1/${endpoint}`, {}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
endpoint = 'YOUR_ENDPOINT'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse("https://streamdetails.com/api/v1/#{endpoint}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
response = http.request(request)
import requests
endpoint = 'YOUR_ENDPOINT'
api_token = 'YOUR_API_TOKEN'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
url = f'https://streamdetails.com/api/v1/{endpoint}'
response = requests.post(url, headers=headers, json={})
<?php
$endpoint = 'YOUR_ENDPOINT';
$apiToken = 'YOUR_API_TOKEN';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://streamdetails.com/api/v1/{$endpoint}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([]));
$response = curl_exec($ch);
curl_close($ch);
?>
Make sure to replace
YOUR_API_TOKEN
with your API key.
All API requests must include the Authorization
header with a valid API token in the format Bearer YOUR_API_TOKEN
. Here's how it works:
StreamDetails expects for the API key to be included in all API requests to the server in a header that looks like the following: Authorization: Bearer YOUR_API_TOKEN
API Responses
The StreamDetails API returns responses in JSON format. Each response has a standard structure that includes two main sections: data
for successful responses and error
for error responses.
Successful Response
A successful response will have a data
section with the requested data and a null
value in the error
section. Here is an example of a successful response:
Successful response:
{
"data": {
"key": "value",
"another_key": 123
},
"error": null
}
Error Response
An error response will have a null
value in the data
section and an error
section providing details about the error. The error
section contains an error code and a message. Here is an example of an error response:
Error response:
{
"data": null,
"error": {
"code": 401,
"message": "Authorization required"
}
}
Channel
Endpoints for managing channels.
Add a Channel
Add a channel from a specific platform
curl -X POST "https://streamdetails.com/api/v1/channel/add" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"platform": "twitch",
"channel": "anychannel"
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/add', {
platform: 'twitch',
channel: 'anychannel'
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/add')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
platform: 'twitch',
channel: 'anychannel'
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/add'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'platform': 'twitch',
'channel': 'anychannel'
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/add';
$data = array(
'platform' => 'twitch',
'channel' => 'anychannel'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/add
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*platform | string | The platform of the channel (twitch, trovo, youtube). |
*channel | string | The channel name (up to 50 characters). |
Response:
{
"data": {
"id": 12345,
"channel": "streamchannel",
"display_name": "streamchannel",
"platform": "twitch",
"image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/4115277e-a8c9-4c4e-91e4-1c3dddee508b-profile_image-300x300.png",
"thread_count": 0,
"autostart_thread_count": 0,
"settings": {
"general": {
"dynamic_threads": false,
"short_lifetime": false,
"connection_speed": 5,
"ad_analytics": true,
"views_multiplier": 4
},
"chatter": {
"enabled": true,
"messages_per_minute": 1,
"greeting_chance": 30,
"goodbying_chance": 15
},
"additional": {
"point_bets_chance": 70,
"point_bets_distribution": 50,
"priority_region": "ANY"
}
},
"management_url": "https://managementurl.com/?id=2&key=YuCSJyWwKSMqJleHO0NWQB8q"
},
"error": null
}
Remove a Channel
Remove a channel by its ID.
curl -X POST "https://streamdetails.com/api/v1/channel/remove" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"channel_id": 12345
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/remove', {
channel_id: 12345
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/remove')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
channel_id: 12345
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/remove'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'channel_id': 12345
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/remove';
$data = array(
'channel_id' => 12345
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/remove
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*channel_id | integer | The ID of the channel to be removed. |
Response:
{
"data": true,
"error": null
}
Get a Channel
Get information about a channel by its ID.
curl -X POST "https://streamdetails.com/api/v1/channel/get" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"channel_id": 12345
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/get', {
channel_id: 12345
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/get')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
channel_id: 12345
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/get'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'channel_id': 12345
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/get';
$data = array(
'channel_id' => 12345
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/get
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*channel_id | integer | The ID of the channel to retrieve. |
Response:
{
"data": {
"id": 12345,
"channel": "streamchannel",
"display_name": "streamchannel",
"platform": "twitch",
"image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/4115277e-a8c9-4c4e-91e4-1c3dddee508b-profile_image-300x300.png",
"thread_count": 0,
"autostart_thread_count": 0,
"settings": {
"general": {
"dynamic_threads": false,
"short_lifetime": false,
"connection_speed": 5,
"ad_analytics": true,
"views_multiplier": 4
},
"chatter": {
"enabled": true,
"messages_per_minute": 1,
"greeting_chance": 30,
"goodbying_chance": 15
},
"additional": {
"point_bets_chance": 70,
"point_bets_distribution": 50,
"priority_region": "ANY"
}
},
"management_url": "https://managementurl.com/?id=2&key=YuCSJyWwKSMqJleHO0NWQB8q"
},
"error": null
}
Get All Channels
Get a list of all channels associated with the current user.
curl -X POST "https://streamdetails.com/api/v1/channel/get-all" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/get-all', {}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/get-all')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/get-all'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
response = requests.post(url, headers=headers, json={})
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/get-all';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([]));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/get-all
- Method:
POST
Response:
{
"data": [
{
"id": 12345,
"channel": "streamchannel",
"display_name": "streamchannel",
"platform": "twitch",
"image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/4115277e-a8c9-4c4e-91e4-1c3dddee508b-profile_image-300x300.png",
"thread_count": 0,
"autostart_thread_count": 0,
"settings": {
"general": {
"dynamic_threads": false,
"short_lifetime": false,
"connection_speed": 5,
"ad_analytics": true,
"views_multiplier": 4
},
"chatter": {
"enabled": true,
"messages_per_minute": 1,
"greeting_chance": 30,
"goodbying_chance": 15
},
"additional": {
"point_bets_chance": 70,
"point_bets_distribution": 50,
"priority_region": "ANY"
}
},
"management_url": "https://managementurl.com/?id=2&key=YuCSJyWwKSMqJleHO0NWQB8q"
},
{
...
},
{
...
},
],
"error": null
}
Update Channel Settings
Update settings for a channel by its ID.
curl -X POST "https://streamdetails.com/api/v1/channel/update-settings" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"channel_id": 12345,
"settings": {
"general": {
"dynamic_threads": true
},
"additional": {
"priority_region": "US"
},
"chatter": {
"messages_per_minute": 5
}
}
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/update-settings', {
channel_id: 12345,
settings: {
general: {
dynamic_threads: true
},
additional: {
priority_region: "US"
},
chatter: {
messages_per_minute: 5
}
}
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/update-settings')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
channel_id: 12345,
settings: {
general: {
dynamic_threads: true
},
additional: {
priority_region: "US"
},
chatter: {
messages_per_minute: 5
}
}
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/update-settings'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'channel_id': 12345,
'settings': {
'general': {
'dynamic_threads': True
},
'additional': {
'priority_region': 'US'
},
'chatter': {
'messages_per_minute': 5
}
}
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/update-settings';
$data = array(
'channel_id' => 12345,
'settings' => array(
'general' => array(
'dynamic_threads' => true
),
'additional' => array(
'priority_region' => 'US'
),
'chatter' => array(
'messages_per_minute' => 5
)
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
- URL:
/api/v1/channel/update-settings
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*channel_id | integer | The ID of the channel to update. |
*settings | object | An object containing the settings to update. |
Response:
{
"data": {
"id": 12345,
"channel": "streamchannel",
"display_name": "streamchannel",
"platform": "twitch",
"image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/4115277e-a8c9-4c4e-91e4-1c3dddee508b-profile_image-300x300.png",
"thread_count": 0,
"autostart_thread_count": 0,
"settings": {
"general": {
"dynamic_threads": true,
"short_lifetime": false,
"connection_speed": 5,
"ad_analytics": true,
"views_multiplier": 4
},
"chatter": {
"messages_per_minute": 5,
"enabled": true,
"greeting_chance": 30,
"goodbying_chance": 15
},
"additional": {
"priority_region": "US",
"point_bets_chance": 70,
"point_bets_distribution": 50
}
},
"management_url": "https://managementurl.com/?id=2&key=YuCSJyWwKSMqJleHO0NWQB8q"
},
"error": null
}
Set Autostart Thread Count
Set the autostart thread count for a channel by its ID.
curl -X POST "https://streamdetails.com/api/v1/channel/set-autostart-thread-count" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"channel_id": 12345,
"thread_count" : 153
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/set-autostart-thread-count', {
channel_id: 12345,
thread_count: 153
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/set-autostart-thread-count')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
channel_id: 12345,
thread_count: 153
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/set-autostart-thread-count'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'channel_id': 12345,
'thread_count': 153
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/set-autostart-thread-count';
$data = array(
'channel_id' => 12345,
'thread_count' => 153
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/set-autostart-thread-count
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*channel_id | integer | The ID of the channel to update. |
*thread_count | integer | The autostart thread count to set. |
Response:
{
"data": true,
"error": null
}
Set Thread Count
Set the current thread count for a channel by its ID.
curl -X POST "https://streamdetails.com/api/v1/channel/set-thread-count" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"channel_id": 12345,
"thread_count" : 153
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/set-thread-count', {
channel_id: 12345,
thread_count: 153
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/set-thread-count')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
channel_id: 12345,
thread_count: 153
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/set-thread-count'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'channel_id': 12345,
'thread_count': 153
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/set-thread-count';
$data = array(
'channel_id' => 12345,
'thread_count' => 153
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/set-thread-count
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*channel_id | integer | The ID of the channel to update. |
*thread_count | integer | The thread count to set. |
Response:
{
"data": true,
"error": null
}
Refresh ChatManagement URL
Create a new link for chat management panel
curl -X POST "https://streamdetails.com/api/v1/channel/refresh-chatmanagement-url" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"channel_id": 12345
}'
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
axios.post('https://streamdetails.com/api/v1/channel/refresh-chatmanagement-url', {
channel_id: 12345
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
}).then(response => {
//
}).catch(error => {
//
});
require 'net/http'
require 'json'
api_token = 'YOUR_API_TOKEN'
uri = URI.parse('https://streamdetails.com/api/v1/channel/refresh-chatmanagement-url')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_token}"
request.body = {
channel_id: 12345
}.to_json
response = http.request(request)
import requests
api_token = 'YOUR_API_TOKEN'
url = 'https://streamdetails.com/api/v1/channel/refresh-chatmanagement-url'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_token}'
}
data = {
'channel_id': 12345
}
response = requests.post(url, headers=headers, json=data)
<?php
$apiToken = 'YOUR_API_TOKEN';
$url = 'https://streamdetails.com/api/v1/channel/refresh-chatmanagement-url';
$data = array(
'channel_id' => 12345
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer {$apiToken}"
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
?>
Request
- URL:
/api/v1/channel/refresh-chatmanagement-url
- Method:
POST
JSON Parameters
Parameter | type | Description |
---|---|---|
*channel_id | integer | The ID of the channel for refresh url. |
Response:
{
"data": {
"url": "https://managementurl.com/?id=2&key=QuCSJSD#MqJleHO0NWQD8q"
},
"error": null
}
Errors
The StreamDetails API uses standard HTTP response codes to indicate the success or failure of an API request. In case of an error, the response will include the following information:
Error Object
Field | Type | Description |
---|---|---|
code | integer | An error code indicating the type of error. |
message | string | A human-readable message providing more details about the error. |
Error Codes
The StreamDetails API may return the following error codes:
400 Bad Request
- Code: 400
- Description: The request was malformed or contained invalid parameters.
401 Unauthorized
- Code: 401
- Description: Authentication failed, or the user does not have permissions for the requested operation.
404 Not Found
- Code: 404
- Description: The requested resource could not be found.
409 Conflict
- Code: 409
- Description: The request conflicts with the current state of the resource.
429 Too Many Requests
- Code: 429
- Description: The user has sent too many requests in a given amount of time.
500 Internal Server Error
- Code: 500
- Description: An internal server error occurred. Please try again later.