# BookingHint.AuthApi

All URIs are relative to *http://localhost:8081*

Method | HTTP request | Description
------------- | ------------- | -------------
[**loginPOST**](AuthApi.md#loginPOST) | **POST** /login | 
[**logoutDELETE**](AuthApi.md#logoutDELETE) | **DELETE** /logout | 


<a name="loginPOST"></a>
# **loginPOST**
> AuthKey loginPOST(username, body)



Creates a new session, and returns a API key that can be used to access the API.  Sessions expired after a fixed length of time. 

### Example
```javascript
var BookingHint = require('booking_hint');

var apiInstance = new BookingHint.AuthApi();

var username = "username_example"; // String | The username that we want to login with. 

var body = new BookingHint.Body(); // Body | Set the property \"password\" to the password to login with. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.loginPOST(username, body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username that we want to login with.  | 
 **body** | [**Body**](Body.md)| Set the property \&quot;password\&quot; to the password to login with.  | 

### Return type

[**AuthKey**](AuthKey.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="logoutDELETE"></a>
# **logoutDELETE**
> logoutDELETE()



Deletes the session that is associated with authKey.  Returns a 404 if the authKey doesnt exist. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.AuthApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.logoutDELETE(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

