All URIs are relative to https://developers.fireblocks.com/reference/
| Method | HTTP request | Description |
|---|---|---|
| createApiUser | POST /management/api_users | Create API Key |
| getApiUsers | GET /management/api_users | Get API Keys |
CompletableFuture<ApiResponse> createApiUser createApiUser(createAPIUser, idempotencyKey)
Create API Key
Create a new API key in your workspace. Learn more about Fireblocks API Keys management in the following guide. </br>Endpoint Permission: Admin, Non-Signing Admin.
// Import classes:
import com.fireblocks.sdk.ApiClient;
import com.fireblocks.sdk.ApiException;
import com.fireblocks.sdk.ApiResponse;
import com.fireblocks.sdk.BasePath;
import com.fireblocks.sdk.Fireblocks;
import com.fireblocks.sdk.ConfigurationOptions;
import com.fireblocks.sdk.model.*;
import com.fireblocks.sdk.api.ApiUserApi;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
public class Example {
public static void main(String[] args) {
ConfigurationOptions configurationOptions = new ConfigurationOptions()
.basePath(BasePath.Sandbox)
.apiKey("my-api-key")
.secretKey("my-secret-key");
Fireblocks fireblocks = new Fireblocks(configurationOptions);
CreateAPIUser createAPIUser = new CreateAPIUser(); // CreateAPIUser |
String idempotencyKey = "idempotencyKey_example"; // String | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.
try {
CompletableFuture<ApiResponse<Void>> response = fireblocks.apiUser().createApiUser(createAPIUser, idempotencyKey);
System.out.println("Status code: " + response.get().getStatusCode());
System.out.println("Response headers: " + response.get().getHeaders());
} catch (InterruptedException | ExecutionException e) {
ApiException apiException = (ApiException)e.getCause();
System.err.println("Exception when calling ApiUserApi#createApiUser");
System.err.println("Status code: " + apiException.getCode());
System.err.println("Response headers: " + apiException.getResponseHeaders());
System.err.println("Reason: " + apiException.getResponseBody());
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling ApiUserApi#createApiUser");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createAPIUser | CreateAPIUser | [optional] | |
| idempotencyKey | String | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. | [optional] |
CompletableFuture<ApiResponse>
No authorization required
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | User creation approval request has been sent | * X-Request-ID - |
| 400 | bad request | * X-Request-ID - |
| 401 | Unauthorized. Missing / invalid JWT token in Authorization header. | * X-Request-ID - |
| 403 | Lacking permissions. | * X-Request-ID - |
| 5XX | Internal error. | * X-Request-ID - |
| 0 | Error Response | * X-Request-ID - |
CompletableFuture<ApiResponse> getApiUsers getApiUsers()
Get API Keys
List all API keys in your workspace. - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. </br>Endpoint Permission: Admin, Non-Signing Admin.
// Import classes:
import com.fireblocks.sdk.ApiClient;
import com.fireblocks.sdk.ApiException;
import com.fireblocks.sdk.ApiResponse;
import com.fireblocks.sdk.BasePath;
import com.fireblocks.sdk.Fireblocks;
import com.fireblocks.sdk.ConfigurationOptions;
import com.fireblocks.sdk.model.*;
import com.fireblocks.sdk.api.ApiUserApi;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
public class Example {
public static void main(String[] args) {
ConfigurationOptions configurationOptions = new ConfigurationOptions()
.basePath(BasePath.Sandbox)
.apiKey("my-api-key")
.secretKey("my-secret-key");
Fireblocks fireblocks = new Fireblocks(configurationOptions);
try {
CompletableFuture<ApiResponse<GetAPIUsersResponse>> response = fireblocks.apiUser().getApiUsers();
System.out.println("Status code: " + response.get().getStatusCode());
System.out.println("Response headers: " + response.get().getHeaders());
System.out.println("Response body: " + response.get().getData());
} catch (InterruptedException | ExecutionException e) {
ApiException apiException = (ApiException)e.getCause();
System.err.println("Exception when calling ApiUserApi#getApiUsers");
System.err.println("Status code: " + apiException.getCode());
System.err.println("Response headers: " + apiException.getResponseHeaders());
System.err.println("Reason: " + apiException.getResponseBody());
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling ApiUserApi#getApiUsers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
CompletableFuture<ApiResponse<GetAPIUsersResponse>>
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | got api users | * X-Request-ID - |
| 401 | Unauthorized. Missing / invalid JWT token in Authorization header. | * X-Request-ID - |
| 403 | Lacking permissions. | * X-Request-ID - |
| 5XX | Internal error. | * X-Request-ID - |
| 0 | Error Response | * X-Request-ID - |