Addon in alpha:
- Contributors:
- faketuna, Rily_
- Supported Minecraft Versions:
- 1.19
This Addon is in alpha, so cause probrems please use at your own risk.
Also this addon is includes missing features and functions, because created for my personal usage.
If you have any requests, please submit an issue on Github.
I will not provide any support in skunity review.
Features:
Web API Server feature:
Web request feature:
- Handle DELETE, GET, POST, PUT request.
Install:
- Send DELETE, GET, POST, PUT request.
Note:
- Current version (0.0.3) is can only work with paper server. Im plan to make it work with Spigot in the future.
- Current version (0.0.3) is only run with Minecraft version 1.19.3. Older version is supporting soon.
Requirements:
- Paper server
- Version 1.19.3
Installing:
Same as other common addons.
Documentation:
- Download SkriptWebAPI-<Version>.jar from here. Lager number mean recent.
- Put your downloaded jar to server plugins folder
- Run and ready to use
Example and syntax has provided in Skript Hub.
Important:
If you use reply effect in if statement, you need exit after reponse for avoid error
Also you need reply %httpexchange% as not found in last line of eventCode (Skript):
if (something): reply %httpexchange% with body %string% and response code 200 exit
Example:Code (Skript):
on receive get request: set {_request} to event-request if (something): reply {_request} with body %string% and response code 200 exit reply {_request} as not found
Example script is may be outdated when the plugin update.
the latest Example script is can be found here.
Todo:Code (Skript):
# Written in plugin version 0.0.3 on skript load: start http server in port 8080 on skript unload: stop http server # ==== Web request feature ==== command get: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" set {_response} to response of get request to "http://httpbin.org/get" with header {_header} broadcast {_response}'s response code broadcast {_response}'s response body broadcast {_response}'s response header "Date" broadcast "response: %{_response}'s response body%" command put: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" set {_response} to response of put request to "http://httpbin.org/put" with header {_header} and body "{""json"":""body""}" broadcast "response: %{_response}'s response body%" command post: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" set {_response} to response of post request to "http://httpbin.org/post" with header {_header} and body "{""json"":""body""}" broadcast "response: %{_response}'s response body%" command delete: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" set {_response} to response of delete request to "http://httpbin.org/delete" with header {_header} and body "{""json"":""body""}" broadcast "response: %{_response}'s response body%" # ==== Async web request feature ==== command asyncget: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" send get request to "http://httpbin.org/get" on get web request response: set {_response} to event-connection broadcast {_response}'s response code broadcast {_response}'s response body broadcast {_response}'s response header "Date" command asyncput: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" send put request to "http://httpbin.org/put" with header {_header} and body "{""json"":""body""}" on put web request response: set {_response} to event-connection broadcast {_response}'s response code broadcast {_response}'s response body broadcast {_response}'s response header "Date" command asyncpost: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" send post request to "http://httpbin.org/post" with header {_header} and body "{""json"":""body""}" on post web request response: set {_response} to event-connection broadcast {_response}'s response code broadcast {_response}'s response body broadcast {_response}'s response header "Date" command asyncdelete: trigger: set {_header} to blank header set {_header}'s properties "Content-Type" to "applicaiton/json" set {_header}'s properties "User-Agent" to "SkriptWebAPI/0.0.1" set {_header}'s properties "Custom" to "Custom header" send delete request to "http://httpbin.org/delete" with header {_header} and body "{""json"":""body""}" on delete web request response: set {_response} to event-connection broadcast {_response}'s response code broadcast {_response}'s response body broadcast {_response}'s response header "Date" # ==== API Server feature ==== on receive get request: set {_request} to event-request set {_path} to {_request}'s path set {_body} to "" if ({_path} is "/user"): set {_user} to number of all players set {_body} to "{""user"":""%{_user}%""}" set {_request}'s response header "Content-Type" to "application/json" reply {_request} with body {_body} and response code 200 exit reply {_request} as not found on receive put request: set {_request} to event-request broadcast {_request}'s path set {_request} to event-request set {_path} to {_request}'s path set {_body} to "" if ({_path} is "/send"): set {_user} to {_request}'s request header properties "User" parsed as offline player set {_message} to {_request}'s request header properties "Message" if ({_user} is online): send {_message} to {_user} set {_body} to "{""sent"":true}" else: set {_body} to "{""sent"":false}" set {_request}'s response header "Content-Type" to "application/json" reply {_request} with body {_body} and response code 200 exit reply {_request} as not found on receive post request: set {_request} to event-request set {_path} to {_request}'s path set {_body} to "" if ({_path} is "/add-value"): set {_listName} to {_request}'s request header properties "List" set {_value} to {_request}'s request header properties "Value" if ({%{_listName}%::*} is not set): set {_body} to "{""list"":""not found""}" reply {_request} with body {_body} and response code 404 exit else if ({_value} is not set): set {_body} to "{""error"":""Value not provided""}" reply {_request} with body {_body} and response code 400 exit else: add {_value} to {%{_listName}%::*} set {_body} to "{""list"":""added""}" set {_request}'s response header "Content-Type" to "application/json" reply {_request} with body {_body} and response code 200 exit reply {_request} as not found on receive delete request: set {_request} to event-request set {_path} to {_request}'s path set {_body} to "" if ({_path} is "/delete-variable"): set {_variableName} to {_request}'s request header properties "VariableName" if ({%{_variableName}%} is not set): set {_body} to "{""variable"":""not found""}" reply {_request} with body {_body} and response code 404 exit else: delete {%{_variableName}%} set {_body} to "{""variable"":""removed""}" set {_request}'s response header "Content-Type" to "application/json" reply {_request} with body {_body} and response code 200 exit reply {_request} as not found
Todo is found in my github readme.
Contributors:
Rily_: Wrote the addon icon.
-
Welcome to skUnity!
Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon SkriptWebAPI 0.0.3b
Provides Web API server feature and Web request feature.
Recent Updates
- 0.0.3b | Fixed plugin loading Feb 26, 2023
- 0.0.3a | Hotfix for request body Feb 13, 2023
- Version 0.0.3 | Add Async web request feature. Jan 13, 2023