Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Change Log
## [4.61.0](https://github.com/plivo/plivo-python/tree/v4.61.0) (2026-05-23)
**Feature - whatsapp_templates, verify_apps, verify_app_templates API updates**
- Added `application_id` optional parameter to whatsapp_templates.create (POST /v1/Account/{auth_id}/WhatsApp/Template/{waba_id}/)
- Added `application_id` optional parameter to whatsapp_templates.update (POST /v1/Account/{auth_id}/WhatsApp/Template/{waba_id}/{template_id}/)
- Added `name`, `otp_type`, `otp_length`, `otp_expiry`, `otp_attempts`, `brand_name`, `sms_channel`, `voice_channel`, `wa_channel`, `is_default`, `template_uuid`, `message_redaction`, `customer_app_hash`, `max_validation_attempts`, `enable_fraudshield`, `fs_protection_level`, `waba_id`, `waba_phone_number`, `waba_template_id` parameters to verify_apps.create (POST /v1/Account/{auth_id}/Verify/App/)
- Added `name`, `app_uuid`, `channel`, `status`, `limit`, `offset`, `created_at`, `created_at__lt`, `created_at__lte`, `created_at__gt`, `created_at__gte`, `subaccount_auth_id` parameters to verify_apps.list (GET /v1/Account/{auth_id}/Verify/App/)
- GET /v1/Account/{auth_id}/Verify/App/templates/ — verify_app_templates.list. List available SMS OTP templates for the account including account-owned and Plivo system defaults.
- GET /v1/Account/{auth_id}/Verify/App/{app_uuid}/ — verify_apps.get. Retrieve details of a specific Verify App by its UUID.
- Added `name`, `brand_name`, `otp_type`, `otp_length`, `otp_expiry`, `otp_attempts`, `sms_channel`, `voice_channel`, `wa_channel`, `is_default`, `template_uuid`, `message_redaction`, `customer_app_hash`, `max_validation_attempts`, `enable_fraudshield`, `fs_protection_level`, `waba_id`, `waba_phone_number`, `waba_template_id` parameters to verify_apps.update (POST /v1/Account/{auth_id}/Verify/App/{app_uuid}/)
- DELETE /v1/Account/{auth_id}/Verify/App/{app_uuid}/ — verify_apps.delete. Soft-delete a Verify App by its UUID.

_Source: plivo/api-messaging#629_

## [4.60.1](https://github.com/plivo/plivo-python/tree/v4.60.1) (2026-04-17)
**Bug Fix - PhoneNumber Compliance API**
- Fixed Requirements.get() sending None values as query params when not provided
Expand Down
11 changes: 11 additions & 0 deletions examples/verify_app_templates_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

response = client.verify_app_templates.list()

print('API ID:', response.api_id)
print('Templates:')
for template in response:
print(' -', template)
21 changes: 21 additions & 0 deletions examples/verify_apps_create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

response = client.verify_apps.create(
name='MyVerifyApp',
otp_length=6,
otp_expiry=3,
otp_attempts=3,
brand_name='MyBrand',
sms_channel=True,
voice_channel=False,
wa_channel=False,
is_default=False,
message_redaction=False,
max_validation_attempts=5,
enable_fraudshield=True,
fs_protection_level='medium',
)

print(response)
9 changes: 9 additions & 0 deletions examples/verify_apps_delete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

app_uuid = 'your-app-uuid'

response = client.verify_apps.delete(app_uuid)

print(response)
9 changes: 9 additions & 0 deletions examples/verify_apps_get.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

app_uuid = 'your-app-uuid'

response = client.verify_apps.get(app_uuid)

print(response)
11 changes: 11 additions & 0 deletions examples/verify_apps_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

response = client.verify_apps.list(
limit=20,
offset=0,
status='active',
)

print(response)
15 changes: 15 additions & 0 deletions examples/verify_apps_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

app_uuid = 'your-app-uuid'

response = client.verify_apps.update(
app_uuid,
name='UpdatedAppName',
otp_length=8,
enable_fraudshield=True,
fs_protection_level='high',
)

print(response)
35 changes: 35 additions & 0 deletions examples/whatsapp_templates_create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

# Create a WhatsApp template without application_id
response = client.whatsapp_templates.create(
waba_id='your_waba_id',
name='your_template_name',
language='en_US',
category='MARKETING',
components=[
{
'type': 'BODY',
'text': 'Hello, this is a template message.',
}
],
)
print(response)

# Create a WhatsApp template with optional application_id
response = client.whatsapp_templates.create(
waba_id='your_waba_id',
name='your_template_name',
language='en_US',
category='MARKETING',
components=[
{
'type': 'BODY',
'text': 'Hello, this is a template message.',
}
],
application_id='your_application_id',
)
print(response)
31 changes: 31 additions & 0 deletions examples/whatsapp_templates_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
import plivo

client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')

# Update a WhatsApp template without application_id
response = client.whatsapp_templates.update(
waba_id='your_waba_id',
template_id='your_template_id',
components=[
{
'type': 'BODY',
'text': 'Hello, this is an updated template message.',
}
],
)
print(response)

# Update a WhatsApp template with optional application_id
response = client.whatsapp_templates.update(
waba_id='your_waba_id',
template_id='your_template_id',
components=[
{
'type': 'BODY',
'text': 'Hello, this is an updated template message.',
}
],
application_id='your_application_id',
)
print(response)
42 changes: 42 additions & 0 deletions plivo/resources/verify_app_templates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
from plivo.base import PlivoResource, PlivoResourceInterface, ResponseObject
from plivo.utils import to_param_dict
from plivo.utils.validators import *


class VerifyAppTemplate(ResponseObject):
def __init__(self, dct):
super(VerifyAppTemplate, self).__init__(dct)


class VerifyAppTemplatesResponse(ResponseObject):
def __init__(self, client, dct):
super(VerifyAppTemplatesResponse, self).__init__(dct)
self.api_id = dct.get('api_id', None)
self.templates = dct.get('templates', [])

def __iter__(self):
if self.templates is not None:
return iter(self.templates)
return iter([])

def __len__(self):
if self.templates is not None:
return len(self.templates)
return 0

def __str__(self):
import pprint
return pprint.pformat({'api_id': self.api_id, 'templates': self.templates})

def __repr__(self):
return self.__str__()


class VerifyAppTemplates(PlivoResourceInterface):
def list(self):
return self.client.request(
'GET',
('Verify', 'App', 'templates'),
response_type=VerifyAppTemplatesResponse,
)
Loading
Loading