# Nr1CatalogApp.SubscriptionsApi

All URIs are relative to *http://api.ncr.com/catalog/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addSubscription1**](SubscriptionsApi.md#addSubscription1) | **POST** /subscriptions | 
[**subscriptionsDeleteSubscription**](SubscriptionsApi.md#subscriptionsDeleteSubscription) | **DELETE** /subscriptions/{name} | 
[**subscriptionsGetSubscription**](SubscriptionsApi.md#subscriptionsGetSubscription) | **GET** /subscriptions/{name} | 
[**subscriptionsSearchSubscriptions**](SubscriptionsApi.md#subscriptionsSearchSubscriptions) | **GET** /subscriptions | 


<a name="addSubscription1"></a>
# **addSubscription1**
> UrlSubscriptionViewData addSubscription1(opts)



This rest endpoint will create a subscription to the 'catalog_update_v2' topic that will be filtered based on the requesting organization and enterprise unit. Requires the CATALOG_MESSAGING_SUBSCRIBER role.

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.SubscriptionsApi();

var opts = { 
  'body': new Nr1CatalogApp.CatalogSubscriptionRequest() // CatalogSubscriptionRequest | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CatalogSubscriptionRequest**](CatalogSubscriptionRequest.md)|  | [optional] 

### Return type

[**UrlSubscriptionViewData**](UrlSubscriptionViewData.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="subscriptionsDeleteSubscription"></a>
# **subscriptionsDeleteSubscription**
> subscriptionsDeleteSubscription(name, opts)



This rest endpoint will delete the subscription with the specified name. Requires the CATALOG_MESSAGING_SUBSCRIBER role.

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.SubscriptionsApi();

var name = "name_example"; // String | 

var opts = { 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**|  | 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="subscriptionsGetSubscription"></a>
# **subscriptionsGetSubscription**
> UrlSubscriptionViewData subscriptionsGetSubscription(name, opts)



This rest endpoint will get the subscription with the specified name. Requires the CATALOG_MESSAGING_SUBSCRIBER role.

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.SubscriptionsApi();

var name = "name_example"; // String | 

var opts = { 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**|  | 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**UrlSubscriptionViewData**](UrlSubscriptionViewData.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="subscriptionsSearchSubscriptions"></a>
# **subscriptionsSearchSubscriptions**
> FindSubscriptionsResponse subscriptionsSearchSubscriptions(opts)



This rest endpoint will return any subscriptions which match the provided namePattern and topicNamePattern. Requires the CATALOG_MESSAGING_SUBSCRIBER role.

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.SubscriptionsApi();

var opts = { 
  'namePattern': "namePattern_example", // String | 
  'topicNamePattern': "topicNamePattern_example", // String | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **namePattern** | **String**|  | [optional] 
 **topicNamePattern** | **String**|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**FindSubscriptionsResponse**](FindSubscriptionsResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

