Create a dashboard
Needs: Reports, Read-write
Creates a report dashboard with insight and text cards. Cards go two per row (half width each, metrics and text included) unless you give a position.
curl -X POST "https://app.imploy.com.au/api/integrations/v1/reports/dashboards" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "Weekly ops",
"settings": {
"spacing": "comfortable",
"refresh_minutes": 15
},
"cards": [
{
"insight_id": 31,
"show_title": true
},
{
"text": "Hours are completed shifts only."
}
]
}'
import requests
import json
url = "https://app.imploy.com.au/api/integrations/v1/reports/dashboards"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"name": "Weekly ops",
"settings": {
"spacing": "comfortable",
"refresh_minutes": 15
},
"cards": [
{
"insight_id": 31,
"show_title": true
},
{
"text": "Hours are completed shifts only."
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.imploy.com.au/api/integrations/v1/reports/dashboards", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"name": "Weekly ops",
"settings": {
"spacing": "comfortable",
"refresh_minutes": 15
},
"cards": [
{
"insight_id": 31,
"show_title": true
},
{
"text": "Hours are completed shifts only."
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "Weekly ops",
"settings": {
"spacing": "comfortable",
"refresh_minutes": 15
},
"cards": [
{
"insight_id": 31,
"show_title": true
},
{
"text": "Hours are completed shifts only."
}
]
}`)
req, err := http.NewRequest("POST", "https://app.imploy.com.au/api/integrations/v1/reports/dashboards", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.imploy.com.au/api/integrations/v1/reports/dashboards')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"name": "Weekly ops",
"settings": {
"spacing": "comfortable",
"refresh_minutes": 15
},
"cards": [
{
"insight_id": 31,
"show_title": true
},
{
"text": "Hours are completed shifts only."
}
]
}'
response = http.request(request)
puts response.body
{
"created": 6,
"...": "the dashboard, its link and cards"
}
{
"message": "Invalid or expired access token."
}
{
"message": "Access token does not permit this action."
}
{
"message": "Too many requests."
}
/reports/dashboards
Target server for requests. Edit to use your own host.
An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
imp_at_. Send it as Authorization: Bearer imp_at_XXXX.The media type of the request body
The dashboard name.
What it shows.
spacing (compact, comfortable or spacious), show_card_headers, auto_layout, auto_save and refresh_minutes (0, 5, 10, 15 or 30).
Cards in order. Each is {insight_id} or {text}, with optional show_title, show_description and position. A position is {col, row, width, height} on a 36-column grid, and is only needed for a different size or spot.
Put it in this space.
A subfolder within space_id.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
Body
The dashboard name.
What it shows.
spacing (compact, comfortable or spacious), show_card_headers, auto_layout, auto_save and refresh_minutes (0, 5, 10, 15 or 30).
Cards in order. Each is {insight_id} or {text}, with optional show_title, show_description and position. A position is {col, row, width, height} on a 36-column grid, and is only needed for a different size or spot.
Put it in this space.
A subfolder within space_id.