What type of application are you building?
Those "100s of APIs", are they developed in-house? Do you have access to their source code?
Could you give us a clue to why and how the solution you are searching should be applied to literally hundreds of APIs - are you (or your employer) actually developing (implementations for) hundreds of APIs that should use the same validation?
In these hundreds of APIs, could you give some hint to what kind of datatypes and attributes you will find?
Would it be an option to return to your superior and say: "I am convinced that it is a poor idea to make one super-general validation function for every possible data type and attribute in several hundred APIs. I suggest that we don't do that!" ?
... Noone here believes that your problem statement comes from a real-world software developments project. It shines bright and clear that this is an exercize given at a college or other educational institution.
So be honest with it: The professor has given us this assignment, and I here is what I have written to return the attribute name ("id") and value ("12345"): [...]. But he wants it to valid for "any datatype" - I don't understand what he means typ that; it comes as a string from the URL. How can it come as some other datatype?"
That would be a valid question that might generate responses. But the way you have presented it, it sounds more like: "I am too busy to do this homework assignment right now, so could someone please provide something for me to hand in?"
If you really are as totally blank as it seems, tell us. Indicate whichever pieces you have understood, if ever so small, and we could try to work it out from there. But be warned that you can only expect to get help to understand things enough to do the homework yourself. You won't get help so that you don't have to do it yourself.