Eve Online CREST implementation in Java.
- Insert Jitpack Dependency in Gradle
repositories {
maven { url "https://jitpack.io" }
}
- Add project to dependencies
compile 'com.github.evanova:eve-crest-java:master-SNAPSHOT'
- If you don't want the latest version of master, Replace
master-SNAPSHOT
with a release version - current is1.0
- Configure a CrestClient
final CrestClient client =
CrestClient.TQ()
.id("Your CREST application ID")
.key("Your CREST application key")
.build();
There are more options available to build a client. Please see CrestClient.Builder for more details.
- Obtain a CrestService instance from a CrestClient
//Public CREST access
service = client.newCrestService();
//Obtain a token from an authorization code
CrestToken token = client.fromAuthCode(authCode);
//or an existing refresh token
CrestToken token = client.fromRefresh(refreshToken);
//use the refresh value
//Authenticated CREST access
service = client.newCrestService(token.getRefreshToken());
From then on, the CrestService will use the refresh token to get proper access to CREST and will take care of refreshing its access token as necessary.
- Interact with CREST
Once you obtained a CrestService
, all methods in the interface are available to you.
final List<CrestContact> contacts = service.getContacts();
Assert.assertFalse("No contact found. Do you have any friend?", contacts.isEmpty());
service.deleteContact(contact.getContact().getId());
service.addContact(contact);
You will need to edit the crest.properties
file in the test folder and fill it with the required information (see that file for details), then remove the Ignore tag on the tests. Run ./gradlew check
afterward.
Eve Online 3rd Party documentation
You are encouraged to add more CrestService
method and/or add new CREST endpoints to the CREST Retrofit interface.
Ask around on slack/#devfleet for details.
This library uses