RPC API#
Application RPCs are exposed under /app
and require authentication with a valid user identity.
You can read what application endpoints may look like, as generated by the example C++ logging app, in Example app RPC API.
Built-ins#
By default, CCF will also add some built-in endpoints:
- GET /app/api#
OpenAPI schema
Example request:
GET /app/api HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Default response description
Example response:
HTTP/1.1 200 OK Content-Type: application/json {}
default –
An error occurred
Example response:
HTTP/1.1 default - Content-Type: application/json { "error": { "code": "string", "message": "string" } }
- GET /app/api/metrics#
Usage metrics for endpoints
Example request:
GET /app/api/metrics HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Default response description
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "metrics": [ { "calls": 1, "errors": 1, "failures": 1, "method": "string", "path": "string", "retries": 1 } ] }
default –
An error occurred
Example response:
HTTP/1.1 default - Content-Type: application/json { "error": { "code": "string", "message": "string" } }
- GET /app/tx#
Current status of a transaction
Possible statuses returned are Unknown, Pending, Committed or Invalid.
- Query Parameters:
transaction_id (string) – (Required)
Example request:
GET /app/tx?transaction_id=string HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Default response description
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "status": "Unknown", "transaction_id": "string" }
default –
An error occurred
Example response:
HTTP/1.1 default - Content-Type: application/json { "error": { "code": "string", "message": "string" } }
- GET /app/commit#
Current commit level
Latest transaction ID that has been committed on the service
- Query Parameters:
view_history (boolean) –
view_history_since (integer) –
Example request:
GET /app/commit HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Default response description
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "transaction_id": "string", "view_history": [ "string" ] }
default –
An error occurred
Example response:
HTTP/1.1 default - Content-Type: application/json { "error": { "code": "string", "message": "string" } }
- GET /app/receipt#
Receipt for a transaction
A signed statement from the service over a transaction entry in the ledger
- Query Parameters:
transaction_id (string) – (Required)
Example request:
GET /app/receipt?transaction_id=string HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Default response description
Example response:
HTTP/1.1 200 OK Content-Type: application/json {}
default –
An error occurred
Example response:
HTTP/1.1 default - Content-Type: application/json { "error": { "code": "string", "message": "string" } }