Hello,
I am trying to query table.json via the API. Using Postman or curl my results look great.
https://x.y.z/api/table.json?content=devices&columns=device,host,tags&output=json&filter_tags=@tag(IOS,NXOS,DNOS,FTOS,FortiOS,EtherHaul,SonicOS,AirFiber)&filter_type=@sub(device)&sortby=name&username=YYYY&passhash=xxxxxxxx&filter_status=3&filter_status=4
Do API responses send data back using zlib/deflate?
The application I am trying to integrate with (Oxidizer) keeps thinking the PRTG response is zlib compressed; however, fails to decompress the data correctly.
Thank you kindly
Article Comments
Hello Moritz,
Thank you for the reply.
Yes, when I query the API with the "deflate" header set in my query, the returned data does not appear to be encoded correctly (I am unable to uncompress the data as I would expect).
Below is an example to illustrate what I'm trying to communicate.
curl -H "Accept-Encoding: gzip, deflate, identity" "https://xyz/api/table.json?content=devices&columns=device,host,tags&output=json&filter_tags=@tag(IOS,NXOS,DNOS,FTOS,FortiOS,EtherHaul,SonicOS,AirFiber)&filter_type=@sub(device)&sortby=name&username=oxidizer&passhash=xxxxxxxx&filter_status=3&filter_status=4" -k > test $ zlib-flate -uncompress < test flate: inflate: data: incorrect header check
If I do the same query without specifying 'deflate" the results are returned uncompressed and as expected.
The author of the other application I am integrating against has suggested that I contact Paessler to verify there are no known bugs with how the returned data is compressed using 'deflate'.
In addition, for my own sanity in getting this working, is there a flag I can set in a PRTG config file to disable support for 'deflate compression' similar as to how I would in other web servers such as nginx/apache/etc?
Kind regards,
Jan, 2020 - Permalink
Hi tlister,
Thank you for the update.
I talked with a colleague and he mentioned that "deflate" is only used when the other side accepts "deflate".
Jan, 2020 - Permalink
Hi Moritz,
Either forum is fine; however, in the interest of someone else having a similar issue as me, I'd like this info to remain public.
Regarding the returned compressed 'deflate' data. The reason I'm opening this ticket is because I believe the data being returned by the PRTG API is not compressed correctly when I set "deflate" on my query.
When I try to uncompress the results of my query (with multiple tools, one example is in my previous message) I am given the same error of "incorrect header check". I and others I have been working with believe PRTG may not be compressing the data correctly.
I would just like to confirm that there are no known issues with the PRTG API when using gzip compression (deflate).
Thanks,
Jan, 2020 - Permalink
Hi tlister,
Thank you for the information.
I talked with the developer and received the information that the "deflate" version is not the latest one. Therefore, it's possible that "deflate" is not correctly recognized.
Jan, 2020 - Permalink
Hi tlister,
If you use the JSON output, the content is encoded by "deflate". You can also check this via the developer tools of your browser (network tab)-
Jan, 2020 - Permalink