docs/WebhookApi.md in ultracart_api-3.10.220 vs docs/WebhookApi.md in ultracart_api-4.0.32.rc

- old
+ new

@@ -1,447 +1,636 @@ -# UltracartClient::WebhookApi - -All URIs are relative to *https://secure.ultracart.com/rest/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_webhook**](WebhookApi.md#delete_webhook) | **DELETE** /webhook/webhooks/{webhookOid} | Delete a webhook -[**delete_webhook_by_url**](WebhookApi.md#delete_webhook_by_url) | **DELETE** /webhook/webhooks | Delete a webhook by URL -[**get_webhook_log**](WebhookApi.md#get_webhook_log) | **GET** /webhook/webhooks/{webhookOid}/logs/{requestId} | Retrieve an individual log -[**get_webhook_log_summaries**](WebhookApi.md#get_webhook_log_summaries) | **GET** /webhook/webhooks/{webhookOid}/logs | Retrieve the log summaries -[**get_webhooks**](WebhookApi.md#get_webhooks) | **GET** /webhook/webhooks | Retrieve webhooks -[**insert_webhook**](WebhookApi.md#insert_webhook) | **POST** /webhook/webhooks | Add a webhook -[**resend_event**](WebhookApi.md#resend_event) | **POST** /webhook/webhooks/{webhookOid}/reflow/{eventName} | Resend events to the webhook endpoint. -[**update_webhook**](WebhookApi.md#update_webhook) | **PUT** /webhook/webhooks/{webhookOid} | Update a webhook - - -# **delete_webhook** -> delete_webhook(webhook_oid) - -Delete a webhook - -Delete a webhook on the UltraCart account. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook_oid = 56 # Integer | The webhook oid to delete. - - -begin - #Delete a webhook - api_instance.delete_webhook(webhook_oid) -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->delete_webhook: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_oid** | **Integer**| The webhook oid to delete. | - -### Return type - -nil (empty response body) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - -# **delete_webhook_by_url** -> WebhookResponse delete_webhook_by_url(webhook) - -Delete a webhook by URL - -Delete a webhook based upon the URL on the webhook_url matching an existing webhook. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook = UltracartClient::Webhook.new # Webhook | Webhook to delete - - -begin - #Delete a webhook by URL - result = api_instance.delete_webhook_by_url(webhook) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->delete_webhook_by_url: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook** | [**Webhook**](Webhook.md)| Webhook to delete | - -### Return type - -[**WebhookResponse**](WebhookResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json; charset=UTF-8 - - **Accept**: application/json - - - -# **get_webhook_log** -> WebhookLogResponse get_webhook_log(webhook_oid, request_id) - -Retrieve an individual log - -Retrieves an individual log for a webhook given the webhook oid the request id. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook_oid = 56 # Integer | The webhook oid that owns the log. - -request_id = 'request_id_example' # String | The request id associated with the log to view. - - -begin - #Retrieve an individual log - result = api_instance.get_webhook_log(webhook_oid, request_id) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->get_webhook_log: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_oid** | **Integer**| The webhook oid that owns the log. | - **request_id** | **String**| The request id associated with the log to view. | - -### Return type - -[**WebhookLogResponse**](WebhookLogResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - -# **get_webhook_log_summaries** -> WebhookLogSummariesResponse get_webhook_log_summaries(webhook_oid, opts) - -Retrieve the log summaries - -Retrieves the log summary information for a given webhook. This is useful for displaying all the various logs that can be viewed. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook_oid = 56 # Integer | The webhook oid to retrieve log summaries for. - -opts = { - _limit: 100, # Integer | The maximum number of records to return on this one API call. - _offset: 0, # Integer | Pagination of the record set. Offset is a zero based index. - _since: '_since_example' # String | Fetch log summaries that have been delivered since this date/time. -} - -begin - #Retrieve the log summaries - result = api_instance.get_webhook_log_summaries(webhook_oid, opts) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->get_webhook_log_summaries: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_oid** | **Integer**| The webhook oid to retrieve log summaries for. | - **_limit** | **Integer**| The maximum number of records to return on this one API call. | [optional] [default to 100] - **_offset** | **Integer**| Pagination of the record set. Offset is a zero based index. | [optional] [default to 0] - **_since** | **String**| Fetch log summaries that have been delivered since this date/time. | [optional] - -### Return type - -[**WebhookLogSummariesResponse**](WebhookLogSummariesResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - -# **get_webhooks** -> WebhooksResponse get_webhooks(opts) - -Retrieve webhooks - -Retrieves the webhooks associated with this application. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -opts = { - _limit: 100, # Integer | The maximum number of records to return on this one API call. - _offset: 0, # Integer | Pagination of the record set. Offset is a zero based index. - _sort: '_sort_example', # String | The sort order of the webhooks. See documentation for examples - _placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. -} - -begin - #Retrieve webhooks - result = api_instance.get_webhooks(opts) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->get_webhooks: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **_limit** | **Integer**| The maximum number of records to return on this one API call. | [optional] [default to 100] - **_offset** | **Integer**| Pagination of the record set. Offset is a zero based index. | [optional] [default to 0] - **_sort** | **String**| The sort order of the webhooks. See documentation for examples | [optional] - **_placeholders** | **BOOLEAN**| Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] - -### Return type - -[**WebhooksResponse**](WebhooksResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - -# **insert_webhook** -> WebhookResponse insert_webhook(webhook, opts) - -Add a webhook - -Adds a new webhook on the account. If you add a new webhook with the authentication_type set to basic, but do not specify the basic_username and basic_password, UltraCart will automatically generate random ones and return them. This allows your application to have simpler logic on the setup of a secure webhook. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook = UltracartClient::Webhook.new # Webhook | Webhook to create - -opts = { - _placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. -} - -begin - #Add a webhook - result = api_instance.insert_webhook(webhook, opts) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->insert_webhook: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook** | [**Webhook**](Webhook.md)| Webhook to create | - **_placeholders** | **BOOLEAN**| Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] - -### Return type - -[**WebhookResponse**](WebhookResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json; charset=UTF-8 - - **Accept**: application/json - - - -# **resend_event** -> WebhookSampleRequestResponse resend_event(webhook_oid, event_name) - -Resend events to the webhook endpoint. - -This method will resend events to the webhook endpoint. This method can be used for example to send all the existing items on an account to a webhook. - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook_oid = 56 # Integer | The webhook oid that is receiving the reflowed events. - -event_name = 'event_name_example' # String | The event to reflow. - - -begin - #Resend events to the webhook endpoint. - result = api_instance.resend_event(webhook_oid, event_name) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->resend_event: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_oid** | **Integer**| The webhook oid that is receiving the reflowed events. | - **event_name** | **String**| The event to reflow. | - -### Return type - -[**WebhookSampleRequestResponse**](WebhookSampleRequestResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - -# **update_webhook** -> WebhookResponse update_webhook(webhook, webhook_oid, opts) - -Update a webhook - -Update a webhook on the account - -### Example -```ruby -# load the gem -require 'ultracart_api' - -# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key -simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00' -api_instance = UltracartClient::WebhookApi.new_using_api_key(simple_key, false, false) - - -webhook = UltracartClient::Webhook.new # Webhook | Webhook to update - -webhook_oid = 56 # Integer | The webhook oid to update. - -opts = { - _placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. -} - -begin - #Update a webhook - result = api_instance.update_webhook(webhook, webhook_oid, opts) - p result -rescue UltracartClient::ApiError => e - puts "Exception when calling WebhookApi->update_webhook: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook** | [**Webhook**](Webhook.md)| Webhook to update | - **webhook_oid** | **Integer**| The webhook oid to update. | - **_placeholders** | **BOOLEAN**| Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] - -### Return type - -[**WebhookResponse**](WebhookResponse.md) - -### Authorization - -[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) - -### HTTP request headers - - - **Content-Type**: application/json; charset=UTF-8 - - **Accept**: application/json - - - +# UltracartClient::WebhookApi + +All URIs are relative to *https://secure.ultracart.com/rest/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**delete_webhook**](WebhookApi.md#delete_webhook) | **DELETE** /webhook/webhooks/{webhookOid} | Delete a webhook | +| [**delete_webhook_by_url**](WebhookApi.md#delete_webhook_by_url) | **DELETE** /webhook/webhooks | Delete a webhook by URL | +| [**get_webhook_log**](WebhookApi.md#get_webhook_log) | **GET** /webhook/webhooks/{webhookOid}/logs/{requestId} | Retrieve an individual log | +| [**get_webhook_log_summaries**](WebhookApi.md#get_webhook_log_summaries) | **GET** /webhook/webhooks/{webhookOid}/logs | Retrieve the log summaries | +| [**get_webhooks**](WebhookApi.md#get_webhooks) | **GET** /webhook/webhooks | Retrieve webhooks | +| [**insert_webhook**](WebhookApi.md#insert_webhook) | **POST** /webhook/webhooks | Add a webhook | +| [**resend_event**](WebhookApi.md#resend_event) | **POST** /webhook/webhooks/{webhookOid}/reflow/{eventName} | Resend events to the webhook endpoint. | +| [**update_webhook**](WebhookApi.md#update_webhook) | **PUT** /webhook/webhooks/{webhookOid} | Update a webhook | + + +## delete_webhook + +> delete_webhook(webhook_oid) + +Delete a webhook + +Delete a webhook on the UltraCart account. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook_oid = 56 # Integer | The webhook oid to delete. + +begin + # Delete a webhook + api_instance.delete_webhook(webhook_oid) +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->delete_webhook: #{e}" +end +``` + +#### Using the delete_webhook_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> <Array(nil, Integer, Hash)> delete_webhook_with_http_info(webhook_oid) + +```ruby +begin + # Delete a webhook + data, status_code, headers = api_instance.delete_webhook_with_http_info(webhook_oid) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->delete_webhook_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_oid** | **Integer** | The webhook oid to delete. | | + +### Return type + +nil (empty response body) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_webhook_by_url + +> <WebhookResponse> delete_webhook_by_url(webhook) + +Delete a webhook by URL + +Delete a webhook based upon the URL on the webhook_url matching an existing webhook. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook = UltracartClient::Webhook.new # Webhook | Webhook to delete + +begin + # Delete a webhook by URL + result = api_instance.delete_webhook_by_url(webhook) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->delete_webhook_by_url: #{e}" +end +``` + +#### Using the delete_webhook_by_url_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhookResponse>, Integer, Hash)> delete_webhook_by_url_with_http_info(webhook) + +```ruby +begin + # Delete a webhook by URL + data, status_code, headers = api_instance.delete_webhook_by_url_with_http_info(webhook) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhookResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->delete_webhook_by_url_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook** | [**Webhook**](Webhook.md) | Webhook to delete | | + +### Return type + +[**WebhookResponse**](WebhookResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: application/json; charset=UTF-8 +- **Accept**: application/json + + +## get_webhook_log + +> <WebhookLogResponse> get_webhook_log(webhook_oid, request_id) + +Retrieve an individual log + +Retrieves an individual log for a webhook given the webhook oid the request id. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook_oid = 56 # Integer | The webhook oid that owns the log. +request_id = 'request_id_example' # String | The request id associated with the log to view. + +begin + # Retrieve an individual log + result = api_instance.get_webhook_log(webhook_oid, request_id) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->get_webhook_log: #{e}" +end +``` + +#### Using the get_webhook_log_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhookLogResponse>, Integer, Hash)> get_webhook_log_with_http_info(webhook_oid, request_id) + +```ruby +begin + # Retrieve an individual log + data, status_code, headers = api_instance.get_webhook_log_with_http_info(webhook_oid, request_id) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhookLogResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->get_webhook_log_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_oid** | **Integer** | The webhook oid that owns the log. | | +| **request_id** | **String** | The request id associated with the log to view. | | + +### Return type + +[**WebhookLogResponse**](WebhookLogResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_webhook_log_summaries + +> <WebhookLogSummariesResponse> get_webhook_log_summaries(webhook_oid, opts) + +Retrieve the log summaries + +Retrieves the log summary information for a given webhook. This is useful for displaying all the various logs that can be viewed. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook_oid = 56 # Integer | The webhook oid to retrieve log summaries for. +opts = { + _limit: 56, # Integer | The maximum number of records to return on this one API call. + _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index. + _since: '_since_example' # String | Fetch log summaries that have been delivered since this date/time. +} + +begin + # Retrieve the log summaries + result = api_instance.get_webhook_log_summaries(webhook_oid, opts) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->get_webhook_log_summaries: #{e}" +end +``` + +#### Using the get_webhook_log_summaries_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhookLogSummariesResponse>, Integer, Hash)> get_webhook_log_summaries_with_http_info(webhook_oid, opts) + +```ruby +begin + # Retrieve the log summaries + data, status_code, headers = api_instance.get_webhook_log_summaries_with_http_info(webhook_oid, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhookLogSummariesResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->get_webhook_log_summaries_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_oid** | **Integer** | The webhook oid to retrieve log summaries for. | | +| **_limit** | **Integer** | The maximum number of records to return on this one API call. | [optional][default to 100] | +| **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] | +| **_since** | **String** | Fetch log summaries that have been delivered since this date/time. | [optional] | + +### Return type + +[**WebhookLogSummariesResponse**](WebhookLogSummariesResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_webhooks + +> <WebhooksResponse> get_webhooks(opts) + +Retrieve webhooks + +Retrieves the webhooks associated with this application. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +opts = { + _limit: 56, # Integer | The maximum number of records to return on this one API call. + _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index. + _sort: '_sort_example', # String | The sort order of the webhooks. See documentation for examples + _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. +} + +begin + # Retrieve webhooks + result = api_instance.get_webhooks(opts) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->get_webhooks: #{e}" +end +``` + +#### Using the get_webhooks_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhooksResponse>, Integer, Hash)> get_webhooks_with_http_info(opts) + +```ruby +begin + # Retrieve webhooks + data, status_code, headers = api_instance.get_webhooks_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhooksResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->get_webhooks_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_limit** | **Integer** | The maximum number of records to return on this one API call. | [optional][default to 100] | +| **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] | +| **_sort** | **String** | The sort order of the webhooks. See documentation for examples | [optional] | +| **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] | + +### Return type + +[**WebhooksResponse**](WebhooksResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## insert_webhook + +> <WebhookResponse> insert_webhook(webhook, opts) + +Add a webhook + +Adds a new webhook on the account. If you add a new webhook with the authentication_type set to basic, but do not specify the basic_username and basic_password, UltraCart will automatically generate random ones and return them. This allows your application to have simpler logic on the setup of a secure webhook. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook = UltracartClient::Webhook.new # Webhook | Webhook to create +opts = { + _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. +} + +begin + # Add a webhook + result = api_instance.insert_webhook(webhook, opts) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->insert_webhook: #{e}" +end +``` + +#### Using the insert_webhook_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhookResponse>, Integer, Hash)> insert_webhook_with_http_info(webhook, opts) + +```ruby +begin + # Add a webhook + data, status_code, headers = api_instance.insert_webhook_with_http_info(webhook, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhookResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->insert_webhook_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook** | [**Webhook**](Webhook.md) | Webhook to create | | +| **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] | + +### Return type + +[**WebhookResponse**](WebhookResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: application/json; charset=UTF-8 +- **Accept**: application/json + + +## resend_event + +> <WebhookSampleRequestResponse> resend_event(webhook_oid, event_name) + +Resend events to the webhook endpoint. + +This method will resend events to the webhook endpoint. This method can be used for example to send all the existing items on an account to a webhook. + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook_oid = 56 # Integer | The webhook oid that is receiving the reflowed events. +event_name = 'event_name_example' # String | The event to reflow. + +begin + # Resend events to the webhook endpoint. + result = api_instance.resend_event(webhook_oid, event_name) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->resend_event: #{e}" +end +``` + +#### Using the resend_event_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhookSampleRequestResponse>, Integer, Hash)> resend_event_with_http_info(webhook_oid, event_name) + +```ruby +begin + # Resend events to the webhook endpoint. + data, status_code, headers = api_instance.resend_event_with_http_info(webhook_oid, event_name) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhookSampleRequestResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->resend_event_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_oid** | **Integer** | The webhook oid that is receiving the reflowed events. | | +| **event_name** | **String** | The event to reflow. | | + +### Return type + +[**WebhookSampleRequestResponse**](WebhookSampleRequestResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_webhook + +> <WebhookResponse> update_webhook(webhook_oid, webhook, opts) + +Update a webhook + +Update a webhook on the account + +### Examples + +```ruby +require 'time' +require 'ultracart_api' +# setup authorization +UltracartClient.configure do |config| + # Configure OAuth2 access token for authorization: ultraCartOauth + config.access_token = 'YOUR ACCESS TOKEN' + + # Configure API key authorization: ultraCartSimpleApiKey + config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer' +end + +api_instance = UltracartClient::WebhookApi.new +webhook_oid = 56 # Integer | The webhook oid to update. +webhook = UltracartClient::Webhook.new # Webhook | Webhook to update +opts = { + _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. +} + +begin + # Update a webhook + result = api_instance.update_webhook(webhook_oid, webhook, opts) + p result +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->update_webhook: #{e}" +end +``` + +#### Using the update_webhook_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<WebhookResponse>, Integer, Hash)> update_webhook_with_http_info(webhook_oid, webhook, opts) + +```ruby +begin + # Update a webhook + data, status_code, headers = api_instance.update_webhook_with_http_info(webhook_oid, webhook, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => <WebhookResponse> +rescue UltracartClient::ApiError => e + puts "Error when calling WebhookApi->update_webhook_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_oid** | **Integer** | The webhook oid to update. | | +| **webhook** | [**Webhook**](Webhook.md) | Webhook to update | | +| **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] | + +### Return type + +[**WebhookResponse**](WebhookResponse.md) + +### Authorization + +[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey) + +### HTTP request headers + +- **Content-Type**: application/json; charset=UTF-8 +- **Accept**: application/json +