PHP operation pagoda panel Api, pagoda server construction, API interface usage tutorial

I have been writing the Bty project in the past two months, so I have collected a lot of Api interfaces commonly used by pagodas. Although the official documents have been written a little, they are still not very complete. Let’s take a look at how to capture the interfaces of the pagoda panel

interface capture

1. Log in to the Pagoda panel
2. Find the function you want
3. F12 opens the inspection element (console) and switches to the Network tab

The XHR above is the API interface we captured. Let me demonstrate the interface for creating a website.
4. Create a website -> Fill in relevant information such as the website domain name -> Submit

Here we can see the parameters passed to create the website

Switch to the Preview tab to see the returned data

From the naming point of view, you can see what the returned data means.

Pagoda Api operation class library

Download the attachment directly, put Bt.php and config.php in the same directory, and then modify it into your own Pagoda interface and Api key, and access to get the basic data statistics of the Pagoda server
How to use PHP
  1. // Modify it to your own pagoda interface and Api key
  2. $bt = new Bt('http://127.0.0.1:8888','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
  3. header('Content-type: application/json');
  4. echo json_encode($bt->GetSystemTotal());
copy code

Follow up

The interfaces collected in the file are not all the interfaces of the pagoda panel. If you need more reference interfaces, grab and add them yourself. Please refer to the official interface address and data. codeit.org.cn
download attachment

 Bt.zip  (7.15 KB, Downloads: 19524)

API Interface Usage Tutorial

Through the Pagoda API, you can fully control all functions of the Pagoda Linux panel, including third-party plug-in application functions. In fact, all functions used after the user logs in to the panel are connected through the same interface, which means that if you are familiar with using the browser With a debugger, you can easily complete a third-party front-end docking according to the operating parameters of the Pagoda Linux panel.




API documentation (unfinished): https://www.bt.cn/api-doc.pdf
PHP-Demo:   https://www.bt.cn/api_demo_php.zip
Python-Demo:   https://www. bt.cn/api_demo_python.zip
Java-Demo: 

 Demo.java  (3.52 KB, download times: 42733)    thanks to [Mood Coffee] for providing

 

Guess you like

Origin blog.csdn.net/qikexun/article/details/130820482