All URIs are relative to https://api.phrase.com/v2
Method | HTTP request | Description |
---|---|---|
webhook_create | POST /projects/{project_id}/webhooks | Create a webhook |
webhook_delete | DELETE /projects/{project_id}/webhooks/{id} | Delete a webhook |
webhook_show | GET /projects/{project_id}/webhooks/{id} | Get a single webhook |
webhook_test | POST /projects/{project_id}/webhooks/{id}/test | Test a webhook |
webhook_update | PATCH /projects/{project_id}/webhooks/{id} | Update a webhook |
webhooks_list | GET /projects/{project_id}/webhooks | List webhooks |
Webhook webhook_create(project_id, webhook_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
Create a webhook
Create a new webhook.
from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint
configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = phrase_api.WebhooksApi(api_client)
project_id = 'project_id_example' # str | Project ID (required)
webhook_create_parameters = phrase_api.WebhookCreateParameters() # WebhookCreateParameters | (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Create a webhook
api_response = api_instance.webhook_create(project_id, webhook_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->webhook_create: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_id | str | Project ID | |
webhook_create_parameters | WebhookCreateParameters | ||
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
400 | Bad request | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
404 | Not Found | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
429 | Rate Limiting | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
webhook_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
Delete a webhook
Delete an existing webhook.
from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint
configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = phrase_api.WebhooksApi(api_client)
project_id = 'project_id_example' # str | Project ID (required)
id = 'id_example' # str | ID (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Delete a webhook
api_instance.webhook_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
except ApiException as e:
print("Exception when calling WebhooksApi->webhook_delete: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_id | str | Project ID | |
id | str | ID | |
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | The resource was deleted successfully. | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
400 | Bad request | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
404 | Not Found | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
429 | Rate Limiting | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Webhook webhook_show(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
Get a single webhook
Get details on a single webhook.
from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint
configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = phrase_api.WebhooksApi(api_client)
project_id = 'project_id_example' # str | Project ID (required)
id = 'id_example' # str | ID (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Get a single webhook
api_response = api_instance.webhook_show(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->webhook_show: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_id | str | Project ID | |
id | str | ID | |
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
400 | Bad request | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
404 | Not Found | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
429 | Rate Limiting | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
webhook_test(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
Test a webhook
Perform a test request for a webhook.
from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint
configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = phrase_api.WebhooksApi(api_client)
project_id = 'project_id_example' # str | Project ID (required)
id = 'id_example' # str | ID (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Test a webhook
api_instance.webhook_test(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
except ApiException as e:
print("Exception when calling WebhooksApi->webhook_test: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_id | str | Project ID | |
id | str | ID | |
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | OK | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
400 | Bad request | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
404 | Not Found | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
429 | Rate Limiting | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Webhook webhook_update(project_id, id, webhook_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
Update a webhook
Update an existing webhook.
from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint
configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = phrase_api.WebhooksApi(api_client)
project_id = 'project_id_example' # str | Project ID (required)
id = 'id_example' # str | ID (required)
webhook_update_parameters = phrase_api.WebhookUpdateParameters() # WebhookUpdateParameters | (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Update a webhook
api_response = api_instance.webhook_update(project_id, id, webhook_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->webhook_update: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_id | str | Project ID | |
id | str | ID | |
webhook_update_parameters | WebhookUpdateParameters | ||
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
400 | Bad request | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
404 | Not Found | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
429 | Rate Limiting | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List[Webhook] webhooks_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page)
List webhooks
List all webhooks for the given project.
from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint
configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = phrase_api.WebhooksApi(api_client)
project_id = 'project_id_example' # str | Project ID (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
page = 1 # int | Page number
per_page = 25 # int | Limit on the number of objects to be returned, between 1 and 100. 25 by default
try:
# List webhooks
api_response = api_instance.webhooks_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->webhooks_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_id | str | Project ID | |
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
page | int | Page number | [optional] |
per_page | int | Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - * Link - * Pagination - |
400 | Bad request | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
404 | Not Found | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
429 | Rate Limiting | * X-Rate-Limit-Limit - * X-Rate-Limit-Remaining - * X-Rate-Limit-Reset - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]