Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Examples, and usage.

Jordan edited this page Apr 1, 2019 · 4 revisions

Vatsim Member API Wiki

Getting Started

Version 1.0:

By default, the way we cache information is by creating a folder called "users" in the project directory, this can obviously be changed, and feel free to do so. When getClient(CID) is called, it will automatically create the folder if it doesn't already exist, and it will then download the user's information to an XML file (that is formatted to make it look pretty)

Version 1.1:

To make the model a LOT faster, I changed it so it just reads from the URL, and then uses it the same way it would if it was reading it from the file. But instead of about 2000ms (Version 1.0) it now takes about ~450 ms. The main reason for the change was primarily because of VatsimSync (A project of mine). VatsimSync needs a really quick turnaround for getting information about controllers. So changing the API and making it faster was a must and so I did.

First Client

public static void main(String[] args) {
    Client client = new Client.Builder().getClient("1429747").build();
    System.out.println("First and lastname: " + client.getFirstName() + " " + client.getLastName() + "\n" +
        "Client (Controller Rating): " + client.getControllerRating());
}

It should print out something along these lines:

First and last name: Jordan Jolenaar
Client (Controller Rating): Student 2

Description of each method.

        cid - The cid of the client you are looking up
        firstName - The first name of the client you are looking up.
        lastName - The last name of the client you are looking up.
        emailSuffix - The suffix (the ending part) of the user's email (i.e @gmail.com)
        controllerRating - This is the *Controller* rating of the person you are looking up.
        registrationDate - The registration date of the member you are looking up.
        pilotRating - The *Pilot* rating of the person you are looking up.
        clientCountry - The country of the client you are looking up.
        clientRegion - The clients Vatsim region.
        clientDivision - The clients Vatsim division.
        clientATCTime - The clients total time as a Controller.
        clientPilotTime - The clients total time as a pilot.