I’m trying to add an annotation to a panel vie the api, but it doesn’t seem to be working. I must be doing something wrong but can’t figure out what:
[nav] In [42]: headers
Out[42]: {'Authorization': 'Bearer eyJrIjoiRUJpNXdNS1pWVDFRR1AyczdjYzVxT1hOTXAyMHM4aGoiLCJuIjoiamFrb2ItYW5ub3RhdGUiLCJpZCI6MX0='}
[ins] In [43]: data = {
...: "dashboardId": 12,
...: "panelId": 2,
...: "time":1583398712873,
...: "timeEnd": 1583398712873,
...: "tags": ["test", "test2"],
...: "text": "something",
...: }
...:
[nav] In [44]: response = requests.post(
...: base_url, headers=headers, data=data
...: ).json()
...:
[ins] In [45]: response
Out[45]: {'id': 792, 'message': 'Annotation added'}
This then appears when I query the same api:
{'id': 792,
'alertId': 0,
'alertName': '',
'dashboardId': 0,
'panelId': 0,
'userId': 0,
'newState': '',
'prevState': '',
'created': 1583406144169,
'updated': 1583406144169,
'time': 1583398712873,
'timeEnd': 1583398712873,
'text': 'something',
'tags': ['test', 'test2'],
'login': '',
'email': '',
'avatarUrl': '',
'data': {}}]
I must be doing something wrong, but as you can see the dashboardId is not being set and neither is the panelid.
The dashboard and the panel both exist. This is a manually added annotation:
{'id': 760,
'alertId': 0,
'alertName': '',
'dashboardId': 12,
'panelId': 2,
'userId': 0,
...