package hello.world;
import java.lang.Exception;
import java.util.List;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.components.WatchlistRequest;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.WatchlistCreateOrUpdateResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
List<WatchlistRequest> req = List.of(
WatchlistRequest.builder()
.name("Tech Stocks")
.symbols(List.of(
"AAPL",
"GOOGL",
"MSFT",
"AMZN"))
.build(),
WatchlistRequest.builder()
.name("Crypto")
.symbols(List.of(
"BTC-USD",
"ETH-USD",
"SOL-USD"))
.build());
WatchlistCreateOrUpdateResponse res = sdk.watchlists().upsert()
.request(req)
.call();
if (res.watchlistResponse().isPresent()) {
// handle response
}
}
}{
"user_id": 12345,
"watchlist": [
{
"id": 1,
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"AMZN"
]
},
{
"id": 2,
"name": "Crypto",
"symbols": [
"BTC-USD",
"ETH-USD",
"SOL-USD"
]
}
]
}Create or update user watchlists.
Requires bearer token authentication
package hello.world;
import java.lang.Exception;
import java.util.List;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.components.WatchlistRequest;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.WatchlistCreateOrUpdateResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
List<WatchlistRequest> req = List.of(
WatchlistRequest.builder()
.name("Tech Stocks")
.symbols(List.of(
"AAPL",
"GOOGL",
"MSFT",
"AMZN"))
.build(),
WatchlistRequest.builder()
.name("Crypto")
.symbols(List.of(
"BTC-USD",
"ETH-USD",
"SOL-USD"))
.build());
WatchlistCreateOrUpdateResponse res = sdk.watchlists().upsert()
.request(req)
.call();
if (res.watchlistResponse().isPresent()) {
// handle response
}
}
}{
"user_id": 12345,
"watchlist": [
{
"id": 1,
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"AMZN"
]
},
{
"id": 2,
"name": "Crypto",
"symbols": [
"BTC-USD",
"ETH-USD",
"SOL-USD"
]
}
]
}Documentation Index
Fetch the complete documentation index at: https://finance.dev/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Array of watchlists to create or update
Was this page helpful?