'Apache Superset Rest API get chart screenshot

I want to get a screenshot of the chart on Superset via Rest API, but I can't do that. When I just run quiries, everything goes well, I get good responses. But when I try to get a screenshot through Get using something like this:

curl -X 'GET' \
  'http://localhost:8088/api/v1/chart/132/cache_screenshot/?q=%7B%0A%20%20%22force%22%3A%20true%2C%0A%20%20%22thumb_size%22%3A%20%5B%0A%20%20%20%201000%0A%20%20%5D%2C%0A%20%20%22window_size%22%3A%20%5B%0A%20%20%20%201000%0A%20%20%5D%0A%7D' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MzkwNTAxNTcsIm5iZiI6MTYzOTA1MDE1NywianRpIjoiY2MyMjI5ZDQtNmIwMi00ZTRhLTg1NmItYWQ5MzcyNmFkOWM2IiwiZXhwIjoxNjM5MDUxMDU3LCJpZGVudGl0eSI6MSwiZnJlc2giOnRydWUsInR5cGUiOiJhY2Nlc3MifQ.SlLRk-BHoTzI3zEEzpl4GVGpUFQRlStT4-Sondnz-pg'

I'm getting error 404:

{
  "message": "Not found"
}

Also, I can't find good documentation about Apache Superset Rest API. Could anybody help my with this issue?



Solution 1:[1]

This is due to the improper configuration of the webdriver. You should check the logs of superset worker. For me the error was:

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

In order to install, you can have a look at the thread: superset screenshot issue

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1