Skip to content

Latest commit

 

History

History
273 lines (194 loc) · 7.94 KB

WebhooksApi.md

File metadata and controls

273 lines (194 loc) · 7.94 KB

sib_api_v3_sdk.WebhooksApi

All URIs are relative to https://api.sendinblue.com/v3

Method HTTP request Description
create_webhook POST /webhooks Create a webhook
delete_webhook DELETE /webhooks/{webhookId} Delete a webhook
get_webhook GET /webhooks/{webhookId} Get a webhook details
get_webhooks GET /webhooks Get all webhooks
update_webhook PUT /webhooks/{webhookId} Update a webhook

create_webhook

CreateModel create_webhook(create_webhook)

Create a webhook

Example

from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# create an instance of the API class
api_instance = sib_api_v3_sdk.WebhooksApi(sib_api_v3_sdk.ApiClient(configuration))
create_webhook = sib_api_v3_sdk.CreateWebhook() # CreateWebhook | Values to create a webhook

try:
    # Create a webhook
    api_response = api_instance.create_webhook(create_webhook)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->create_webhook: %s\n" % e)

Parameters

Name Type Description Notes
create_webhook CreateWebhook Values to create a webhook

Return type

CreateModel

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_webhook

delete_webhook(webhook_id)

Delete a webhook

Example

from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# create an instance of the API class
api_instance = sib_api_v3_sdk.WebhooksApi(sib_api_v3_sdk.ApiClient(configuration))
webhook_id = 789 # int | Id of the webhook

try:
    # Delete a webhook
    api_instance.delete_webhook(webhook_id)
except ApiException as e:
    print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e)

Parameters

Name Type Description Notes
webhook_id int Id of the webhook

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_webhook

GetWebhook get_webhook(webhook_id)

Get a webhook details

Example

from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# create an instance of the API class
api_instance = sib_api_v3_sdk.WebhooksApi(sib_api_v3_sdk.ApiClient(configuration))
webhook_id = 789 # int | Id of the webhook

try:
    # Get a webhook details
    api_response = api_instance.get_webhook(webhook_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->get_webhook: %s\n" % e)

Parameters

Name Type Description Notes
webhook_id int Id of the webhook

Return type

GetWebhook

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_webhooks

GetWebhooks get_webhooks(type=type)

Get all webhooks

Example

from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# create an instance of the API class
api_instance = sib_api_v3_sdk.WebhooksApi(sib_api_v3_sdk.ApiClient(configuration))
type = 'transactional' # str | Filter on webhook type (optional) (default to transactional)

try:
    # Get all webhooks
    api_response = api_instance.get_webhooks(type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e)

Parameters

Name Type Description Notes
type str Filter on webhook type [optional] [default to transactional]

Return type

GetWebhooks

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_webhook

update_webhook(webhook_id, update_webhook)

Update a webhook

Example

from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# create an instance of the API class
api_instance = sib_api_v3_sdk.WebhooksApi(sib_api_v3_sdk.ApiClient(configuration))
webhook_id = 789 # int | Id of the webhook
update_webhook = sib_api_v3_sdk.UpdateWebhook() # UpdateWebhook | Values to update a webhook

try:
    # Update a webhook
    api_instance.update_webhook(webhook_id, update_webhook)
except ApiException as e:
    print("Exception when calling WebhooksApi->update_webhook: %s\n" % e)

Parameters

Name Type Description Notes
webhook_id int Id of the webhook
update_webhook UpdateWebhook Values to update a webhook

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]