Skip to content

DVLA & Letters

Leo Hemsted edited this page Apr 24, 2024 · 7 revisions

General resources:

Overview

Notify Letters are printed and posted by DVLA. We send them fully formed PDFs, and they print them, fold them, put them in envelopes, lick the back of the envelopes, and load them onto royal mail trucks.

We send letters to DVLA via an HTTPS JSON API. We send them in a batch job every evening including weekends and bank holidays.

You can see the DVLA Print API documentation here: https://developer-portal.driver-vehicle-licensing.api.gov.uk/apis/printhub-request-api/printhub-request-api-description.html

Authentication

We authenticate with the DVLA API via long-lived JWT tokens. We send a username and password to DVLA's auth server, and they respond with a JWT token that lasts for an hour. We then use that JWT token along with an API key when sending requests to their print server.

The password and API keys are rotated every month. This is done automatically via scheduled tasks and should not need any human intervention.

You can see the DVLA Auth API documentation here: https://developer-portal.driver-vehicle-licensing.api.gov.uk/apis/authentication-api/authentication-api-description.html#first-time-setup-and-usage

Letter timings

Letters are processed by DVLA every working day. They are not printed or processed on weekends or bank holidays.

  • 5:30PM - Cutuff for new letters to be sent the next day.
  • 5:50PM - Collation process starts. The 20 min delay is to allow for any delays in processing letters created before the cutoff.
  • 9:00PM - DVLA start processing 1st class letters.
  • 5:30AM (next day) - DVLA process any remaining 1st class letters, as well as all other letters.

A large day of ~150k letters takes about an hour to process (so finishing at ~6:50pm London time)

Response files

When letters have been printed and moved into their staging area ready to go on a truck, DVLA send us a response file (a text file with extenion .rs.txt) to confirm the references, postage, costs etc of every letter they've printed. There are multiple .rs.txt files per day.

These response files are sent via an AWS Transfer FTP server to an s3 bucket - notifications.service.gov.uk-ftp

Automated emails

We use the notify-dvla@ group to send automated messages to DVLA. Using a group means we avoid hard-coding lists of emails elsewhere.

Notes about how this group is setup:

  • Only group members can post, to avoid spammers abusing the group.
    • This is a compromise to support members outside digital.cabinet-office@.
  • Replies go to the author, not the group - not all group members receive email.
    • For Zendesk tickets the reply will become internal note and the replier an additional CC on it.
  • gov.uk.notify@ is a member so it can send a daily email about letter volumes.
    • This member doesn't receive group emails as it's a functional account.
  • support@zendesk is a member so we can CC this group on tickets related to letters.
    • This member doesn't receive group emails as this would create new tickets.
  • notify@ is a member of the group so the whole team can see what's in it.
    • This member doesn't receive emails to avoid spamming the team with emails.

Non-prod environments

Locally, there is no link to DVLA.

On preview and staging we connect to their UAT server. We have separate Notify accounts per environment. DVLA do not normally print or process any files we send on preview or staging, but they can manually if we request (For example if we're testing out new pdf functionality).

Clone this wiki locally