Accessing the REST API heading-link-icon

To access and invoke the REST API:

  1. If the REST API has not been exposed externally to the cluster A complete set of worker processes. Clusters require a fully functioning virtual node infrastructure. via a load balancer, forward the port by running the following command in a terminal window, replacing <NAMESPACE> with the Kubernetes namespace that Corda is installed in:

    kubectl port-forward -n <NAMESPACE> deploy/corda-rest-worker 8888
    

    If you did not explicitly specify the username for the initial admin user at install time, the default is admin. If you did not explicitly specify the password for the initial admin user at install time, you can retrieve it using the following command:

    kubectl get secret -n <NAMESPACE> corda-rest-api-admin -o go-template="{{ .data.password | base64decode }}"
    
  2. The REST API is at the path /api/v5_2. The following is an example invocation using curl when the API endpoint is exposed via port forwarding:

    REST_API_URL=https://localhost:8888/api/v5_2
    REST_API_USER=admin
    REST_API_PASSWORD=$(kubectl get secret -n <NAMESPACE> corda-rest-api-admin -o go-template="{{ .data.password | base64decode }}")
    curl -k -u $REST_API_USER:$REST_API_PASSWORD $REST_API_URL/hello
    

You can access the Swagger documentation for the REST API at the path /api/v5_2/swagger. For example, when using port forwarding, the documentation is available at <REST_API_URL>/swagger.

You can also view the REST API documentation here.

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.