How to add a Web API provider
What are Integrations?
Dashboard Server Integrations allow you to create your own providers. Each Integration has it's own form to help you input the information required for different providers.
What is a provider?
Providers contain the connection details to external platforms. A provider only needs to be set up once and can then be used when creating tiles on a dashboard.
There are two types of integrations and therefore providers:
generic Web API providers that can connect to any REST API
dedicated providers that connect to a specific external platform or database (SQL, ServiceNow, Azure Active App Insights, Elasticsearch, etc.)
About Web API providers
The Web API integration allows you to create Web API providers. A Web API provider is a generic provider that contains the connection details to any REST API that returns JSON.
Which Integrations can I use for Web API tiles?
You can use generic and dedicated integrations to create your own providers. Of course, a dedicated provider like ServiceNow will only work with the ServiceNow API.
You need to have at least one provider before you can use Web API tiles (see How to use the Web API tile).
Generic Web API providers
Simple | No authentication, basic authentication (username and password in a header) or Windows authentication (configured automatically to use the application pool identity account). |
Basic auth | Basic authentication. Your specified username and password will be Base64 encoded automatically. |
OAuth | Token-based authentication according to the OAuth 2.0 standard. Many APIs use OAuth 2.0 for authorization, and will require an OAuth provider to include the additional information about how to authorize against the service. |
Walkthroughs for creating generic Web API providers for popular APIs
In Dashboard Server navigate to the right-hand menu ☰ > system > Integrations
Under Integrations click Web API.
Click the authentication type Simple
In the service name box type in a suitable name, e.g. PagerDuty
The base URL should be the current PagerDuty API URL, for example:
https://api.PagerDuty.com/
Under default headers click add
Add the following information to the boxes as shown below:
First box (name):
authorization
Second box (value):Token token=API token from PagerDuty
You can create an API access key (token) by logging in to PagerDuty > Integrations > API Access Keys > Create New API Key, and ticking Read-only API Key. See Generating API Keys
Copy the API access key from PagerDuty before closing the window:Paste into the authorization value box in Dashboard Server, prepended by
Token token=
as shown above.Click Save.
1. Add a new provider in Dashboard Server Community Edition
In Dashboard Server navigate to the right-hand menu ☰ > system > Integrations
Under Integrations click Web API
Click on the authentication type OAuth
In the service name box type in a suitable name for this provider. This name is used to create a URL so it is best to avoid spaces and non-alphanumeric characters., e.g. GoogleAnalytics.
Leave the grant type as authorization code
The base URL should be
https://www.googleapis.com/
The authorization URL should
https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&include_granted_scopes=true
The parameters appended to the authorization URL allow Dashboard Server to continue to access the API after the first hour. Without them Dashboard Server can't reauthorize the provider automatically after the first token has expired. access_type=offline - requests that the API return a refresh token to keep the connection alive. The token expires every hour and without a refresh token, you have to manually reauthorize the provider each time. include_granted_scopes=true - allows the refreshed token to have the same permissions as the original request when the user was present.
The token URL should be
https://oauth2.googleapis.com/token
At this point we need to save the provider and follow the next steps to obtain a client ID and secret from the Google Developer Console, after which we will return to complete these provider details.
Click save to save the provider.
Copy the redirect url displayed. This will be used in the next section.
2. Configure the Google Developer Console
- Visit the Google Developer Console
- Create a new project as required.
- Select Create Credentials > OAuth Client ID
- Select Web Application
Enter the following:
Name: This can be anything
Authorized JavaScript origins: Should be the hostname of your SquaredUp server including the http/https
Authorized Redirect URIs: Should be the redirect url copied from Dashboard Server right-hand menu ☰ > system > web api. It will be your Dashboard Server instance followed by
/ext-core-webapi/callback/GoogleAPIProvider
whereGoogleAPIProvider
is the name of the provider you created.For example:
https://SquaredUpServer/SquaredUpv5/ext-core-webapi/callback/GoogleAnalytics
Where
SquaredUpServer
is the name of the server where Dashboard Server is installed.- Click save/create
- Copy the client ID and secret to use in the next section.
3. Complete the provider setup in Dashboard Server
In Dashboard Server navigate to the right-hand menu ☰ > system > Integrations
- Click on the provider you created earlier to edit it.
- Paste in the client id and secret copied from the Google Developer Console.
- Paste in the relevant authorization scope from OAuth 2.0 Scopes for Google APIs. For example, for Google Analytics it should be the URL scope listed for 'View your Google Analytics data' which is
https://www.googleapis.com/auth/analytics.readonly
- Click save. You will be redirected to Google to login and authorize and then back to Dashboard Server.
If the configuration is correct then you will see a green tick.
If the provider is not authorized it could be that some of the provider configuration is incorrect (for example the username, password, secret etc), or if you use a proxy it could be that the proxy is not configured. See How to configure Dashboard Server to use a proxy
You can now add Web API tiles using this Google API provider, see How to use the Web API tile with Google APIs, such as Google Analytics
In Dashboard Server navigate to the right-hand menu ☰ > system > Integrations
Under Integrations click Web API.
Click the authentication type Simple
In the service name box type in a suitable name, e.g. Pingdom
The base URL should be the current Pingdom API URL, for example:
https://api.pingdom.com/api/3.1/
We recommend you include the API version here in the base URL, so if the API version changes you only need to update it here, rather than in every tile.Under default headers click add
Add the following:
name:authorization
value:Bearer
<API token from Pingdom>
You can create an API key (token) by logging in to Pingdom > Settings > Pingdom API > Add API token
Enter a Name, leave the Access Level set to Read access and click Generate token.
Copy the API token from Pingdom before closing the window:
Paste the API token into the authorization value box in Dashboard Server, prepended by the word
Bearer
and a spaceClick Save.
Dedicated providers
Azure Active Directory | When using Azure Active Directory authentication with an app or service |
Azure Application Insights | |
ServiceNow | |
Elasticsearch | |
Splunk |
Adding a Web API provider
In Dashboard Server navigate to the right-hand menu ☰ > system > Integrations
Under Integrations click on Web API and choose either Simple, Basic Auth or OAuth depending on the API you are using.
About the different types of Integrations and Web API providersSimple No authentication, basic authentication (username and password in a header) or Windows authentication (configured automatically to use the application pool identity account).
Basic auth Basic authentication. Your specified username and password will be Base64 encoded automatically.
OAuth Token-based authentication according to the OAuth 2.0 standard. Many APIs use OAuth 2.0 for authorization, and will require an OAuth provider to include the additional information about how to authorize against the service.
Note: When adding an OAuth provider you may get an message that the provider is not authorized if some of the provider configuration is incorrect (for example the username, password, secret etc), or if you use a proxy it could be that the proxy is not configured. See How to configure Dashboard Server to use a proxy
Complete the provider fields, using your API provider's online documentation as a guide.
You are now ready to use this provider in a Web API tile (see How to use the Web API tile).
Further help for adding Web API providers
Blog: Integrating Dashboard Server with external APIs: UptimeRobot
Webinar that includes New Relic
For other APIs, take a look at our Community Answers site, where there's a wealth of knowledge about APIs.