Ok, I think I got it.
Here is my Workflow:
- Add the image widget to the dashboard with a dummy image.
- Get your dashboard ID and save the
c8y_Dashboard
fragment for step 5 (Request) - Upload the new image with this python script.
import requests
url = "https://<tenant>/inventory/binaries"
headers = {
"Authorization": "Basic <Auth>",
"Accept": "application/json"
}
payload = { 'object' : '{ "name" : "image.jpg", "type" : "image/jpeg", "c8y_Global": {} }'}
files = {"file": ("image.jpg", open("image.jpg", "rb"), "image/jpeg") }
response = requests.request("POST", url, headers= headers, data= payload, files= files)
print(response.text.encode("utf8"))