Welcome to World of IPTV

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Forum Rules

Our Rules: Read to avoid getting banned!

Advertising

Introduce Yourself to the World with Us!

Resource Database

Find the newest resources around IPTV!

Account upgrade

Upgrade your account to unlock more benefits!

Tutorial XUI.ONE Admin API - Placeholder

redhat

Administrator
Staff member
Administrator
Joined
Jun 19, 2019
Messages
3,298
Reaction score
15,884
Points
134
Location
root[@]woi
XUI.ONE Admin API - Placeholder


This is a placeholder post for Admin API information.
It is available in the latest releases and can be enabled by adding an Admin API access code for the Admin user group you want it to apply to. From there you can login as an admin and go to Edit Profile to generate an API key.

You can then access the API via:
http: http://yoursite.com:8000/accesscode/?api_key=#APIKEY#
https: https://yoursite.com:9000/accesscode/?api_key=#APIKEY#

For Example:
https://[domain]:[port]/[accesscode]/?api_key=[api_key]&actoion=[api_command]
https://bestdomain.com:9000/rnVKrSLe/?api_key=1A2C5C80056A80F5AB6ECAD3937875DE&action=get_packages

As a developer, use this as your API endpoint and set the "action" parameter to one of the following API commands:

GET INFO
mysql_query user_info get_lines get_mags get_enigmas get_users get_streams get_channels get_stations get_movies get_series_list get_episodes

LOGS & EVENT API
activity_logs live_connections credit_logs client_logs user_logs stream_errors watch_output system_logs login_logs restream_logs mag_events

LINE API
get_line create_line edit_line delete_line disable_line enable_line unban_line ban_line

USER API
get_user create_user edit_user delete_user disable_user enable_user

MAG API
get_mag create_mag edit_mag delete_mag disable_mag enable_mag unban_mag ban_mag convert_mag

ENIGMA API
get_enigma create_enigma edit_enigma delete_enigma disable_enigma enable_enigma unban_enigma ban_enigma convert_enigma

BOUQUETE API
get_bouquets get_bouquet create_bouquet edit_bouquet delete_bouquet

ACCESS CODE API
get_access_codes get_access_code create_access_code edit_access_code delete_access_code

HMAC API
get_hmacs get_hmac create_hmac edit_hmac delete_hmac

EPG API
get_epgs get_epg create_epg edit_epg delete_epg reload_epg

GROUPS API
get_groups get_group create_group edit_group delete_group

PACKAGES API
get_packages get_package create_package edit_package delete_package

TRANSCODING PROFILE API
get_transcode_profiles get_transcode_profile create_transcode_profile edit_transcode_profile delete_transcode_profile

RTMP API
get_rtmp_ips get_rtmp_ip create_rtmp_ip edit_rtmp_ip delete_rtmp_ip

CATEGORIES API
get_categories get_category create_category edit_category delete_category

SUB RESELLER API
get_subresellers get_subreseller create_subreseller edit_subreseller delete_subreseller

WATCH FOLDERS API
get_watch_folders get_watch_folder create_watch_folder edit_watch_folder delete_watch_folder reload_watch_folder

BLOCKED ISP & IP API
get_blocked_isps add_blocked_isp delete_blocked_isp get_blocked_uas add_blocked_ua delete_blocked_ua get_blocked_ips add_blocked_ip delete_blocked_ip flush_blocked_ips

STREAMS API
get_stream create_stream edit_stream start_stream stop_stream delete_stream

CHANNEL API
get_channel create_channel edit_channel start_channel stop_channel delete_channel

STATION API
get_station create_station edit_station start_station stop_station delete_station

MOVIE API
get_movie create_movie edit_movie start_movie stop_movie delete_movie

SERIES API
get_series create_series edit_series delete_series

EPISONE API
get_episode create_episode delete_episode edit_episode start_episode stop_episode

SERVERS API
get_servers get_server install_server delete_server edit_server install_proxy edit_proxy

SETTINGS, STATS AND OTHER API
get_settings edit_settings get_server_stats get_fpm_status get_rtmp_stats get_free_space get_pids get_certificate_info reload_nginx clear_temp clear_streams update_blacklist get_directory kill_pid kill_connection reload_cache

Upcoming API information will help identify what each function does, and what parameters can be submitted.
For now, if you want to poke around I suggest using the Admin Interface with Developer Tools enabled and log any traffic to post.php. The parameters sent there will be the same parameters you can send to the API function it relates to.

For example if you go to Streams and add a stream, you can log post.php and submit the same request to the create_stream function to replicate it.
To edit a stream, pass the id with it too.

Some of the functions are server specific, so send server_id with them, for example:
get_server_stats, get_fpm_status, get_rtmp_stats, get_free_space, get_pids, get_certificate_info, reload_nginx, clear_temp, clear_streams, update_blacklist, get_directory

