All URIs are relative to https://airlines-api.hopper.com/airline/v1.1
| Method | HTTP request | Description |
|---|---|---|
| postSessions | POST /sessions | Create a Session |
AirlineSession postSessions(createAirlineSessionRequest)
Create a Session
Create a new session for which events will be collected.
// 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.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.SessionsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
SessionsApi apiInstance = new SessionsApi(defaultClient);
CreateAirlineSessionRequest createAirlineSessionRequest = new CreateAirlineSessionRequest(); // CreateAirlineSessionRequest |
try {
AirlineSession result = apiInstance.postSessions(createAirlineSessionRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SessionsApi#postSessions");
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 |
|---|---|---|---|
| createAirlineSessionRequest | CreateAirlineSessionRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | The created airline session | * Expires - * Cache-Control - |
| 204 | The airline session creation request was not performed | * Expires - * Cache-Control - |
| 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 | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |