Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

DVLA AIP

Davonalt
7 - Meteor

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.

10 REPLIES 10
TheOC
15 - Aurora
15 - Aurora

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:

TheOC_0-1638960674295.png



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:

TheOC_1-1638960701944.png



and the data

-d '{"registrationNumber": "TE57VRN"}'

You should be able to supply in the payload tab:

TheOC_2-1638961010321.png



Just make sure you set the query type at the top to 'POST'.

Hope this helps,
TheOC

 

 


Bulien
TheOC
15 - Aurora
15 - Aurora

Sorry - Attached is the workflow, you will need to add your api key etc.

 

Cheers,
TheOC


Bulien
Davonalt
7 - Meteor

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?

 

Davonalt
7 - Meteor

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?

TheOC
15 - Aurora
15 - Aurora

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):

TheOC_0-1638964355508.png

 

Hopefully this helps, and again attached for your benefit 🙂 

Cheers,
TheOC


Bulien
Davonalt
7 - Meteor

Hi 

Thanks so much again.

Just for your information the text that worked was 

 

{"registrationNumber": "TE57VRN"}
TheOC
15 - Aurora
15 - Aurora

Glad i could be of help!

Please be sure to mark as solution to help anyone else looking for a similar solution 😁

 

Cheers,
TheOC


Bulien
tomgilbert
5 - Atom

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

Davonalt
7 - Meteor

What is the problem? I will try to help.

Labels