Commit fa0b6da3 authored by Matija Obreza's avatar Matija Obreza


parent df07a9ad
......@@ -4,14 +4,56 @@
**genesys-client-api** library aims to ease integration of your existing
accession management software in Java with [Genesys PGR portal]( "Visit Genesys PGR").
## How to use `genesys-client-api`
## Using the API client
### Initializing the client
GenesysClient genesysClient = new GenesysClient();
// Set server URL
// Specify clientKey, secret and the callback URL as registered on the server
genesysClient.connect(clientKey, clientSecret, callbackUrl);
// Ask end user to navigate to Genesys server and authorize your access to their resources
String authorizationUrl = genesysClient.getAuthorizationUrl(GenesysClient.EMPTY_TOKEN);
// Open this URL in browser, login and allow us to access your resources and come back with the code
String verifierCode = null; // whatever user provides
// Test it with /me;
// Tokens are now accessible. The refreshToken must be **safely** stored for future use.
Updating data:
List<AccessionJson> accns=new ArrayList<AccessionJson>();
// In a loop, create, fill and add entries to the list
AccessionJson accn=new AccessionJson();
// Once the appropriate batch size is reached
// (good size is 25 or 50 entries)
// send to server
try {
genesysClient.updateAccessions(instCode, accns);
} catch (....) {
// handle exceptions
## How to reference `genesys-client-api`
The genesys-client-api snapshots are published on [OSSRH](
### Your copy of the library
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment