You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Login to the api to receive a jwt token that can be used in future requests without the need to reauthenticate
frombrink.clientimportBrinkAPIfrombrink.exceptionsimportBrinkAPIExceptionapi=BrinkAPI()
try:
# Login to the api via username and passwordaccess=api.login( 'username', 'password' )
exceptBrinkApiException, e:
# Login errorexit()
jwt_token=access['jwt_token']
# After logging in using the api.login() method, the token is already set so additional# requests can be handled correctlyflights=api.getFlights()
If you already have a jwt token prepared, you can use it when creating the api instance and bypass logging in.
frombrink.clientimportBrinkAPItoken='eyJ0eXAiOiJKV1QiLCJhbGc...'api=BrinkAPI(token)
# Get flightsflights=api.getFlights()
# Get details for a specific flightsflight=api.getFlight(10)
# Get data points for a specific flightparams= { 'page': 1, 'per_page': 50 }
flight_data=api.getFlightData(10,params)