❖ Heads up! This article is intended for Site Managers.
An Application Programming Interface (API) is software that communicates with an app, user, or website. In other words, it sends and receives information from apps, users, and websites.
For example, let's imagine your great-aunt is visiting and currently staying in the guest house. You want to know how she makes the best peanut butter fudge but are busy with chores. So, you send your kid to the guest house to get the recipe for you. Your kid returns with the recipe and you make the best fudge ever.
In this example, your kid is the API. You didn't leave the house to stop chores. Your great-aunt didn't leave the guest house. Your kid ran to the guest house with your request and message and returned to you with the recipe.
Here, we cover:
When to use an API
An API can help you meet your reporting needs by sending and receiving data from your Get Connected site to other databases. For example, you may want to use an API if:
- You want to sync your user accounts with another database—e.g., a University wants to sync with a Medical Center and vice versa
- You need to create a weekly report using data from your Get Connected site that's emailed directly to you
- You're building an external website and want some data from your Get Connected site displayed on it
An API helps automate these processes for you because once it's set up, it continues to process this information until you turn it off.
API capabilities
Click here to see a list of API capabilities.
API keys
An API key is used to connect or communicate with another database. The API key is read by an application, which then calls the API to identify the program attempting to access a site. Just like how a key opens a door, an API key opens the connection between sites wanting to share and receive data. Things to keep in mind:
- You can reuse the same API key to generate any number of tokens
- Your API key will remain the same unless you choose to deactivate it or if the user account attached to the API Key is deactivated
Tokens
You must create an API key to generate a token when setting up this process. Tokens are utilized in the API authentication process to help set up your automated data sharing. Here are a few things to keep in mind about Tokens:
- Tokens are created in an API authenticating program like Postman
- Tokens expire after one year
- You can reuse a single API key to generate any number of tokens
Managing APIs for your site
How to create an API key
When you're ready to cerate an API key:
1. Go to Settings > API Keys.
2. Use the Select a Site Manager dropdown to select the site manager the API key is being created for.
3. Click Create API Key to finish.
How to copy an API key
If you want to copy an API key from your Get Connected site:
1. Go to Settings > API Keys.
2. Click the Copy API Key under the API Key column.
- Now you can go to Postman to authenticate your API Key and generate a token.
How to delete an API key
If you need to delete an API key:
1. Go to Settings > API Keys.
2. Click the X under the Options column for the API key you wish to delete.
✏️ Quick tip: Make sure the API key isn't currently in use by an app or program before deleting it. If it's deleted while in use by a program, then any API calls made by the program fail. This could even trigger reports or error messages that say you're attempting to use an invalid API key.
Authenticating APIs
Here is a quick video walkthrough that explains how to manage and authenticate your APIs: