It is very plausible that you may want get some extra data in your APIs that may not be actually stored in your database, but somewhere in another service you might be using. To give you can example, you want to show an overview of all the pull requests your team has made for an internal dashboard. You'd need to get that data from an external source, which in this case would be Github.
Canonic allows you to define a new Integration
type of FieldSets
that fetches data into these fieldSets from an external API. Let's see how we can get external data from the GitHub APIs:
- Create a new
FieldSet
, select the type asIntegration
and give it a name.
-
Select
Github
from the API Integrations Dropdown. You'll automatically see all the APIs that Github provides listed under it. For our example, let's select the"List pull requests"
API. -
Go to the API Configuration Tab. You'll see 3 settings there:
- Authentication Add all the details required to authenticate the access to the Integration. In our case we'll be fetching the Pull Requests for a public repository, so we can leave it empty.
π‘ Note: Way of authentication can be different for different integrations
- Required Fields Fields that are necessary to make the API work as expected will be listed down here. In our case, we need to add the details of the repository we need to fetch details for. We used canonic's open source samples repos credentials for this example.
- Optional Fields If lists down all the different optional parameters that the API Supports:
You just created a custom data-source to your project π Just hit deploy and head to the playground to see the magic. If you try querying your table for information, the pullRequests
fieldSet will populate the response from Github API.