REST API — GNUnet documentation

# REST API

## Configuration

In order to start the REST service, execute:

    $ gnunet-arm -i rest

The REST service will listen by default on port 7776. The service is run by each user so you may have to modify the port accordingly:

    $ gnunet-config -s rest -o HTTP_PORT -V 7788

Note that you may need to authenticate agains the API using HTTP basic authentication. The REST service autogenerates a password upon first launch. You can get your user-specific authentication secret by executing:

    $ SECRET=$(gnunet-config -f -s rest -o BASIC_AUTH_SECRET_FILE)

To access the REST API, you can use any HTTP client such as a browser or cURL:

    $ curl localhost:7776/identity -u<$USER>:<$SECRET>

You may disable the authentication if you want to by executing:

    $ gnunet-config -s rest -o BASIC_AUTH_ENABLED -V NO

However, disabling authentication is not recommended.

## Conventions

The GNUnet Web API is based in REST principles. Data resources are accessed via HTTP requests to an API endpoint. Where possible, the Web API uses the following HTTP methods for each action:

Method | Action
--- | ---
GET | Retrieve object(s)
POST | Create new object(s)
PUT | Edit existing object(s)
DELETE | Delete existing object(s)
OPTIONS | Get allowed headers

## Services

Contents:

- Identity API Service
  - Definition
    - Identity
    - Error Response
    - Response Code
  - Requests
    - GET Requests
    - POST Request
    - PUT Request
    - DELETE Request
    - OPTIONS Request
- Namestore API Service
  - Definition
    - GNS Record
    - Error Response
  - Requests
    - GET Request
    - POST Request
    - DELETE Request
    - OPTIONS Request
- GNS API Service
  - Definition
    - Error Response
  - Requests
    - GET Request
    - OPTIONS Request
- Peerinfo API Service
  - Definition
    - Peer
    - Peerinfo Response
    - Error Response
  - Requests
    - GET Request
    - OPTIONS Request
- Config API Service
  - Definition
    - Configuration
    - Error Response
    - Response Code
  - Requests
    - GET Requests
    - POST Request
    - OPTIONS Request

### Search

- Search Page