WordPress include contents of ajax in submitted message

I’m a beginner with WordPress, the interface is really simple and user friendly. However I don’t know how to approach in inserting some code.
For example, I have a contact page where the visitor inputs his vehicle registration plate number, but I would like to automatically validate the plate number with a JSON request to a REST api, and the returned data to be added to the message. If it were a simple PHP page I would have managed it easily. Should I put my gloves on and get dirty with the WordPress files ? Or is it easier than I imagine ?
Thank you

Related posts