Hi,
I am trying to use the download tool to retrieve data regarding car details. The DVLA example is below.
Any help with configuring the download tool would be great.
Requests
To call the API, make a HTTP POST request to the following URL:
https://driver-vehicle-licensing.api.gov.uk/vehicle-enquiry/v1/vehicles
and include the following in the request body:
{ "registrationNumber": "TE57VRN" }
You must also include a mandatory x-api-key header with each request you send. This must contain the API key which you have been issued with.
For example, using cURL, a request can be made as follows:
curl -L -X POST 'https://driver-vehicle-licensing.api.gov.uk/vehicle-enquiry/v1/vehicles' \ -H 'x-api-key: REPLACE WITH YOUR API KEY' \ -H 'Content-Type: application/json' \ -d '{"registrationNumber": "TE57VRN"}'
OWASP security guidelines dictate that sensitive information should not be included in URLs. This reduces the risk of sensitive information being unnecessarily recorded in Web Server logs. The vehicle registration number is deemed sensitive information in accordance with the Information Commissioner’s Office (ICO), so is passed in the body as a POST request.
Solved! Go to Solution.
hey @Davonalt
The download tool is quite simple to convert your api query from.
I'll try to help break it down:
The URL
https://driver-vehicle-licensing.api.gov.uk/vehicle-enquiry/v1/vehicle
wants to be supplied to the tool via a text input tool:
Headers:
-H 'x-api-key: REPLACE WITH YOUR API KEY' \ -H 'Content-Type: application/json' \
Can be applied in the 'headers' tab of the download tool:
and the data
-d '{"registrationNumber": "TE57VRN"}'
You should be able to supply in the payload tab:
Just make sure you set the query type at the top to 'POST'.
Hope this helps,
TheOC
Thank you so much. However i do have an error message.
{"errors":[{"status":"400","code":"ENQ103","title":"Bad Request","detail":"Invalid format for field - vehicle registration number"}]}
Any ideas?
Thank you so much. However i do have an error message.
{"errors":[{"status":"400","code":"ENQ103","title":"Bad Request","detail":"Invalid format for field - vehicle registration number"}]}
Any ideas?
hey @Davonalt
Apologies, hard one to troubleshoot because i dont have access to the api. However, you may want another field in the text input as "Payload", and have the text as:
"registrationNumber": "TE57VRN"
You can then supply this as the payload in the download tool instead (be sure to delete the previous record, so it will look like):
Hopefully this helps, and again attached for your benefit 🙂
Cheers,
TheOC
Hi
Thanks so much again.
Just for your information the text that worked was
{"registrationNumber": "TE57VRN"}
Hi @Davonalt
Are you able to publish your working version?
I'm having the same issue you were getting, and haven't been able to get it working.
Thanks
What is the problem? I will try to help.
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |