In this post we will see how easy it is to create internal Amplify Central utilities using Retool and the Amplify Central Platform APIs. Retool is a drag and drop programming framework for creating internal development tools. In this post you’ll see the basic steps of creating a Resource (i.e. Connector) to the Amplify Central API and making an API call and binding the results to a Table component.
You’ll also see how to import a more complete Amplify Central Developer Workbench example application. You will need an Axway Service Account Client ID and Client Secret. You can read this post to set one up. You will also need to sign up for a Retool account
Create a Resource
- Create a new resource of type REST API
- Fill in the resource name (e.g. Amplify Central) and Base URL (https://apicentral.axway.com/apis) as follows:
- Scroll down to the Authentication section and do the following:
- Set Authentication to OAuth 2.0
- Check the Use Client Credentials Flow
- Set Authorization URL to
https://login.axway.com/auth
- Set the Access Token URL to
https://login.axway.com/auth/realms/Broker/protocol/openid-connect/token
- Enter your Client ID and Client Secret
- Set Scopes to
email profile
- Leave the rest empty
- Click the Create Resource button
Now we will be able to reference the Amplify Central resource when we create a query (API call) in a Retool application.
Create an Application and Query
- Create a new application
You should have a new query created (query1) with resource, Amplify Central (that you created above), in the lower left hand corner of the screen as shown above. If not, create one.
- Click on the query1 name and rename it to getEnvironments and fill in the General information for the query as follows:
- Enter
management/v1alpha1/environments
in the URL - Create an Authorization header with value
Bearer OAUTH2_TOKEN
as per the Retool online docs - Create a Content-Type header with value
application/json
as follows:
- Enter
- Click the Save and Run button and you should see your environments in the response
Use the Query in the Application
- Drag a table onto your canvas from the components panel on the right and you should see your
getEnvironments
response populating the table
If not, enter {{ getEnvironments.data }}
in the Data property for the table.
Now you can learn Retool and create a more powerful and useful utility that integrates with Amplify Central.
Amplify Central Developer Workbench
Once you have the Amplify Central Resource configured as described in this post, you can import this Amplify Central Developer Workbench Retool application and see a more complete Amplify Central Utility which can be used to view and modify many Amplify Central resources. Download the json file and follow the steps below:
- Import the json file as shown below:
- Click on the Preview button to see the application in action
Summary
In this post we saw how easy it is to create developer utilities using Retool and the Amplify Central Platform APIs. We also saw how to import a more complete example.
Learn how Amplify Central offers API governance with developer independence.
Follow us on social