245 lines
7.0 KiB
Markdown
245 lines
7.0 KiB
Markdown
# memos.WebhookServiceApi
|
|
|
|
All URIs are relative to */*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**webhook_service_create_webhook**](WebhookServiceApi.md#webhook_service_create_webhook) | **POST** /api/v2/webhooks | CreateWebhook creates a new webhook.
|
|
[**webhook_service_delete_webhook**](WebhookServiceApi.md#webhook_service_delete_webhook) | **DELETE** /api/v2/webhooks/{id} | DeleteWebhook deletes a webhook by id.
|
|
[**webhook_service_get_webhook**](WebhookServiceApi.md#webhook_service_get_webhook) | **GET** /api/v2/webhooks/{id} | GetWebhook returns a webhook by id.
|
|
[**webhook_service_list_webhooks**](WebhookServiceApi.md#webhook_service_list_webhooks) | **GET** /api/v2/webhooks | ListWebhooks returns a list of webhooks.
|
|
[**webhook_service_update_webhook**](WebhookServiceApi.md#webhook_service_update_webhook) | **PATCH** /api/v2/webhooks/{webhook.id} | UpdateWebhook updates a webhook.
|
|
|
|
# **webhook_service_create_webhook**
|
|
> V2CreateWebhookResponse webhook_service_create_webhook(body)
|
|
|
|
CreateWebhook creates a new webhook.
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import memos
|
|
from memos.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# create an instance of the API class
|
|
api_instance = memos.WebhookServiceApi()
|
|
body = memos.V2CreateWebhookRequest() # V2CreateWebhookRequest |
|
|
|
|
try:
|
|
# CreateWebhook creates a new webhook.
|
|
api_response = api_instance.webhook_service_create_webhook(body)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling WebhookServiceApi->webhook_service_create_webhook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**body** | [**V2CreateWebhookRequest**](V2CreateWebhookRequest.md)| |
|
|
|
|
### Return type
|
|
|
|
[**V2CreateWebhookResponse**](V2CreateWebhookResponse.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **webhook_service_delete_webhook**
|
|
> V2DeleteWebhookResponse webhook_service_delete_webhook(id)
|
|
|
|
DeleteWebhook deletes a webhook by id.
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import memos
|
|
from memos.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# create an instance of the API class
|
|
api_instance = memos.WebhookServiceApi()
|
|
id = 56 # int |
|
|
|
|
try:
|
|
# DeleteWebhook deletes a webhook by id.
|
|
api_response = api_instance.webhook_service_delete_webhook(id)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling WebhookServiceApi->webhook_service_delete_webhook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **int**| |
|
|
|
|
### Return type
|
|
|
|
[**V2DeleteWebhookResponse**](V2DeleteWebhookResponse.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **webhook_service_get_webhook**
|
|
> V2GetWebhookResponse webhook_service_get_webhook(id)
|
|
|
|
GetWebhook returns a webhook by id.
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import memos
|
|
from memos.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# create an instance of the API class
|
|
api_instance = memos.WebhookServiceApi()
|
|
id = 56 # int |
|
|
|
|
try:
|
|
# GetWebhook returns a webhook by id.
|
|
api_response = api_instance.webhook_service_get_webhook(id)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling WebhookServiceApi->webhook_service_get_webhook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **int**| |
|
|
|
|
### Return type
|
|
|
|
[**V2GetWebhookResponse**](V2GetWebhookResponse.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **webhook_service_list_webhooks**
|
|
> V2ListWebhooksResponse webhook_service_list_webhooks(creator_id=creator_id)
|
|
|
|
ListWebhooks returns a list of webhooks.
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import memos
|
|
from memos.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# create an instance of the API class
|
|
api_instance = memos.WebhookServiceApi()
|
|
creator_id = 56 # int | (optional)
|
|
|
|
try:
|
|
# ListWebhooks returns a list of webhooks.
|
|
api_response = api_instance.webhook_service_list_webhooks(creator_id=creator_id)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling WebhookServiceApi->webhook_service_list_webhooks: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**creator_id** | **int**| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**V2ListWebhooksResponse**](V2ListWebhooksResponse.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **webhook_service_update_webhook**
|
|
> V2UpdateWebhookResponse webhook_service_update_webhook(body, webhook_id)
|
|
|
|
UpdateWebhook updates a webhook.
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import memos
|
|
from memos.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# create an instance of the API class
|
|
api_instance = memos.WebhookServiceApi()
|
|
body = memos.WebhooksWebhookIdBody() # WebhooksWebhookIdBody |
|
|
webhook_id = 56 # int |
|
|
|
|
try:
|
|
# UpdateWebhook updates a webhook.
|
|
api_response = api_instance.webhook_service_update_webhook(body, webhook_id)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling WebhookServiceApi->webhook_service_update_webhook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**body** | [**WebhooksWebhookIdBody**](WebhooksWebhookIdBody.md)| |
|
|
**webhook_id** | **int**| |
|
|
|
|
### Return type
|
|
|
|
[**V2UpdateWebhookResponse**](V2UpdateWebhookResponse.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|