Services Overview

What are services?

NetsBlox provides users access to server side functionality through enabling users to make synchronous remote procedure calls (RPCs) which are grouped into “services”. This enables users to:

  • gain access to real-world datasets including climate data from NOAA and weather data from OpenWeatherMap.
  • use a variety of third-party APIs including Google Maps, ThingSpeak, ParallelDots, and Azure Translation.
  • leverage capabilities provided by NetsBlox itself such as cloud variables and cybersecurity capabilities! Services have been designed to be simple to implement and include rich functionality including strict typing, help message generation, and message-sending capability.

Are there different types of services?

At the time of this writing, there are three different types of services in NetsBlox:

  • Native NetsBlox Services. These services are defined in JavaScript in NetsBlox itself. Most of the documentation describes the creation of this type of service.
  • User-Defined Services. These services are created using the ServiceCreation service from within NetsBlox.
  • Auxiliary (Private) Services. These services are hosted by other servers and enable users or classes to have their own private services. An example can be found here.

A comparison of the different types of services is given below:

Service Type Language Available to all users? Automated Tests? Can users use own API key? (if accessing a web API) Can send messages to users?
Native Javascript ../_images/check.png ../_images/check.png ../_images/check.png ../_images/check.png
User-Defined Services NetsBlox ../_images/check.png Maybe as a custom project? ../_images/x.png ../_images/x.png
Auxiliary Services Any No. Must be enabled for each user/group. As supported by the language. ../_images/x.png ../_images/x.png

How can I contribute a native service?

If you are interested in contributing a (native) custom service back to NetsBlox (or in your own fork), I would recommend starting with the simple example and then checking out the Best Practices for NetsBlox Services.

For examples of existing services, check out the featured projects on https://netsblox.org or the source code. Examples include: