Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 2.31 KB

File metadata and controls

75 lines (56 loc) · 2.31 KB

AuthenticationApi

All URIs are relative to https://airlines-api.hopper.com/airline/v1.1

Method HTTP request Description
postAuth POST /auth Create an authentication token

postAuth

AuthResponse postAuth(authRequest)

Create an authentication token

Get an authentication token

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
authRequest AuthRequest

Return type

AuthResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

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 -