Line Example - Editing line #4 to change password to helloworld and select bouquets 1 and 2:
action=edit_line&id=4&username=test&password=helloworld&bouquets_selected[]=1&bouquets_selected[]=2

More info soon, post any questions below and I'll answer them for you. Included an extract from the API so you can kind of see what's going on.
 

Attachments

Download limits

Last edited:
hey please we are making a generic player that is already working with the XC player api , but we heard the xui one player api is different from the , if yes please provide us with any information
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
im in trouble on "bouquet and allowed_outpus someone maybe helpme


how i can fill to ??? on that api code?

I try it with:
https://mdomain.com:9000/rTITIoWd/?api_key=2C097DCA660A604A439FF7A711206003&action=create_line&is_trial=1&username=testapiuser3&exp_date=1hour&bouquets[]=1&output_formats[]=1

and as well with:
https://mdomain.com:9000/rTITIoWd/?api_key=2C097DCA660A604A439FF7A711206003&action=create_line&is_trial=1&username=testapiuser3&exp_date=1hour&bouquets=1&allowed_outputs=1

But unfortunately, i didn't had luck. May some members can help with.
 
How to find out the API PINNEL Xtreme. ui
 
im in trouble on "bouquet and allowed_outpus someone maybe helpme





how i can fill to ??? on that api code?
PS: i have not used this this yet but for output and bouquet 1 or 0 or even numbers does not make sense if you check attached text file and api file..
It is does not request for Bouquet ID -- but for name and for output you can pass valid arg i.e ts or hls or mpxxxx

"STATUS_SUCCESS", "data" => getBouquets()

I think this should work: while bouquets=UK ( UK is name of bouquet for multiple it show accept as UK,US,ETC )

 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
Is there an API call to disable the ISP lock? For some reason by default it gets turned on by my WHMCS module even though it wouldn’t if I created the line directly so I would like to create a script to turn it off after the line is created.
 
I can't download the API documentation, I get this error:
You do not have permission to view this page or perform this action.

How can I access the documentation?
 
I can't download the API documentation, I get this error:
You do not have permission to view this page or perform this action.

How can I access the documentation?
Upgrade your account?
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
For anyone still stuck with the bouquets, it needs to be first action after create_line. See below.

&action=create_line&bouquets_selected=["1","7","8","9","12","15"]
 
XUI.ONE Admin API - Placeholder


This is a placeholder post for Admin API information.
It is available in the latest releases and can be enabled by adding an Admin API access code for the Admin user group you want it to apply to. From there you can login as an admin and go to Edit Profile to generate an API key.

You can then access the API via:
http: http://yoursite.com:8000/accesscode/?api_key=#APIKEY#
https: https://yoursite.com:9000/accesscode/?api_key=#APIKEY#

For Example:
https://[domain]:[port]/[accesscode]/?api_key=[api_key]&actoion=[api_command]
https://bestdomain.com:9000/rnVKrSLe/?api_key=1A2C5C80056A80F5AB6ECAD3937875DE&action=get_packages

As a developer, use this as your API endpoint and set the "action" parameter to one of the following API commands:

GET INFO
mysql_query user_info get_lines get_mags get_enigmas get_users get_streams get_channels get_stations get_movies get_series_list get_episodes

LOGS & EVENT API
activity_logs live_connections credit_logs client_logs user_logs stream_errors watch_output system_logs login_logs restream_logs mag_events

LINE API
get_line create_line edit_line delete_line disable_line enable_line unban_line ban_line

USER API
get_user create_user edit_user delete_user disable_user enable_user

MAG API
get_mag create_mag edit_mag delete_mag disable_mag enable_mag unban_mag ban_mag convert_mag

ENIGMA API
get_enigma create_enigma edit_enigma delete_enigma disable_enigma enable_enigma unban_enigma ban_enigma convert_enigma

BOUQUETE API
get_bouquets get_bouquet create_bouquet edit_bouquet delete_bouquet

ACCESS CODE API
get_access_codes get_access_code create_access_code edit_access_code delete_access_code

HMAC API
get_hmacs get_hmac create_hmac edit_hmac delete_hmac

EPG API
get_epgs get_epg create_epg edit_epg delete_epg reload_epg

GROUPS API
get_groups get_group create_group edit_group delete_group

PACKAGES API
get_packages get_package create_package edit_package delete_package

TRANSCODING PROFILE API
get_transcode_profiles get_transcode_profile create_transcode_profile edit_transcode_profile delete_transcode_profile

RTMP API
get_rtmp_ips get_rtmp_ip create_rtmp_ip edit_rtmp_ip delete_rtmp_ip

CATEGORIES API
get_categories get_category create_category edit_category delete_category

SUB RESELLER API
get_subresellers get_subreseller create_subreseller edit_subreseller delete_subreseller

