Crates.io | subspace_openapi_client |
lib.rs | subspace_openapi_client |
version | 1.0.12 |
source | src |
created_at | 2021-08-02 22:10:13.451658 |
updated_at | 2022-02-09 00:56:03.881076 |
description | The Subspace client library for working with the Subspace API, generated via OpenAPI |
homepage | https://subspace.com |
repository | https://github.com/subspace-com/subspace_rust_openapi_client |
max_upload_size | |
id | 430714 |
size | 193,129 |
The Subspace API is based on REST, has resource-oriented URLs, returns JSON-encoded responses, and returns standard HTTP response codes.
The base URL for the API is: https://api.subspace.com/
https://api.subspace.com/v1
Subspace authenticates your API requests using JWT Bearer tokens. To use any Subspace API, you must pass a Bearer token with each request. If you do not include your Bearer token when making an API request, or use one that is incorrect or disabled, Subspace returns an error.
Bearer tokens are granted by requesting one (as noted below) and presenting your publishable (client_id) and secret (client_secret) tokens.
Subspace provides two types of API tokens: publishable (client_id) and secret (client_secret). These are available in the Subspace console.
Subspace uses auth0 for JWT token management. You can acquire a JWT token by utilizing https://id.subspace.com
and following the instructions in the curl example below.
Subspace uses HTTP response codes to indicate the success or failure of an API request.
General HTML status codes:
We provide a valid, signed certificate for our API methods. Be sure your connection library supports HTTPS with the SNI extension.
Making your first REST API call is easy and can be done from your browser. You will need:
First, acquire a JWT Bearer Token. Command line example:
curl --request POST \\
--url \"https://id.subspace.com/oauth/token\" \\
--header 'content-type: application/json' \\
--data '{ \"client_id\": \"YOURCLIENTID\", \"client_secret\": \"YOURCLIENTSECRET\", \"audience\": \"https://api.subspace.com/\", \"grant_type\": \"client_credentials\" }'
REST calls are made up of:
Base url: Example: https://api.subspace.com
Version: Example: v1
The API Endpoint and any parameters: accelerator/acc_NDA3MUI5QzUtOTY4MC00Nz
where acc_NDA3MUI5QzUtOTY4MC00Nz
is a valid accelerator ID
Accelerator ids are always of the format acc_NDA3MUI5QzUtOTY4MC00Nz
, with a "acc_" prefix followed by 22 characters.
Token header: All REST requests require a valid JWT Bearer token which should be added as an “Authorization” header to the request:
Authorization: Bearer YOUR_TOKEN_HERE
If your API token was “my_api_token”, you would add...
Authorization: Bearer my_api_token
...to the header.
To list your current open packet_accelerators using the token “my_api_token”:
curl -H “Authorization: Bearer my_api_token” https://api.subspace.com/v1/accelerator
Alternately, to get the details of a specific accelerator whose id is 'abcd-ef01-2345':
curl -H “Authorization: Bearer my_api_token” https://api.subspace.com/v1/accelerator/abcd-ef01-2345
Subspace will release new versions when we make backwards-incompatible changes to the API. We will give advance notice before releasing a new version or retiring an old version.
Backwards compatible changes:
Versions are added to the base url, for example:
https://api.subspace.com/v1
Current Version is v1: https://api.subspace.com/v1
For more information, please visit https://subspace.com
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
org.openapitools.codegen.languages.RustClientCodegen
Put the package under your project folder in a directory named subspace_openapi_client
and add the following to Cargo.toml
under [dependencies]
:
subspace_openapi_client = { path = "./subspace_openapi_client" }
All URIs are relative to https://api.subspace.com
Class | Method | HTTP request | Description |
---|
AcceleratorServiceApi | accelerator_service_create | POST /v1/accelerator | AcceleratorServiceApi | accelerator_service_delete | DELETE /v1/accelerator/{id} | AcceleratorServiceApi | accelerator_service_get | GET /v1/accelerator/{id} | AcceleratorServiceApi | accelerator_service_list | GET /v1/accelerator | AcceleratorServiceApi | accelerator_service_update | PUT /v1/accelerator/{id} | SipTeleportServiceApi | sip_teleport_service_create | POST /v1/sipteleport | SipTeleportServiceApi | sip_teleport_service_delete | DELETE /v1/sipteleport/{id} | SipTeleportServiceApi | sip_teleport_service_get | GET /v1/sipteleport/{id} | SipTeleportServiceApi | sip_teleport_service_list | GET /v1/sipteleport | SipTeleportServiceApi | sip_teleport_service_update | PUT /v1/sipteleport/{id} | WebRtcCdnServiceApi | web_rtc_cdn_service_get_web_rtc_cdn | POST /v1/webrtc-cdn |
To get access to the crate's generated documentation, use:
cargo doc --open