Get Dashboard List
OVERVIEW
Overview
Get dashboard list from Publisher.
Requests are made via POST to enable complexity of the request.
Since v5.1
HTTP Request
POST /api/2/dashboard
HTTP Request Object
Dashboard search request object either in JSON or XML format.
HTTP Headers
HTTP Request Header | Description | Example |
---|---|---|
Authorization | The API Authorisation token | "Bearer XXXXXXXXXXXXX" |
Accept |
The format of the expected response.
If no parameter is set, JSON is the default response given. |
"application/xml" |
Content-Type |
The format of the provided content.
If no parameter is set, JSON is the expected content by default. |
"application/json" |
API Accessibility
Access Type | Description |
---|---|
API Token without user parameter | Any user who has API token, can access the API. |
API Token of System Admin with user parameter | If API token is of system admin then 'user' parameter can be passed, allowing to call the API on that user's behalf. |
API Token of user other than System Admin with user parameter |
Not allowed and results in below with response code 400 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
Parameter details
Parameter | Description | Example |
---|---|---|
user | Dashboard list will be filtered based on users permissions. | "user": "ua@mi.com" |
limit | Maximum number of results to fetch. Default value is 30. | "limit": "7" |
offset | Page number. Default value is 0 | "offset": "0" |
search | Search dashboard titles by this keyword | "search": "Home" |
sort |
Allow ascending and descending sorting for a single field
|
"sort": "+alphabetical" |
language | Will return dashboard content in the given language. If language code is not provided, then results will be shown in the user's language set in their user preferences. | "language": "en_US" |
dashboardtype |
Filter results by the dashboard type
|
"dashboardtype":"Events" |
date | Display result based on selected To and From date, with the format YYYYMMDD | "date":{ "from" : "20180101", "to" : "20180101" } |
Example HTTP Request & Response
POST
http://example.com/context/api/2/dashboard
JSON Request
{
"dashboardquery": {
"dashboardtype":"Events",
"date":{
"from" : "20170101",
"to" : "20190228"
}
}
}
JSON Response
{
"total": 243,
"totalcount": 63,
"currentpage": 0,
"dashboard": [
{
"id": 101,
"name": "PD19783_Event_Active_XXMjU",
"createdby": {
"name": "Rishit Patel",
"id": 27
},
"createddate": "06 Feb 2019 14:10",
"modifiedby": {
"name": "Rishit Patel",
"id": 27
},
"lastmodified": "06 Feb 2019 14:10",
"type": "events",
"status": "active",
"url": "https://example.com/context/pd19783_event_active_xxmju",
"icon": {
"url": "https://example.com/context/images/v4/fileicon/large_default.svg",
"title": "Event",
"class": {
"large": "icon-highq-event-module"
}
}
},
{
"id": 104,
"name": "PD19784_Event_Active_rWUSo",
"createdby": {
"name": "Rishit Patel",
"id": 27
},
"createddate": "06 Feb 2019 14:14",
"modifiedby": {
"name": "Rishit Patel",
"id": 27
},
"lastmodified": "06 Feb 2019 14:14",
"type": "events",
"status": "active",
"url": "https://example.com/context/pd19784_event_active_rwuso",
"icon": {
"url": "https://example.com/context/images/v4/fileicon/large_default.svg",
"title": "Event",
"class": {
"large": "icon-highq-event-module"
}
}
}
]
}
XML Request
<dashboardquery>
<dashboardtype>Events</dashboardtype>
<date>
<from>20170101</from>
<to>20190228</to>
</date>
</dashboardquery>
XML Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dashboardlist>
<total>243</total>
<totalcount>63</totalcount>
<currentpage>0</currentpage>
<dashboard>
<id>101</id>
<name>PD19783_Event_Active_XXMjU</name>
<createdby>
<name>Rishit Patel</name>
<id>27</id>
</createdby>
<createddate>06 Feb 2019 14:10</createddate>
<modifiedby>
<name>Rishit Patel</name>
<id>27</id>
</modifiedby>
<lastmodified>06 Feb 2019 14:10</lastmodified>
<type>events</type>
<status>active</status>
<url>
https://example.com/context/pd19783_event_active_xxmju</url>
<icon>
<url>
https://example.com/context/images/v4/fileicon/large_default.svg</url>
<class>
<large>icon-highq-event-module</large>
</class>
<title>Event</title>
</icon>
</dashboard>
<dashboard>
<id>104</id>
<name>PD19784_Event_Active_rWUSo</name>
<createdby>
<name>Rishit Patel</name>
<id>27</id>
</createdby>
<createddate>06 Feb 2019 14:14</createddate>
<modifiedby>
<name>Rishit Patel</name>
<id>27</id>
</modifiedby>
<lastmodified>06 Feb 2019 14:14</lastmodified>
<type>events</type>
<status>active</status>
<url>
https://example.com/context/pd19784_event_active_rwuso</url>
<icon>
<url>
https://example.com/context/images/v4/fileicon/large_default.svg</url>
<class>
<large>icon-highq-event-module</large>
</class>
<title>Event</title>
</icon>
</dashboard>
</dashboardlist>
Validation Messages
Description | Response | Response Code |
---|---|---|
When 'offset' is negative or not a number. | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>106</ref> <summary>Invalid parameter: offset</summary> </error> |
400 |
When 'limit' is not a positive number. | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>107</ref> <summary>Invalid parameter: limit</summary> </error> |
400 |
When user email passed in 'user' parameter that does not exists | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>108</ref> <summary>The requested user does not exist</summary> </error> |
400 |
When invalid 'language' parameter is passed | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>144</ref> <summary>Invalid parameter: language</summary> </error> |
400 |
When invalid 'sort' parameter is passed | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>79</ref> <summary>Invalid parameter: sort</summary> </error> |
400 |
When 'status' is invalid | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>226</ref> <summary>Invalid parameter: type</summary> </error> |
400 |
When 'dashboardtype' is invalid | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>226</ref> <summary>Invalid parameter: type</summary> </error> |
400 |
When date is added but' from' and 'to' is not provided in request. | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>149</ref> <summary>From and to date is required</summary> </error> |
400 |
When 'from' date is invalid | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>145</ref> <summary>Invalid from date</summary> </error> |
400 |
When 'to' date is invalid | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>146</ref> <summary>Invalid to date</summary> </error> |
400 |
When 'from' date is greater than 'to' date | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <ref>191</ref> <summary>From date should be less than to date</summary> </error> |
400 |
Comments
0 Comments