xxxxxxxxxxNotice: API Token is required to enable in your account settings, the token will be used in the each API request for identify your permission, and you need add an `Authorization: Token XXX` header to your request. `XXX` is the token you generated in your account settings page.
Add / create a new user.
xxxxxxxxxxPOST /api/user/addAttribute Type Required Description usernamestring(10) no The username passwordstring(10) no The password Example
xxxxxxxxxx$ curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token fiMY9nMdrE82zSD1IbUuVr6J' --data '{"username": "test", "password": "test"}' http://192.168.2.3:8000/api/user/add{"user_id": 1,"username": "test","password": "test","package_id": null,"package_name": null,"expire_date": "2021-11-05 15:47:05","max_connections": 1}Add package to user.
xxxxxxxxxxPOST /api/user/<int:user_id>/package/addAttribute Type Required Description package_idint yes Package ID for add to the user Example
xxxxxxxxxx$ curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token fiMY9nMdrE82zSD1IbUuVr6J' --data '{"package_id": 1}' http://192.168.2.3:8000/api/user/1/package/add{"user_id": 1,"username": "test","password": "test","package_id": 1,"package_name": "Package 1","expire_date": "2021-12-05 23:59:47","max_connections": 1}Renew the package.
xxxxxxxxxxPOST /api/user/<int:user_id>/package/renewExample
xxxxxxxxxx$ curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token fiMY9nMdrE82zSD1IbUuVr6J' http://192.168.2.3:8000/api/user/1/package/renew{"user_id": 1,"username": "test","password": "test","package_id": 1,"package_name": "Package 1","expire_date": "2022-01-04 23:59:47","max_connections": 1}Change the package.
xxxxxxxxxxPOST /api/user/<int:user_id>/package/changeAttribute Type Required Description package_idint yes Package ID for add to the user Example
xxxxxxxxxx$ curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token fiMY9nMdrE82zSD1IbUuVr6J' --data '{"package_id": "2"}' http://192.168.2.3:8000/api/user/1/package/change{"user_id": 1,"username": "test","password": "test","package_id": 2,"package_name": "Package 2","expire_date": "2021-11-24 00:02:54","max_connections": 5}Cancel the package.
xxxxxxxxxxPOST /api/user/<int:user_id>/package/cancelExample
xxxxxxxxxx$ curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token fiMY9nMdrE82zSD1IbUuVr6J' http://192.168.2.3:8000/api/user/1/package/cancel{"user_id": 1,"username": "test","password": "test","package_id": null,"package_name": null,"expire_date": "2021-11-05 16:05:21","max_connections": 0}Query the user info via username or user_id.
xxxxxxxxxxGET /api/user/infoAttribute Type Required Description user_id int no The user ID username string no The username Example
xxxxxxxxxx$ curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Token fiMY9nMdrE82zSD1IbUuVr6J' http://192.168.2.3:8000/api/user/info?username=test{"user_id": 1,"username": "test","password": "test","package_id": null,"package_name": null,"expire_date": "2021-11-05 16:05:21","max_connections": 0}
