Overview

Catapult REST API combines HTTP and WebSockets to perform read and write actions in the NEM blockchain.

Interacting with the API

Catapult REST API uses port 3000. It accepts both HTTP GET, PUT and POST requests.

Assuming that the Catapult server Catapult server and Catapult REST are running locally, HTTP GET requests can be executed from a browser and have the form:

http://localhost:3000/<path-to-API-request> for example:

http://localhost:3000/account/7D08373CFFE4154E129E04F0827E5F3D6907587E348757B0F87D2F839BF88246/transactions

HTTP PUT and POST requests use JSON structures in the request body. Request return data (if any is returned) using JSON structures.

Reference & Tools

Catapult REST API Reference

We recommend using one of the following tools to interact with Catapult REST API, especially for PUT and POST methods.

This kind of request usually cannot be executed from within the browser unless you use a plugin which enables you to do it.

Insomnia

Download Insomnia app for your operative system and import:

HTTP Status Codes

Status code Description
200 Ok. The request has succeeded.
202 Accepted. The request has been accepted for processing but the processing has not been completed.
400 Bad request. Check your request syntax.
404 Not found. The resource does not exist.
409 Conflict. Check your arguments.
500 Internal error. Unexpected condition.

HTTP Errors

Key Description
code Error identifier in camelCase.
message Error explained in human-readable format.

Example

{
  "code": "InvalidArgument",
  "message": "accountId has an invalid format"
}