Skip to main content

Notifications

Access APIs to Boost App Making Possibilities

Accessing APIs, for me, is one of the most interesting things about the internet. There is data available all over that could potentially be useful (or fun) for your next app. In this blog and solution, we are accessing the Open Trivia DB API to bring some simple quiz questions and answers to an app.

 

There are two parts to the solution:

  1. A Power Automate flow that, when activated, requests data from the API and passes it back to the app
  2. The app, that works with the data to display a quiz for the user to try

You can download the Solution file attached to this post, for import into your own environment, so you can play with the functionality.

 

If you try the API for yourself using this link, you'll get a response similar to this:

 

{"response_code":0,"results":[{"category":"Entertainment: Television","type":"multiple","difficulty":"medium","question":"What does Bart sell his soul for in The Simpsons episode 'Bart Sells His Soul'?","correct_answer":"$5","incorrect_answers":["A Copy of Bonestorm 2","$100","A Giant Gobstopper"]}]}

 

It's a bit tough to read on its own, but a tool such as CodeBeautify can make it easier to visualize the hierarchy and contents of the data coming back from the API.

 

The flow contains just a few simple blocks to get data from this open, unauthenticated API:

BCLS776_0-1636393209202.png

 

BCLS776_1-1636393232918.png

Check it out and see how it works!

 

Some fun API resources that might benefit your next project include:

Have fun!

Bryan

 

 

Comments

*This post is locked for comments