# PartnershipManagement.EventsSubscriptionApi

All URIs are relative to *https://serverRoot/tmf-api/partnershipManagement/v4/*

Method | HTTP request | Description
------------- | ------------- | -------------
[**registerListener**](EventsSubscriptionApi.md#registerListener) | **POST** /hub | Register a listener
[**unregisterListener**](EventsSubscriptionApi.md#unregisterListener) | **DELETE** /hub/{id} | Unregister a listener

<a name="registerListener"></a>
# **registerListener**
> EventSubscription registerListener(body)

Register a listener

Sets the communication endpoint address the service instance must use to deliver information about its health state, execution state, failures and metrics.

### Example
```javascript
import {PartnershipManagement} from 'partnership_management';

let apiInstance = new PartnershipManagement.EventsSubscriptionApi();
let body = new PartnershipManagement.EventSubscriptionInput(); // EventSubscriptionInput | Data containing the callback endpoint to deliver the information

apiInstance.registerListener(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**EventSubscriptionInput**](EventSubscriptionInput.md)| Data containing the callback endpoint to deliver the information | 

### Return type

[**EventSubscription**](EventSubscription.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json;charset=utf-8
 - **Accept**: application/json;charset=utf-8

<a name="unregisterListener"></a>
# **unregisterListener**
> unregisterListener(id)

Unregister a listener

Resets the communication endpoint address the service instance must use to deliver information about its health state, execution state, failures and metrics.

### Example
```javascript
import {PartnershipManagement} from 'partnership_management';

let apiInstance = new PartnershipManagement.EventsSubscriptionApi();
let id = "id_example"; // String | The id of the registered listener

apiInstance.unregisterListener(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The id of the registered listener | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json;charset=utf-8

