Communicating with an External API

You can send GET, POST, etc. requests with arguments to an external API.


Changes the nicknames of the users who have just entered with the Korean Nickname Generator API.

// Executes when a player enters
App.onJoinPlayer.Add(function (player) {
		function (res) {
			// Change the response to a JSON object
			let response = JSON.parse(res); = response.words[0];


Receives the header and data sent from the app in response and displays it in the chat window.

// Activates function when q is pressed
App.addOnKeyDown(81, function (player) {
			"test-header": "zep",
			name: "zepscript",
		(res) => {
			let response = JSON.parse(res);
			App.sayToAll(`header sent: ${response.headers["test-header"]}`, 0xffffff);
			App.sayToAll(`data sent: ${}`, 0xffffff);

Please Note

- For the tutorial, we recommend setting the app type to Mini-Game.

- The JSON file name must be โ€œmain.โ€ Please create a new text file and name it โ€œmain.js.โ€

- If you do not know how to deploy an app, please refer to the ZEP Script Deployment Guide.

Last updated