I have a periodic scheduled job that refreshes a dashboard using this HTTP PUT request:
/services/data/v44.0/analytics/dashboards/somedashboardId
Mostly, this works reliably but every so often I get a 403 Forbidden
.
OK, so a turn to the documentation in the Salesforce Reports and Dashboards REST API Developer Guide - Error Codes yields no mention of any 403 and, a sentence says
Dashboard-level error messages are returned in the response header
I dutifully dump out the response header and there's nothing of use there.
Transfer-Encoding=>chunked
X-Content-Type-Options=>nosniff
Date=>Tue, 15 Jan 2019 23:25:00 GMT
X-Robots-Tag=>none
Strict-Transport-Security=>max-age=31536000; includeSubDomains
Cache-Control=>no-cache,must-revalidate,max-age=0,no-store,private
Content-Security-Policy=>upgrade-insecure-requests
Set-Cookie=>BrowserId=DY_BeLonQN25FJCoj7J2kw;Path=/;Domain=.salesforce.com;Expires=Sat, 16-Mar-2019 23:25:00 GMT;Max-Age=5184000
Expires=>Thu, 01 Jan 1970 00:00:00 GMT
X-XSS-Protection=>1; mode=block
Content-Type=>application/json;charset=UTF-8
Sforce-Limit-Info=>api-usage=19067/625000
By chance, I was using Workbench and discover that the error details are in the PUT response body, not response header:
[ {
"errorCode" : "FORBIDDEN",
"message" : "You can't refresh this dashboard more than once in a minute."
} ]
and even worse, the documentation never even mentions this array of {"errorCode": "xxx", "message": "yyy"}
objects
Before I file a doc bug, am I missing some doc reference to this response object?