REST API

Overview
Creates a simple REST API server with GET and POST endpoints using the Net Http nodes. The default robot runs on http://localhost:9090.
REST API
REST API creates a local HTTP server with multiple endpoints, turning your Robomotion robot into a service that responds to incoming HTTP requests. Powered by Robomotion's HTTP server nodes, it provides a ready made foundation for building API driven automations.
Whether you want to trigger robot actions from external systems, expose data through a simple API, or build webhook receivers, this template gives you a working server to start from.
What REST API can do
- Spin up a local HTTP server on a configurable port
- Handle POST requests that echo back the JSON body you send
- Handle GET requests that return the current date and time
- Serve as a starting point for building webhook receivers and API driven robots
Behind the scenes
The flow starts an HTTP server on http://localhost:9090 with two routes. The POST /echo endpoint reads the incoming JSON body and returns it as the response, making it easy to test request handling. The GET /date endpoint returns the current date and time. You can extend the flow with additional routes and custom logic to build more complex API services.
Testing the endpoints
curl http://localhost:9090/date
curl -X POST -d '{"name":"john"}' http://localhost:9090/echo
More networking templates
See all 4 →- API Calls with Http RequestThree HTTP calls, one node. A plain read of a public exchange rate service, the same call behind a password, and a call that carries a file. They differ only in their properties, which is the point: authentication is a property and not a different node, and neither is a multipart body. Basic Authentication takes a vault item and nothing else, so no password is written into the flow, and an at-sign in front of a path is what makes the node open that file and send it as a form part, exactly the way curl does it.
- Webhook Screenshot ServiceA flow that waits to be called. Http In gives it a public URL that Robomotion hosts for you, with no port to open and no tunnel to run, and Http Out answers on the same held-open request. Between the two, the robot does what a web service cannot do for itself: it opens a real browser, loads the page it was asked about, waits three seconds for it to settle, and photographs it. The reply is the PNG, attached to the response, so curl -o shot.png is a complete client and nothing about the caller needs to know what Robomotion is.
- Send GET RequestSends an HTTP GET request to a sample service and displays the response in a message box. Defaults to querying https://ifconfig.me for your public IP address.