# Cyclos411Api.PushApi

All URIs are relative to *https://138.197.145.149:8080/cyclos/eCloudAtm/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**subscribeForPushNotifications**](PushApi.md#subscribeForPushNotifications) | **GET** /push/subscribe | Subscribes for receiving push notifications of specific types


<a name="subscribeForPushNotifications"></a>
# **subscribeForPushNotifications**
> subscribeForPushNotifications(clientId, kinds, opts)

Subscribes for receiving push notifications of specific types

Returns an event stream of server-sent events

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.PushApi();

var clientId = "clientId_example"; // String | An id generated by the client. This id is valid for the authenticated used, indicating a single session. As event streams can timeout and be reconnected, subsequent subscriptions with the same user and client id are considered the same subscription, and missed events since the last timeout will be immediately delivered. Missed events are enqueued up to a few minutes after the connection timeout. After that window, any enqueued events are discarded. 

var kinds = ["kinds_example"]; // [String] | The event kinds for which the client desires to subscribe Possible values for each array element are: * accountStatus: The account status (balance, reserved amount, etc) has changed * loggedOut: The current session has been invalidated * newMessage: New message on the user's inbox * newNotification: New received notification * ticket: A ticket status has changed 

var opts = { 
  'accountIds': ["accountIds_example"], // [String] | When subscribing to `accountStatus` events, this parameter must be informed to select the accounts to be watched for. 
  'ticketNumber': "ticketNumber_example", // String | When subscribing to `ticket` events, this parameter can be used to filter which ticket to monitor. 
  'lastEventId': "lastEventId_example" // String | The last received event id, in case of reconnections. May also be passed as the standard header `Last-Event-ID`. 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **clientId** | **String**| An id generated by the client. This id is valid for the authenticated used, indicating a single session. As event streams can timeout and be reconnected, subsequent subscriptions with the same user and client id are considered the same subscription, and missed events since the last timeout will be immediately delivered. Missed events are enqueued up to a few minutes after the connection timeout. After that window, any enqueued events are discarded.  | 
 **kinds** | [**[String]**](String.md)| The event kinds for which the client desires to subscribe Possible values for each array element are: * accountStatus: The account status (balance, reserved amount, etc) has changed * loggedOut: The current session has been invalidated * newMessage: New message on the user&#39;s inbox * newNotification: New received notification * ticket: A ticket status has changed  | 
 **accountIds** | [**[String]**](String.md)| When subscribing to &#x60;accountStatus&#x60; events, this parameter must be informed to select the accounts to be watched for.  | [optional] 
 **ticketNumber** | **String**| When subscribing to &#x60;ticket&#x60; events, this parameter can be used to filter which ticket to monitor.  | [optional] 
 **lastEventId** | **String**| The last received event id, in case of reconnections. May also be passed as the standard header &#x60;Last-Event-ID&#x60;.  | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, text/event-stream

