xdev-software / universe-client

A simple Java client for the Universe API
Apache License 2.0
0 stars 0 forks source link
jcon universe universe-client

Latest version Build Quality Gate Status

Universe client for Java

A simple Java client for the Universe API.

Usage

The two basic entries are the ApplicationId and the RedirectUri. They must be set.

If these two entries are set, you need to get AuthorizationCode. This is a one-time-only code, which you get by calling the URL provided by client.getUrlToGetAuthorizationCode().

With this AuthorizationCode you can request a BearerToken. You can can request the BearerToken only one time with one AuthorizationCode. After that the AuthorizationCode is invalidated. This can be achieved with client.requestBearerToken(). The BearerToken can be used for all your future requests. It is usually valid for one month.

If the BearerToken is set, you can use the actual API calls.

Example

Full example, see Demo.

UniverseClient client = new UniverseClient(yourConfig);

// Get Events
List<Event> events = client.requestEvents(hostId);
events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")"));

// Get Attendees
List<Attendee> attendees = client.requestAttendeesInEvent(events.get(0).getId(), 5, 0);

GraphQL

We are using the Universe GraphQL API. Here are some thing to help with orientation with GraphQL.

You can test requests on Universes GraphiQL (Explorer);

Get Schema:

{
  __schema {
    queryType {
      fields {
        name
      }
    }
  }
}

Installation

Installation guide for the latest release

Support

If you need support as soon as possible and you can't wait for any pull request, feel free to use our support.

Contributing

See the contributing guide for detailed instructions on how to get started with our project.

Dependencies and Licenses

View the license of the current project or the summary including all dependencies