WATCH FOLDERS API
get_watch_folders get_watch_folder create_watch_folder edit_watch_folder delete_watch_folder reload_watch_folder

BLOCKED ISP & IP API
get_blocked_isps add_blocked_isp delete_blocked_isp get_blocked_uas add_blocked_ua delete_blocked_ua get_blocked_ips add_blocked_ip delete_blocked_ip flush_blocked_ips

STREAMS API
get_stream create_stream edit_stream start_stream stop_stream delete_stream

CHANNEL API
get_channel create_channel edit_channel start_channel stop_channel delete_channel

STATION API
get_station create_station edit_station start_station stop_station delete_station

MOVIE API
get_movie create_movie edit_movie start_movie stop_movie delete_movie

SERIES API
get_series create_series edit_series delete_series

EPISONE API
get_episode create_episode delete_episode edit_episode start_episode stop_episode

SERVERS API
get_servers get_server install_server delete_server edit_server install_proxy edit_proxy

SETTINGS, STATS AND OTHER API
get_settings edit_settings get_server_stats get_fpm_status get_rtmp_stats get_free_space get_pids get_certificate_info reload_nginx clear_temp clear_streams update_blacklist get_directory kill_pid kill_connection reload_cache

Upcoming API information will help identify what each function does, and what parameters can be submitted.
For now, if you want to poke around I suggest using the Admin Interface with Developer Tools enabled and log any traffic to post.php. The parameters sent there will be the same parameters you can send to the API function it relates to.

For example if you go to Streams and add a stream, you can log post.php and submit the same request to the create_stream function to replicate it.
To edit a stream, pass the id with it too.

Some of the functions are server specific, so send server_id with them, for example:
get_server_stats, get_fpm_status, get_rtmp_stats, get_free_space, get_pids, get_certificate_info, reload_nginx, clear_temp, clear_streams, update_blacklist, get_directory

Line Example - Editing line #4 to change password to helloworld and select bouquets 1 and 2:
action=edit_line&id=4&username=test&password=helloworld&bouquets_selected[]=1&bouquets_selected[]=2

More info soon, post any questions below and I'll answer them for you. Included an extract from the API so you can kind of see what's going on.
I'm trying to filter by order desc but I don't send the params dir=desc and it doesn't work in the get_movies action,

How do I know which parameters I can send?
 
Python:
import requests
import json
package_name = " My Package Name  - "
time = 6
duration = "months"
connections = 4
final_name = package_name + str(time) + ' ' + duration + ' - ' + str(connections) + ' ' + 'Connections'
# False or 0 = None
# List should be passed on json.dumps.
params = {
    'bouquets_selected': json.dumps([1]),
    'groups_selected': json.dumps([2,3]),
    'output_formats[]': 1,
    'output_formats[1]': 2,
    'output_formats[2]': 3,
    'package_name': final_name,
    'is_addon': False,
    'is_trial': True,
    'is_official': True,
    'trial_credits': None,
    'official_credits': 28,
    'trial_duration': 3,
    'trial_duration_in': 'Days',
    'official_duration': time,
    'official_duration_in': duration,
    'is_line': True,
    'is_mag': True,
    'is_e2': True,
    'is_restreamer': None,
    'is_isplock': None,
    'max_connections': '4',
    'force_server_id': None,
    'forced_country': None,
    'lock_device': 0,
    'check_compatible': '1',
}
response = requests.post('https://exemple.com/api/?api_key={{apikey}}&action=create_package', data=params)
print(response.json())
print(response.status_code)

Here is a full exemple how to make a api call in python with list elements.


Post Update1:

curl -X POST 'https://exemple.com/api/?api_key=your_api_key&action=create_package' \
-d 'bouquets_selected=[1]' \
-d 'groups_selected=[2,3]' \
-d 'output_formats[]=1' \
-d 'output_formats[1]=2' \
-d 'output_formats[2]=3' \
-d 'package_name=YourFinalName' \
-d 'is_addon=False' \
-d 'is_trial=True' \
-d 'is_official=True' \
-d 'trial_credits=None' \
-d 'official_credits=28' \
-d 'trial_duration=3' \
-d 'trial_duration_in=Days' \
-d 'official_duration=12' \
-d 'official_duration_in=Months' \
-d 'is_line=True' \
-d 'is_mag=True' \
-d 'is_e2=True' \
-d 'is_restreamer=None' \
-d 'is_isplock=None' \
-d 'max_connections=4' \
-d 'force_server_id=None' \
-d 'forced_country=None' \
-d 'lock_device=0' \
-d 'check_compatible=1'


I guess in curl should do somethings like this.

Post Update2:

You should post the data,it will be better so the panel parse the data it self, and it's better to prevent bad formated query parameters.
 
