FileWave Alliance

The Official Community Forum
  • Page:
  • 1

TOPIC: API

API 14 Dec 2017 16:49 #2837

  • Cody Nelson
  • Cody Nelson's Avatar Topic Author
  • Offline
  • 2nd Level - Yellow Belt
  • 2nd Level - Yellow Belt
  • Posts: 17
  • Thank you received: 0
Does the API still work? I'm following the guide and I get "No JSON object could be decoded" when I execute

curl -s -k -H "Authorization: base64 string" https://fwserver:20446/inv/api/v1/query | python -mjson.tool

Thanks.

API 14 Dec 2017 18:02 #2838

  • Dave Herder
  • Dave Herder's Avatar
  • Offline
  • FileWave Staff
  • FileWave Staff
  • Posts: 39
  • Karma: 2
  • Thank you received: 2
Assuming that you have the correct authorization string (base 64 encoded inventory shared key) and the correct server fqdn defined, the "No JSON object could be decoded" message could be due to lack of a trailing slash at the end of the query call.

Try:
curl -s -k -H "Authorization: <insert your base64 encoded shared key>" https://<your fwserver fqdn>:20443/inv/api/v1/query/ | python -mjson.tool
Last Edit: by Dave Herder.

API 14 Dec 2017 19:19 #2839

  • Cody Nelson
  • Cody Nelson's Avatar Topic Author
  • Offline
  • 2nd Level - Yellow Belt
  • 2nd Level - Yellow Belt
  • Posts: 17
  • Thank you received: 0
Ok. I added the trailing / and changed the port to 20443 and I get

{
"detail": "Authentication credentials were not provided."
}

API 14 Dec 2017 19:44 #2840

  • Dave Herder
  • Dave Herder's Avatar
  • Offline
  • FileWave Staff
  • FileWave Staff
  • Posts: 39
  • Karma: 2
  • Thank you received: 2
when you grabbed the shared key, did you get it from the Admin> Preferences> Inventory tab?

when you encoded this value to Base64, did you include the {}? Include the {} when encoding the string. For example:

shared key from inventory: {07502837-da73-458a-8e80-e358d7bfa1fd}

Base64 encoding: ezA3NTAyODM3LWRhNzMtNDU4YS04ZTgwLWUzNThkN2JmYTFmZH0=

API 14 Dec 2017 20:54 #2841

  • Cody Nelson
  • Cody Nelson's Avatar Topic Author
  • Offline
  • 2nd Level - Yellow Belt
  • 2nd Level - Yellow Belt
  • Posts: 17
  • Thank you received: 0
I did not include the {}. That worked, thanks.

I was hoping there was a way to query the version of the server, but I don't see anything.

API 14 Dec 2017 22:07 #2842

  • Dave Herder
  • Dave Herder's Avatar
  • Offline
  • FileWave Staff
  • FileWave Staff
  • Posts: 39
  • Karma: 2
  • Thank you received: 2
do you mean the version of the FileWave server or are you looking to query the OS version of various servers?

API 14 Dec 2017 22:12 #2843

  • Cody Nelson
  • Cody Nelson's Avatar Topic Author
  • Offline
  • 2nd Level - Yellow Belt
  • 2nd Level - Yellow Belt
  • Posts: 17
  • Thank you received: 0
The version of the Filewave server.

API 14 Dec 2017 22:15 #2844

  • Dave Herder
  • Dave Herder's Avatar
  • Offline
  • FileWave Staff
  • FileWave Staff
  • Posts: 39
  • Karma: 2
  • Thank you received: 2
If your server is running on Windows or macOS, and has the client on it reporting inventory, you can create a query like this:





If your server is running on Linux, then of course the inventory would not be taken because there is no client running :(

dave.
Attachments:
  • Page:
  • 1