Update dashboard widget
curl --request PUT \
--url https://app.azalt.co/api/v1/widgets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dashboardId": "<string>",
"reportSectionId": "<string>",
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"name": "<string>",
"filter": {
"siteIds": [
"<string>"
],
"startYear": 123,
"endYear": 123,
"startDate": "<string>",
"endDate": "<string>",
"statuses": []
},
"indicatorId": "<string>",
"settings": {
"showTitle": true,
"indicatorDatasetMappings": {},
"decimalPlaces": 123,
"showNumbers": true,
"showIndicatorName": true,
"angle": 123,
"decomposeAdditiveKpi": true,
"siteGroups": [
{
"id": "<string>",
"name": "<string>",
"siteIds": [
"<string>"
]
}
],
"siteGroupIds": [
"<string>"
],
"selectedTargetEntries": [
"<string>"
],
"showTargets": true,
"showIndividualTargetLines": true,
"showContributionShares": true,
"displayUnitId": "<string>",
"showGlobalAggregateLines": true,
"showGlobalAggregateAverageLine": true,
"globalAggregateTotalLabel": "<string>",
"globalAggregateAverageLabel": "<string>",
"showPeerAverageLine": true,
"peerAverageLabel": "<string>",
"hideEmptyPeriods": true,
"useTonBasedReporting": true,
"showFormElements": true,
"content": "<string>"
}
}
'import requests
url = "https://app.azalt.co/api/v1/widgets/{id}"
payload = {
"dashboardId": "<string>",
"reportSectionId": "<string>",
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"name": "<string>",
"filter": {
"siteIds": ["<string>"],
"startYear": 123,
"endYear": 123,
"startDate": "<string>",
"endDate": "<string>",
"statuses": []
},
"indicatorId": "<string>",
"settings": {
"showTitle": True,
"indicatorDatasetMappings": {},
"decimalPlaces": 123,
"showNumbers": True,
"showIndicatorName": True,
"angle": 123,
"decomposeAdditiveKpi": True,
"siteGroups": [
{
"id": "<string>",
"name": "<string>",
"siteIds": ["<string>"]
}
],
"siteGroupIds": ["<string>"],
"selectedTargetEntries": ["<string>"],
"showTargets": True,
"showIndividualTargetLines": True,
"showContributionShares": True,
"displayUnitId": "<string>",
"showGlobalAggregateLines": True,
"showGlobalAggregateAverageLine": True,
"globalAggregateTotalLabel": "<string>",
"globalAggregateAverageLabel": "<string>",
"showPeerAverageLine": True,
"peerAverageLabel": "<string>",
"hideEmptyPeriods": True,
"useTonBasedReporting": True,
"showFormElements": True,
"content": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dashboardId: '<string>',
reportSectionId: '<string>',
x: 123,
y: 123,
w: 123,
h: 123,
name: '<string>',
filter: {
siteIds: ['<string>'],
startYear: 123,
endYear: 123,
startDate: '<string>',
endDate: '<string>',
statuses: []
},
indicatorId: '<string>',
settings: {
showTitle: true,
indicatorDatasetMappings: {},
decimalPlaces: 123,
showNumbers: true,
showIndicatorName: true,
angle: 123,
decomposeAdditiveKpi: true,
siteGroups: [{id: '<string>', name: '<string>', siteIds: ['<string>']}],
siteGroupIds: ['<string>'],
selectedTargetEntries: ['<string>'],
showTargets: true,
showIndividualTargetLines: true,
showContributionShares: true,
displayUnitId: '<string>',
showGlobalAggregateLines: true,
showGlobalAggregateAverageLine: true,
globalAggregateTotalLabel: '<string>',
globalAggregateAverageLabel: '<string>',
showPeerAverageLine: true,
peerAverageLabel: '<string>',
hideEmptyPeriods: true,
useTonBasedReporting: true,
showFormElements: true,
content: '<string>'
}
})
};
fetch('https://app.azalt.co/api/v1/widgets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.azalt.co/api/v1/widgets/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dashboardId' => '<string>',
'reportSectionId' => '<string>',
'x' => 123,
'y' => 123,
'w' => 123,
'h' => 123,
'name' => '<string>',
'filter' => [
'siteIds' => [
'<string>'
],
'startYear' => 123,
'endYear' => 123,
'startDate' => '<string>',
'endDate' => '<string>',
'statuses' => [
]
],
'indicatorId' => '<string>',
'settings' => [
'showTitle' => true,
'indicatorDatasetMappings' => [
],
'decimalPlaces' => 123,
'showNumbers' => true,
'showIndicatorName' => true,
'angle' => 123,
'decomposeAdditiveKpi' => true,
'siteGroups' => [
[
'id' => '<string>',
'name' => '<string>',
'siteIds' => [
'<string>'
]
]
],
'siteGroupIds' => [
'<string>'
],
'selectedTargetEntries' => [
'<string>'
],
'showTargets' => true,
'showIndividualTargetLines' => true,
'showContributionShares' => true,
'displayUnitId' => '<string>',
'showGlobalAggregateLines' => true,
'showGlobalAggregateAverageLine' => true,
'globalAggregateTotalLabel' => '<string>',
'globalAggregateAverageLabel' => '<string>',
'showPeerAverageLine' => true,
'peerAverageLabel' => '<string>',
'hideEmptyPeriods' => true,
'useTonBasedReporting' => true,
'showFormElements' => true,
'content' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.azalt.co/api/v1/widgets/{id}"
payload := strings.NewReader("{\n \"dashboardId\": \"<string>\",\n \"reportSectionId\": \"<string>\",\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"name\": \"<string>\",\n \"filter\": {\n \"siteIds\": [\n \"<string>\"\n ],\n \"startYear\": 123,\n \"endYear\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"statuses\": []\n },\n \"indicatorId\": \"<string>\",\n \"settings\": {\n \"showTitle\": true,\n \"indicatorDatasetMappings\": {},\n \"decimalPlaces\": 123,\n \"showNumbers\": true,\n \"showIndicatorName\": true,\n \"angle\": 123,\n \"decomposeAdditiveKpi\": true,\n \"siteGroups\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ]\n }\n ],\n \"siteGroupIds\": [\n \"<string>\"\n ],\n \"selectedTargetEntries\": [\n \"<string>\"\n ],\n \"showTargets\": true,\n \"showIndividualTargetLines\": true,\n \"showContributionShares\": true,\n \"displayUnitId\": \"<string>\",\n \"showGlobalAggregateLines\": true,\n \"showGlobalAggregateAverageLine\": true,\n \"globalAggregateTotalLabel\": \"<string>\",\n \"globalAggregateAverageLabel\": \"<string>\",\n \"showPeerAverageLine\": true,\n \"peerAverageLabel\": \"<string>\",\n \"hideEmptyPeriods\": true,\n \"useTonBasedReporting\": true,\n \"showFormElements\": true,\n \"content\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.azalt.co/api/v1/widgets/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dashboardId\": \"<string>\",\n \"reportSectionId\": \"<string>\",\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"name\": \"<string>\",\n \"filter\": {\n \"siteIds\": [\n \"<string>\"\n ],\n \"startYear\": 123,\n \"endYear\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"statuses\": []\n },\n \"indicatorId\": \"<string>\",\n \"settings\": {\n \"showTitle\": true,\n \"indicatorDatasetMappings\": {},\n \"decimalPlaces\": 123,\n \"showNumbers\": true,\n \"showIndicatorName\": true,\n \"angle\": 123,\n \"decomposeAdditiveKpi\": true,\n \"siteGroups\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ]\n }\n ],\n \"siteGroupIds\": [\n \"<string>\"\n ],\n \"selectedTargetEntries\": [\n \"<string>\"\n ],\n \"showTargets\": true,\n \"showIndividualTargetLines\": true,\n \"showContributionShares\": true,\n \"displayUnitId\": \"<string>\",\n \"showGlobalAggregateLines\": true,\n \"showGlobalAggregateAverageLine\": true,\n \"globalAggregateTotalLabel\": \"<string>\",\n \"globalAggregateAverageLabel\": \"<string>\",\n \"showPeerAverageLine\": true,\n \"peerAverageLabel\": \"<string>\",\n \"hideEmptyPeriods\": true,\n \"useTonBasedReporting\": true,\n \"showFormElements\": true,\n \"content\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/widgets/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboardId\": \"<string>\",\n \"reportSectionId\": \"<string>\",\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"name\": \"<string>\",\n \"filter\": {\n \"siteIds\": [\n \"<string>\"\n ],\n \"startYear\": 123,\n \"endYear\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"statuses\": []\n },\n \"indicatorId\": \"<string>\",\n \"settings\": {\n \"showTitle\": true,\n \"indicatorDatasetMappings\": {},\n \"decimalPlaces\": 123,\n \"showNumbers\": true,\n \"showIndicatorName\": true,\n \"angle\": 123,\n \"decomposeAdditiveKpi\": true,\n \"siteGroups\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ]\n }\n ],\n \"siteGroupIds\": [\n \"<string>\"\n ],\n \"selectedTargetEntries\": [\n \"<string>\"\n ],\n \"showTargets\": true,\n \"showIndividualTargetLines\": true,\n \"showContributionShares\": true,\n \"displayUnitId\": \"<string>\",\n \"showGlobalAggregateLines\": true,\n \"showGlobalAggregateAverageLine\": true,\n \"globalAggregateTotalLabel\": \"<string>\",\n \"globalAggregateAverageLabel\": \"<string>\",\n \"showPeerAverageLine\": true,\n \"peerAverageLabel\": \"<string>\",\n \"hideEmptyPeriods\": true,\n \"useTonBasedReporting\": true,\n \"showFormElements\": true,\n \"content\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"dashboardId": "<string>",
"reportSectionId": "<string>",
"relatedModelType": "<string>",
"relatedModelId": "<string>",
"name": "<string>",
"indicatorId": "<string>",
"indicatorName": "<string>",
"indicatorLabel": "<string>",
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"settings": {},
"filter": {
"siteIds": [
"<string>"
],
"startYear": 123,
"endYear": 123,
"startDate": "<string>",
"endDate": "<string>",
"statuses": []
}
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Widget
Update dashboard widget
Update a dashboard widget:
Required Fields:
id: Widget ID to update
Optional Fields:
x,y,w,h: Move or resize the widgetname: New widget nametype: Change visualization typefilter: Unified dashboard filter (sites, years, statuses)settings: Advanced options like:- Custom dataset mappings
- Number formatting and decimal places
- Aggregation methods (sum, average, etc.)
- Chart colors and grouping options
Access Requirements:
- Manager permissions or higher required
- Must be in the dashboard’s organization
PUT
/
widgets
/
{id}
Update dashboard widget
curl --request PUT \
--url https://app.azalt.co/api/v1/widgets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dashboardId": "<string>",
"reportSectionId": "<string>",
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"name": "<string>",
"filter": {
"siteIds": [
"<string>"
],
"startYear": 123,
"endYear": 123,
"startDate": "<string>",
"endDate": "<string>",
"statuses": []
},
"indicatorId": "<string>",
"settings": {
"showTitle": true,
"indicatorDatasetMappings": {},
"decimalPlaces": 123,
"showNumbers": true,
"showIndicatorName": true,
"angle": 123,
"decomposeAdditiveKpi": true,
"siteGroups": [
{
"id": "<string>",
"name": "<string>",
"siteIds": [
"<string>"
]
}
],
"siteGroupIds": [
"<string>"
],
"selectedTargetEntries": [
"<string>"
],
"showTargets": true,
"showIndividualTargetLines": true,
"showContributionShares": true,
"displayUnitId": "<string>",
"showGlobalAggregateLines": true,
"showGlobalAggregateAverageLine": true,
"globalAggregateTotalLabel": "<string>",
"globalAggregateAverageLabel": "<string>",
"showPeerAverageLine": true,
"peerAverageLabel": "<string>",
"hideEmptyPeriods": true,
"useTonBasedReporting": true,
"showFormElements": true,
"content": "<string>"
}
}
'import requests
url = "https://app.azalt.co/api/v1/widgets/{id}"
payload = {
"dashboardId": "<string>",
"reportSectionId": "<string>",
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"name": "<string>",
"filter": {
"siteIds": ["<string>"],
"startYear": 123,
"endYear": 123,
"startDate": "<string>",
"endDate": "<string>",
"statuses": []
},
"indicatorId": "<string>",
"settings": {
"showTitle": True,
"indicatorDatasetMappings": {},
"decimalPlaces": 123,
"showNumbers": True,
"showIndicatorName": True,
"angle": 123,
"decomposeAdditiveKpi": True,
"siteGroups": [
{
"id": "<string>",
"name": "<string>",
"siteIds": ["<string>"]
}
],
"siteGroupIds": ["<string>"],
"selectedTargetEntries": ["<string>"],
"showTargets": True,
"showIndividualTargetLines": True,
"showContributionShares": True,
"displayUnitId": "<string>",
"showGlobalAggregateLines": True,
"showGlobalAggregateAverageLine": True,
"globalAggregateTotalLabel": "<string>",
"globalAggregateAverageLabel": "<string>",
"showPeerAverageLine": True,
"peerAverageLabel": "<string>",
"hideEmptyPeriods": True,
"useTonBasedReporting": True,
"showFormElements": True,
"content": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dashboardId: '<string>',
reportSectionId: '<string>',
x: 123,
y: 123,
w: 123,
h: 123,
name: '<string>',
filter: {
siteIds: ['<string>'],
startYear: 123,
endYear: 123,
startDate: '<string>',
endDate: '<string>',
statuses: []
},
indicatorId: '<string>',
settings: {
showTitle: true,
indicatorDatasetMappings: {},
decimalPlaces: 123,
showNumbers: true,
showIndicatorName: true,
angle: 123,
decomposeAdditiveKpi: true,
siteGroups: [{id: '<string>', name: '<string>', siteIds: ['<string>']}],
siteGroupIds: ['<string>'],
selectedTargetEntries: ['<string>'],
showTargets: true,
showIndividualTargetLines: true,
showContributionShares: true,
displayUnitId: '<string>',
showGlobalAggregateLines: true,
showGlobalAggregateAverageLine: true,
globalAggregateTotalLabel: '<string>',
globalAggregateAverageLabel: '<string>',
showPeerAverageLine: true,
peerAverageLabel: '<string>',
hideEmptyPeriods: true,
useTonBasedReporting: true,
showFormElements: true,
content: '<string>'
}
})
};
fetch('https://app.azalt.co/api/v1/widgets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.azalt.co/api/v1/widgets/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dashboardId' => '<string>',
'reportSectionId' => '<string>',
'x' => 123,
'y' => 123,
'w' => 123,
'h' => 123,
'name' => '<string>',
'filter' => [
'siteIds' => [
'<string>'
],
'startYear' => 123,
'endYear' => 123,
'startDate' => '<string>',
'endDate' => '<string>',
'statuses' => [
]
],
'indicatorId' => '<string>',
'settings' => [
'showTitle' => true,
'indicatorDatasetMappings' => [
],
'decimalPlaces' => 123,
'showNumbers' => true,
'showIndicatorName' => true,
'angle' => 123,
'decomposeAdditiveKpi' => true,
'siteGroups' => [
[
'id' => '<string>',
'name' => '<string>',
'siteIds' => [
'<string>'
]
]
],
'siteGroupIds' => [
'<string>'
],
'selectedTargetEntries' => [
'<string>'
],
'showTargets' => true,
'showIndividualTargetLines' => true,
'showContributionShares' => true,
'displayUnitId' => '<string>',
'showGlobalAggregateLines' => true,
'showGlobalAggregateAverageLine' => true,
'globalAggregateTotalLabel' => '<string>',
'globalAggregateAverageLabel' => '<string>',
'showPeerAverageLine' => true,
'peerAverageLabel' => '<string>',
'hideEmptyPeriods' => true,
'useTonBasedReporting' => true,
'showFormElements' => true,
'content' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.azalt.co/api/v1/widgets/{id}"
payload := strings.NewReader("{\n \"dashboardId\": \"<string>\",\n \"reportSectionId\": \"<string>\",\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"name\": \"<string>\",\n \"filter\": {\n \"siteIds\": [\n \"<string>\"\n ],\n \"startYear\": 123,\n \"endYear\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"statuses\": []\n },\n \"indicatorId\": \"<string>\",\n \"settings\": {\n \"showTitle\": true,\n \"indicatorDatasetMappings\": {},\n \"decimalPlaces\": 123,\n \"showNumbers\": true,\n \"showIndicatorName\": true,\n \"angle\": 123,\n \"decomposeAdditiveKpi\": true,\n \"siteGroups\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ]\n }\n ],\n \"siteGroupIds\": [\n \"<string>\"\n ],\n \"selectedTargetEntries\": [\n \"<string>\"\n ],\n \"showTargets\": true,\n \"showIndividualTargetLines\": true,\n \"showContributionShares\": true,\n \"displayUnitId\": \"<string>\",\n \"showGlobalAggregateLines\": true,\n \"showGlobalAggregateAverageLine\": true,\n \"globalAggregateTotalLabel\": \"<string>\",\n \"globalAggregateAverageLabel\": \"<string>\",\n \"showPeerAverageLine\": true,\n \"peerAverageLabel\": \"<string>\",\n \"hideEmptyPeriods\": true,\n \"useTonBasedReporting\": true,\n \"showFormElements\": true,\n \"content\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.azalt.co/api/v1/widgets/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dashboardId\": \"<string>\",\n \"reportSectionId\": \"<string>\",\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"name\": \"<string>\",\n \"filter\": {\n \"siteIds\": [\n \"<string>\"\n ],\n \"startYear\": 123,\n \"endYear\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"statuses\": []\n },\n \"indicatorId\": \"<string>\",\n \"settings\": {\n \"showTitle\": true,\n \"indicatorDatasetMappings\": {},\n \"decimalPlaces\": 123,\n \"showNumbers\": true,\n \"showIndicatorName\": true,\n \"angle\": 123,\n \"decomposeAdditiveKpi\": true,\n \"siteGroups\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ]\n }\n ],\n \"siteGroupIds\": [\n \"<string>\"\n ],\n \"selectedTargetEntries\": [\n \"<string>\"\n ],\n \"showTargets\": true,\n \"showIndividualTargetLines\": true,\n \"showContributionShares\": true,\n \"displayUnitId\": \"<string>\",\n \"showGlobalAggregateLines\": true,\n \"showGlobalAggregateAverageLine\": true,\n \"globalAggregateTotalLabel\": \"<string>\",\n \"globalAggregateAverageLabel\": \"<string>\",\n \"showPeerAverageLine\": true,\n \"peerAverageLabel\": \"<string>\",\n \"hideEmptyPeriods\": true,\n \"useTonBasedReporting\": true,\n \"showFormElements\": true,\n \"content\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/widgets/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboardId\": \"<string>\",\n \"reportSectionId\": \"<string>\",\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"name\": \"<string>\",\n \"filter\": {\n \"siteIds\": [\n \"<string>\"\n ],\n \"startYear\": 123,\n \"endYear\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"statuses\": []\n },\n \"indicatorId\": \"<string>\",\n \"settings\": {\n \"showTitle\": true,\n \"indicatorDatasetMappings\": {},\n \"decimalPlaces\": 123,\n \"showNumbers\": true,\n \"showIndicatorName\": true,\n \"angle\": 123,\n \"decomposeAdditiveKpi\": true,\n \"siteGroups\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ]\n }\n ],\n \"siteGroupIds\": [\n \"<string>\"\n ],\n \"selectedTargetEntries\": [\n \"<string>\"\n ],\n \"showTargets\": true,\n \"showIndividualTargetLines\": true,\n \"showContributionShares\": true,\n \"displayUnitId\": \"<string>\",\n \"showGlobalAggregateLines\": true,\n \"showGlobalAggregateAverageLine\": true,\n \"globalAggregateTotalLabel\": \"<string>\",\n \"globalAggregateAverageLabel\": \"<string>\",\n \"showPeerAverageLine\": true,\n \"peerAverageLabel\": \"<string>\",\n \"hideEmptyPeriods\": true,\n \"useTonBasedReporting\": true,\n \"showFormElements\": true,\n \"content\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"dashboardId": "<string>",
"reportSectionId": "<string>",
"relatedModelType": "<string>",
"relatedModelId": "<string>",
"name": "<string>",
"indicatorId": "<string>",
"indicatorName": "<string>",
"indicatorLabel": "<string>",
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"settings": {},
"filter": {
"siteIds": [
"<string>"
],
"startYear": 123,
"endYear": 123,
"startDate": "<string>",
"endDate": "<string>",
"statuses": []
}
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Successful response
Available options:
line_chart, bar_chart, pie_chart, value, table, periodic_values, text Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

