AlienVault-OTX / OTX-Python-SDK

The Python SDK for AlienVault OTX
Other
358 stars 162 forks source link

Add version method to API and call in OTXv2 init method #59

Open chrisinmtown opened 3 years ago

chrisinmtown commented 3 years ago

New feature request: please extend the API with a method to get the server's version. Also please consider invoking this method in the OTXv2 class init method and log the result at level debug.

In addition to yielding version details, this is a cheap way of testing if the API key is valid before trying to fetch data.

Thanks in advance for considering it.

rustybrooks commented 3 years ago

What do you mean by "the server's version?"

/api/v1/user is a pretty cheap way to check the api key, it'll get "your" basic user data. I believe there's not a corresponding function for this in the SDK, the closest would be get_user(YOUR_USERNAME, detailed=False)