how to use the rest api to get os specific information such as os version using solarwinds or orion rest API. I'd like to narrow it done to a specific agent if possible.
I don't know what you mean by a specific agent, but this would do the trick. You would have to put in your own basic auth hash instead of mine:
curl -X POST 'localhost:17778/.../Query' -H 'Authorization: Basic YourHashGoesHere' -H 'Content-Type: application/json' -d '{ "query": "SELECT Caption, MachineType FROM Orion.Nodes" }' -k