This is the java SDK for the LUSID API, part of the LUSID by FINBOURNE platform. To use it you'll need a LUSID account - sign up for free at lusid.com.
LUSID is a bi-temporal investment management data platform with portfolio accounting capabilities - see https://support.lusid.com/knowledgebase/ to learn more.
For more details on other applications in the LUSID platform, see Understanding all the applications in the LUSID platform.
This sdk supports Production
, Early Access
, Beta
and Experimental
API endpoints. For more details on API endpoint categories, see What is the LUSID feature release lifecycle. To find out which category an API endpoint falls into, see the swagger page.
This code is automatically generated by the OpenAPI Generator project.
- API version: 0.11.6782
- SDK version: 2.0.1000
- Java 1.8+
Add this dependency to your pom.xml
<dependency>
<groupId>com.finbourne</groupId>
<artifactId>lusid-sdk</artifactId>
<version>2.0.1000</version>
</dependency>
Add this dependency to your build.gradle
repositories {
mavenCentral()
}
dependencies {
implementation "com.finbourne:lusid-sdk:2.0.1000"
}
You'll need to provide some configuration to connect to the LUSID API - see the articles about short-lived access tokens and a long-lived Personal Access Token. This configuration can be provided using a secrets file or environment variables.
Required for a short-lived access token
FBN_TOKEN_URL
FBN_LUSID_URL
FBN_USERNAME
FBN_PASSWORD
FBN_CLIENT_ID
FBN_CLIENT_SECRET
Required for a long-lived access token
FBN_LUSID_URL
FBN_ACCESS_TOKEN
You can send your requests to the LUSID API via a proxy, by setting FBN_PROXY_ADDRESS
. If your proxy has basic auth enabled, you must also set FBN_PROXY_USERNAME
and FBN_PROXY_PASSWORD
.
The secrets file must be in the current working directory.
Required for a short-lived access token
{
"api":
{
"tokenUrl":"<your-token-url>",
"lusidUrl":"https://<your-domain>.lusid.com/api",
"username":"<your-username>",
"password":"<your-password>",
"clientId":"<your-client-id>",
"clientSecret":"<your-client-secret>",
}
}
Required for a long-lived access token
{
"api":
{
"lusidUrl":"https://<your-domain>.lusid.com/api",
"accessToken":"<your-access-token>"
}
}
You can send your requests to the LUSID API via a proxy, by adding a proxy section. If your proxy has basic auth enabled, you must also supply a username
and password
in this section.
{
"api":
{
"lusidUrl":"https://<your-domain>.lusid.com/api",
"accessToken":"<your-access-token>"
},
"proxy":
{
"address":"<your-proxy-address>",
"username":"<your-proxy-username>",
"password":"<your-proxy-password>"
}
}
import com.finbourne.lusid.model.*;
import com.finbourne.lusid.api.AborApi;
import com.finbourne.lusid.extensions.ApiConfigurationException;
import com.finbourne.lusid.extensions.ApiFactoryBuilder;
import com.finbourne.lusid.extensions.auth.FinbourneTokenException;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
public class AborApiExample {
public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException, ApiConfigurationException, FinbourneTokenException {
String fileName = "secrets.json";
try(PrintWriter writer = new PrintWriter(fileName, "UTF-8")) {
writer.write("{" +
"\"api\": {" +
" \"tokenUrl\": \"<your-token-url>\"," +
" \"lusidUrl\": \"https://<your-domain>.lusid.com/api\"," +
" \"username\": \"<your-username>\"," +
" \"password\": \"<your-password>\"," +
" \"clientId\": \"<your-client-id>\"," +
" \"clientSecret\": \"<your-client-secret>\"" +
" }" +
"}");
}
AborApi apiInstance = ApiFactoryBuilder.build(fileName).build(AborApi.class);
String scope = "scope_example"; // String | The scope of the Abor.
String code = "code_example"; // String | The code of the Abor.
String diaryEntryCode = "diaryEntryCode_example"; // String | Diary entry code
DiaryEntryRequest diaryEntryRequest = new DiaryEntryRequest(); // DiaryEntryRequest | The diary entry to add.
try {
DiaryEntry result = apiInstance.addDiaryEntry(scope, code, diaryEntryCode, diaryEntryRequest).execute();
System.out.println(result.toJson());
} catch (ApiException e) {
System.err.println("Exception when calling AborApi#addDiaryEntry");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
- See Documentation for API Endpoints for a description of each endpoint
- See Documentation for Models for descriptions of the models used