All URIs are relative to /
Method | HTTP request | Description |
---|---|---|
add_hook | POST /v1/organizations/{organization_id}/hooks | Создать webhook для организации |
edit_hook | POST /v1/organizations/{organization_id}/hooks/{hook_id} | Изменить webhook |
get_hook | GET /v1/organizations/{organization_id}/hooks/{hook_id} | Получить webhook по ID |
get_hooks | GET /v1/organizations/{organization_id}/hooks | Получить список webhook'ов |
WebhooksApiResponse add_hook(organization_id, body=body)
Создать webhook для организации
Позволяет добавить новый webhook в организацию. Подробнее о системе хуков и ее использовании можно прочитать в статье http://dev.timepad.ru/api/hooks/
from __future__ import print_function
import time
import timepad
from timepad.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: timepad_implicit
configuration = timepad.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = timepad.WebhooksApi(timepad.ApiClient(configuration))
organization_id = 56 # int | Идентификатор организации
body = timepad.CreateHook() # CreateHook | Описание добавляемого webhook'а (optional)
try:
# Создать webhook для организации
api_response = api_instance.add_hook(organization_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->add_hook: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
organization_id | int | Идентификатор организации | |
body | CreateHook | Описание добавляемого webhook'а | [optional] |
- Content-Type: /
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookApiResponse edit_hook(organization_id, hook_id, body=body)
Изменить webhook
Позволяет изменить webhook в организации. Подробнее о системе хуков и ее использовании можно прочитать в статье http://dev.timepad.ru/api/hooks/
from __future__ import print_function
import time
import timepad
from timepad.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: timepad_implicit
configuration = timepad.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = timepad.WebhooksApi(timepad.ApiClient(configuration))
organization_id = 56 # int | Идентификатор организации
hook_id = 56 # int | Идентификатор webhook'а
body = timepad.EditHook() # EditHook | Поля для обновления webhook'а (optional)
try:
# Изменить webhook
api_response = api_instance.edit_hook(organization_id, hook_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->edit_hook: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
organization_id | int | Идентификатор организации | |
hook_id | int | Идентификатор webhook'а | |
body | EditHook | Поля для обновления webhook'а | [optional] |
- Content-Type: /
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookApiResponse get_hook(organization_id, hook_id)
Получить webhook по ID
Позволяет получить информацию о добавленном для организации webhook'е. Подробнее о системе хуков и ее использовании можно прочитать в статье http://dev.timepad.ru/api/hooks/
from __future__ import print_function
import time
import timepad
from timepad.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: timepad_implicit
configuration = timepad.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = timepad.WebhooksApi(timepad.ApiClient(configuration))
organization_id = 56 # int | Идентификатор организации
hook_id = 56 # int | Идентификатор webhook'а
try:
# Получить webhook по ID
api_response = api_instance.get_hook(organization_id, hook_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->get_hook: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
organization_id | int | Идентификатор организации | |
hook_id | int | Идентификатор webhook'а |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhooksApiResponse get_hooks(organization_id, type=type)
Получить список webhook'ов
Позволяет получить список webhook'ов для указанной организации. Подробнее о системе хуков и ее использовании можно прочитать в статье http://dev.timepad.ru/api/hooks/
from __future__ import print_function
import time
import timepad
from timepad.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: timepad_implicit
configuration = timepad.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = timepad.WebhooksApi(timepad.ApiClient(configuration))
organization_id = 56 # int | Идентификатор организации
type = 'type_example' # str | Тип получаемых webhook'ов (optional)
try:
# Получить список webhook'ов
api_response = api_instance.get_hooks(organization_id, type=type)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->get_hooks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
organization_id | int | Идентификатор организации | |
type | str | Тип получаемых webhook'ов | [optional] |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]