Skip to main content

WorkAdventure APIs

Choosing the right API for your project

WorkAdventure comes with 4 APIs:

  • The Room API
  • The Inbound API
  • The Map Storage API
  • The Outbound API (deprecated)
  • The Scripting API

Before trying to integrate your application with WorkAdventure, it is important to understand the scope of each API.

Room API

The Room API is a gRPC-based API that allows an external server to connect to a room and to perform actions such as reading/modifying/listening to a room variable.

Inbound API

The inbound API a classic REST API. From your server, you can connect to WorkAdventure to create / edit / delete members in your world. There is also an existing Zapier plugin that is using the inbound API under the hood.

Sample use case: The inbound API is perfect if you want to integrate WorkAdventure with a ticketing system (for instance to create a new member with each ticket sold in your ticketing system).

Map Storage API

The map storage API is a REST API that allows you to create and update maps stored in the WorkAdventure server.

Sample use case: The inbound API is perfect if you want to dynamically create maps for your users. Say you have a web application that allows users to create "spaces". Using the map storage API, you can create a new map for each space created by your users.

Outbound API (deprecated)

danger

The outbound API is deprecated and will be removed in a future version of WorkAdventure. Do not use it for new projects.

With the outbound API, it is WorkAdventure that will initiate HTTP requests to your server.

When someone tries to connect to WorkAdventure, WorkAdventure will ask your server:

  • to resolve the URL to the map
  • if the user is allowed to connect and what tags the user has
caution

When you use the outbound API, WorkAdventure completely bypasses the WorkAdventure administration dashboard. It gives you the ability to develop your own administration dashboard.

The outbound API is extremely powerful because it allows you to store the rooms and members in your own database, without having a need to synchronize your database with WorkAdventure.

However, it is also the most complex API to implement. Furthermore, it is not compatible with the inline map editor that requires the WAM file to be hosted on the WorkAdventure server. Therefore, we plan to remove the outbound API in the future. We will possibly replace it with a simpler to implement hook system. You should not use the outbound API for new projects.

Scripting API

The scripting API is a client-side API. It is executed in the browser only and can be used to add dynamic behaviours on your maps.