Last edited by a moderator:
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
I spent days testing and finally wrote a working Python script to create new lines for resellers using the XUI One API. Does anyone know how to extend an existing line using the API? I have tested many times but haven’t found a working way.

Code:
import requests

# URL to send the POST request to
url = "https://[domain]:[port]/[reseller_api_accesscode]/?api_key=[reseller_api_key]&action=create_line"

# Multipart form-data payload
multipart_data = {
    "bouquets_selected": "",
    "username": "",
    "password": "",
    "package": "1",
    "package_cost": "",
    "package_duration": "",
    "max_connections": "",
    "exp_date": "",
    "contact": "",
    "reseller_notes": "",
    "isp_clear": ""
}

try:
    # Sending the POST request
    response = requests.post(url, files={key: (None, value) if isinstance(value, str) else (None, v) for key, value in multipart_data.items() for v in (value if isinstance(value, list) else [value])})

    # Output the response
    print("Response status code:", response.status_code)
    print("Response text:", response.text)

except requests.RequestException as e:
    print("An error occurred:", e)
 
I'm trying to filter by order desc but I don't send the params dir=desc and it doesn't work in the get_movies action,

How do I know which parameters I can send?
Hi, I am poking around api, mostly to get stream logs and add/edit stream. This is to update stream url/parameters automatically when they change. I have a problem, the request returns wrong api key. This is version 1.5.13 with streaming key changed. Could it be that latest version broke admin api? Considering hacking attacks were based on that. I also have whitelisted the source of the api call. I need to solve this before I can proceed. Any advice appreciated.
Edit:
I need to edit post as I solved it myself.
To solve I re generated api key from general settings > user profile apikey (the blue button on the right). After I regenerated the key it now works.
 
Last edited:
I spent days testing and finally wrote a working Python script to create new lines for resellers using the XUI One API. Does anyone know how to extend an existing line using the API? I have tested many times but haven’t found a working way.

Code:
import requests

# URL to send the POST request to
url = "https://[domain]:[port]/[reseller_api_accesscode]/?api_key=[reseller_api_key]&action=create_line"

# Multipart form-data payload
multipart_data = {
    "bouquets_selected": "",
    "username": "",
    "password": "",
    "package": "1",
    "package_cost": "",
    "package_duration": "",
    "max_connections": "",
    "exp_date": "",
    "contact": "",
    "reseller_notes": "",
    "isp_clear": ""
}

try:
    # Sending the POST request
    response = requests.post(url, files={key: (None, value) if isinstance(value, str) else (None, v) for key, value in multipart_data.items() for v in (value if isinstance(value, list) else [value])})

    # Output the response
    print("Response status code:", response.status_code)
    print("Response text:", response.text)

except requests.RequestException as e:
    print("An error occurred:", e)
Did you manage to find a way to extend existing line ? That's the only option missing for my script, he-he
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
Glad to hear you solved the issue! Yes, sometimes after an update, API keys might stop working, especially if security mechanisms have changed. Regenerating the API key was the right step, and it might be worth checking if there are any additional changes in API access in the updated version. If the issue happens again, you may also try clearing the API cache or reviewing the request logs.
 
Glad to hear you solved the issue! Yes, sometimes after an update, API keys might stop working, especially if security mechanisms have changed. Regenerating the API key was the right step, and it might be worth checking if there are any additional changes in API access in the updated version. If the issue happens again, you may also try clearing the API cache or reviewing the request logs.
Yes, I hope the info helps sombody. I have a few of my own scripts using the api with the key hardcoded into the script. I had to remember what I did 2 years ago and modify it. So it’s better one probes around the api before taking it for granted that it works without refreshing the key
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
how to add server in stream use api
curl "https://yoursite.com/accesscode/?api_key=#APIKEY#&action=edit_stream&id=36&server_id=1" | cat
I used this command line but not work status how STATUS_SUCCESS but in

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1105 0 1105 0 0 4721 0 --:--:-- --:--:-- --:--:-- 4742
{"status":"STATUS_SUCCESS","data":{"id":"3","type":"1","category_id":"[]","stream_display_name":"Test_Stream3","stream_source":"[]","stream_icon":null,"notes":null,"enable_transcode":"0","transcode_attributes":null,"custom_ffmpeg":null,"movie_properties":null,"movie_subtitles":null,"read_native":"0","target_container":"ts","stream_all":"0","remove_subtitles":"0","custom_sid":null,"epg_api":"0","epg_id":null,"channel_id":null,"epg_lang":null,"order":"1","auto_restart":"","transcode_profile_id":"0","gen_timestamps":"0","added":"1745455153","series_no":"0","direct_source":"0","tv_archive_duration":"0","tv_archive_server_id":"0","tv_archive_pid":"0","
 

Similar threads

shape1
shape2
shape3
shape4
shape5
shape6
Back
Top