Getting Graphs Through API

I’m successfully able to pull json data through the API, but not any image graphs. I get a status 200 response back and the header information displays a content type of image/png so I think I’m hitting the right URL, but there is no content/image data returned. Here is my URL: http://example.com/api/v0/devices/135/ports/Te1%2F1/port_bits

Works fine for me:

curl -k -H 'X-Auth-Token: TOKEN' 'https:/URL/api/v0/devices/localhost/ports/eth0/port_bits' > /tmp/test.png
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 50307    0 50307    0     0   189k      0 --:--:-- --:--:-- --:--:--  190k
[root@web01 ~]# file /tmp/test.png
/tmp/test.png: PNG image data, 1156 x 397, 8-bit/color RGBA, non-interlaced

I tried again running that same cURL command with my token and DNS same and ended up with a 0KB PNG file, no data. Is there possibly something wrong with the server configuration? I can see the graphs through the web interface, and I do get JSON data returned with just http://example.com/api/v0/devices/135/ports/Te1%2F1. I’m not sure where to go from here with troubleshooting… We do not have https on the server at this time (we’re still in the testing phase), could that be the issue?

I doubt it will be due to the lack of ssl.

Check your web server logs to see if you are getting a 200 http response. Also try it using something like postman so you can see the server response. Really not sure what else to suggest.

I create some scripg for generate statistic graph for day, week, month and year