Skip to content

Latest commit

 

History

History
57 lines (35 loc) · 2.28 KB

api.md

File metadata and controls

57 lines (35 loc) · 2.28 KB

ILP Node HTTP API

For instructions on running the ILP Node, see the Readme.

Authorization

The ILP Node uses HTTP Bearer tokens for authorization.

Your HTTP requests should look like:

GET /accounts HTTP/1.1
Authorization: Bearer BEARER-TOKEN-HERE

For administrative functionalities, the value of the token must be the value of admin_auth_token when the node was launched. When authorizing as a user, it must be the ilp_over_http_incoming_token which was specified during that user's account creation.

HTTP REST API

By default, the API is available on port 7770 and it exposes endpoints as specified in this OpenAPIv3 specification (corresponding yml file).

WebSockets API

/accounts/:username/payments/incoming

Admin or account-holder only.

Message

In the format of text message of WebSocket, the endpoint will send the following JSON as a payment notification when receiving payments:

{
    "to_username": "Receiving account username",
    "from_username": "Sending account username",
    "destination": "Destination ILP address",
    "amount": 1000,
    "timestamp": "Receiving time in RFC3339 format",
    "sequence": 2,
    "connection_closed": false
}

Note that the from_username corresponds to the account that received the packet on this node, not the original sender.

The sequence field reports the sequence number of each received packet carrying a payment amount.

A payment notification with amount: 0 and connection_closed: true will be sent when the last packet (which has a ConnectionClose frame) has been received. All other payment notifications report an actual payment amount and connection_closed: false.

/accounts/:username/ilp/btp - Bilateral Transfer Protocol (BTP)

Account-holder only.

This endpoint implements BTP, a WebSocket-based protocol for sending and receiving ILP packets. This protocol is specified in IL-RFC 22: Bilateral Transfer Protocol 2.0 (BTP/2.0).

Note this endpoint is the one referred to as ilp_over_btp_url in the AccountSettings.