I am attempting to retrieve search results from a Splunk dashboard via REST API but I am unable to identify the correct API endpoint. I have the URL to the Splunk Web UI (port 8000), which does not expose direct API calls , so where can I find the API url.
Rest API is by default exposed at port 8089
curl -k -u admin:pass https://localhost:8089/services/messages \
-d name=sampleMessage \
-d value="This is a sample message."
For all supported methods and functions can refer -
https://help.splunk.com/en/splunk-enterprise/rest-api-reference/10.0/introduction/endpoints-referenc...
Additionally can check out dev.splunk.com as well
What do you mean by "API for dashboards"? What is the problem you're trying to solve?
As @ITWhisperer said - there are enpdoints which return the dashboard definitions, there are endpoints which run the searches. But the dashboard as such is rendered to a "viewable" state by Splunk server and returned as a dynamic HTML page so you cannot - as I suspect you're trying to do - a rendered HTML version of a dashboard by a REST API call.
You can use a tool like Selenium to simulate user session in a browser but I'm not 100% sure it's what you're after.
I am not sure you will find such a thing. There are APIs to retrieve dashboard views and there are APIs to retrieve scheduled searches, etc. But, I am guessing this is not what you are after? What are you trying to do? Perhaps there may be another way to approach it?