SolarWinds Observability SaaS GraphQL API
The SolarWinds Observability API is available as a GraphQL-style API, granting access to some Digital Experience or database information. To interact with the API, issue a POST request to the API URL. The JSON-formatted request body must include a query
field that contains a string representing the query or change (called mutations in GraphQL) that you want to make.
See Queries and Mutations in GraphQL documentation.
The response to the submitted query is returned in a JSON-format, containing the requested data in a structure similar to the original query.
API URLs
The API can be accessed at the URL https://api.xx-yy.cloud.solarwinds.com/graphql
, where xx-yy
matches your organization's data center, see Data centers and endpoint URIs.
Example queries
To retrieve DEM probes, use the following GraphQL query.
query getDemProbes {
dem {
probes {
name
region
platform
}
}
}
To send the getDemProbes
query to the API server, use the following JSON-formatted POST request body. The optional operationName
field is useful when instrumenting your client calls to the API.
{
"operationName": "getDemProbes",
"query": "query getDemProbes {\n dem {\n probes {\n name\n region\n platform\n }\n }\n}\n"
}
A sample response to the getDemProbes
POST request is shown below.
{
"data": {
"dem": {
"probes": [
{
"name": "Boston1",
"region": "NA",
"platform": "AWS"
},
{
"name": "Los Angeles",
"region": "NA",
"platform": "AWS"
}
]
}
}
}
How to access the API
Create an API Token
An API Access token type is required to access the API. You will not be able to copy your API Access token later, so consider saving the copied token to a safe place.
Call the API
With the API token you can call the API by making POST requests to the API URL. Pass the token in the Authorization
header using the Bearer
scheme.
The following example passes the sample API token ABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123ab
Authorization: Bearer ABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123ab
The following example curl request sends the getDemProbes
query with the same sample API token to the API URL endpoint for an organization on the na-01 data center.
curl -H "Author
i
zation: Bearer ABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123ab" https://api.na-01.cloud.solarwinds.com/graphql -d '{"query": "query getDemProbes {\n dem {\n probes {\n name\n region\n platform\n }\n }\n}\n"}'
View the documentation
Documentation for the API can be found by opening the API URL in your browser. The SolarWinds Observability API page includes:
- the API schema, available in the Docs tab
- a playground to issue sample queries
Add the API token to the page
To see the schema or issue sample queries, the API Access token created earlier must be added to the SolarWinds Observability API page.
- Click HTTP Headers in the lower-left corner of the page.
-
Enter the Authorization header, replacing
YourApiToken
with the API token created earlier.{"Authorization": "Bearer YourApiToken"}
Once a valid header is entered, the SolarWinds Observability API page will load the schema and the response pane on the right will update with instructions for issuing sample queries.
Click Docs in the tabs on the right to browse or search the schema. The schema details the types available in the API.
Enter sample queries in the queries pane on the left and click the Play button to see the responses in the pane on the right.