- Fix get_received_texts_iterator() method
- Drop support for end-of-life Python 3.7
- Chain
RequestExceptions
when raising anHTTPError
so users can view the full context in stack traces etc.
- Adds
one_click_unsubscribe_url
parameter tosend_email_notification
- Removes the
is_csv
parameter toprepare_upload
. - Adds the
filename
parameter toprepare_upload
. See our documentation for guidance on how to use this.
- Add support for python 3.12
- Reuse the same
requests.session
between requests to increase performance through HTTP Keepalive
- Some minor non-functional code reformatting.
- Changing emitted logs to use lazy %-based evaluation rather than upfront "".format
- Changing an error-level log to a warning-level log (request failures). These still throw the actual exception to be caught and handled by the calling code.
- Add support for python 3.10 and 3.11
- Drop support for end-of-lifed python 3.6
- PyPI distribution no longer includes
integration_test
,tests
andutils
modules which were not intended for client use.
- Fix authentication when using PyJWT 2.6.0 - which now more strictly validates tokens with
iat
in the future.
- Added support for
confirm_email_before_download
andretention_period
security features for sending files by email.
- Added a default timeout of 30s to the
BaseAPIClient
- Auto-convert sets to lists in API calls
- Optionally include job notifications in
get_all_notifications
- Add type hints for errors
- Remove two dependencies that are now not needed,
monotonic
andfuture
- Properly block old versions of python from installing the new version
- Removed support for old versions of python.
- Drop support for Python 2.7, and versions of Python 3 below 3.6.
- Support PyJWT 2.0
- We added
letter_contact_block
to our template object serialization, which means it will be added to responses forget_template_by_id
requests and alsoget_template_version
andget_all_templates
. This version adds this newletter_contact_block
attribute to Documentation and tests.
- Add support for an optional
is_csv
parameter in theprepare_upload()
function. This fixes a bug when sending a CSV file by email. This ensures that the file is downloaded as a CSV rather than a TXT file.
- change error message to refer to file rather than document
- Improve error messages for errors related to JSON Web Tokens
- Add
NotificationsAPIClient.get_pdf_for_letter(id)
- Returns a
BytesIO
- Will raise a BadRequestError if the PDF is not available
- Returns a
- Add an optional
postage
argument tosend_precompiled_letter_notification
method. - Add postage to the response of
send_precompiled_letter_notification
- Add a document size check to
prepare_upload
. Will raiseValueError
when trying to upload a document larger than 2MB.
- Added
name
to the response forNotificationsAPIClient.get_template_by_id()
andNotificationsAPIClient.get_template_version()
- These functions now return the template name
- Change
BaseAPIClient.request
method to only add use thedata
andparams
arguments if they are notNone
, in order to avoid sending GET requests with a body of'null'
, since these are rejected by Cloudfront.
- Changed the way documents are added to the personalisation data. A new
prepare_upload
function has to be called for each document upload to prepare the file data to be sent to the Notify API.
- Added
created_by_name
to the response forNotificationsAPIClient.get_notification_by_id()
andNotificationsAPIClient.get_all_notifications()
- If the notification was sent manually, this will be the name of the sender. If the notification was sent through the API this will be
None
.
- If the notification was sent manually, this will be the name of the sender. If the notification was sent through the API this will be
- Add support for document uploads in
send_email_notification
- Fix issues when installing with pip 10.0.0
- Added post_precompiled_letter_response and updated integration tests
- The API now only returns notification id and client reference, so updated the response scheme to match
- Added
NotificationsAPIClient.send_precompiled_letter_notification()
- The client can now send PDF files which conform to the Notify printing template
- Send a File object
- 'reference' must be provided to identify the document
- Use Flake 8 rather than Pep 8
- Fixed PyJWT security issue. #91
- Added
NotificationsAPIClient.get_received_texts()
- an optional
older_than
argument can be specified to retrieve all received texts older than the last received text id. If omitted the first 250, the api limit, received texts will be returned, with links indicating how to retrieve the next page of results.
- an optional
- Added
NotificationsAPIClient.get_received_texts_iterator()
- returns all received texts by a generator object.
- Update to
NotificationsAPIClient.send_sms_notification()
- added
sms_sender_id
: an optionalsms_sender_id
specified when adding SMS senders under service settings. If this is not provided, the SMS sender will be the service default SMS sender.sms_sender_id
can be omitted.
- added
- Update to
NotificationsAPIClient.send_email_notification()
- added
email_reply_to_id
: an optional email_reply_to_id specified when adding Email reply to addresses under service settings, if this is not provided the reply to email will be the service default reply to email.email_reply_to_id
can be omitted.
- added
- Added
NotificationsAPIClient.send_letter_notification()
:- functions similarly to
send_sms_notification
andsend_email_notification
, however, address details are provided in the personalisation dict - See more details in the README
- functions similarly to
- Update to
NotificationsAPIClient.get_template(id)
:- the
dict
returned has changed, learn more from the README.
- the
- Update to
NotificationsAPIClient.get_template_version(id, version)
:- the
dict
returned has changed, learn more from the README.
- the
- Update to
NotificationsAPIClient.get_all_templates(template_type=None)
:- the
dict
returned has changed, learn more from the README
- the
- Replaced
NotificationsAPIClient.get_template_preview(id)
function withNotificationsAPIClient.post_template_preview(id, persionalisation)
:- See more details here README
NotificationsAPIClient.get_all_notifications()
- Notifications can be now be filtered by
reference
, see the README for details. - NotificationList response has changed, see the README for details.
- Notifications can be now be filtered by
- Python 2.7 supported
- Using version 2 of the notification-api.
- When creating a new NotificationsAPIClient the optional parameter of service_id has been removed. The api_key is a combined string contain the api_key and the service_id
- Update to
NotificationsAPIClient.send_sms_notification()
:- added
reference
: an optional unique identifier for the notification or an identifier for a batch of notifications.reference
can be omitted. - the
dict
returned has changed, learn more from the README.
- added
- Update to
NotificationClient.send_email_notification()
:- added
reference
: an optional unique identifier for the notification or an identifier for a batch of notifications.reference
can be omitted. - the
dict
returned has changed, learn more from the README.
- added
- Update to the response of
NotificationsAPIClient.get_notification_by_id(id)
, see the README for details.
BaseClient
method signature:base_url
is now optional. See #41BaseClient
method signature:api_key
is now a positional argument. See #41
- Replace asserts with proper exceptions in jwt token code. See #40
Changelog not recorded - please see pull requests on github.