All URIs are relative to https://airlines-api.hopper.com/airline/v1.1
| Method | HTTP request | Description |
|---|---|---|
| postAuth | POST /auth | Create an authentication token |
AuthResponse postAuth(authRequest)
Create an authentication token
Get an authentication token
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.AuthenticationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
AuthenticationApi apiInstance = new AuthenticationApi(defaultClient);
AuthRequest authRequest = new AuthRequest(); // AuthRequest |
try {
AuthResponse result = apiInstance.postAuth(authRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthenticationApi#postAuth");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| authRequest | AuthRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | The authentication response | - |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 422 | Semantic errors were encountered while handling the request | - |