GUIDE : Using API to get value from WEB

Hi, I am Xoma, :grinning:
in this Guide, we will learn how to get data from API which is also know as “Application programming Interface” using WEB component. It it might be difficult for new users, so we will understand everything one by one.


We will be using https://passwordwolf.com/api this website to get the value, this is a open/free API to generate strong passwords. You can also make a whole app using this API.


Here I have done a very simple button, I have took a button, a label and WEB component.


We have some blocks and some methods to follow.


Step 1

blocks (69)

First we need to initialize a variable to store the data got from WEB.


Step 2

When the Button/Card/Image is clicked, we will set the WEB URL to THIS. You can also set it from designer properties of WEB. Then we will use get block to get the Data/Value.


Step 3

When the value is got, we will set the Variable “JSON” value to the response content got from text. We shouldn’t store it without decoding the JSON got from WEB.

We will use get value for key block in the dictionary or look up in pairs block from list, any of them is okay.

Here our key is “password” and dictionary is the index of the list of variable “JSON”
In this API you get 9 index values. If you use this api then you can use any index from 1 to 9.

After all this we will connect the block to set.Label1.Text.


Step 4

Now, it’s all done, so you should give a like :+1: and a comment :wave: if it helped to this topic. Any suggestion or recommendations are appreciated. :grinning:


Happy Niotroning

Regards,
/XOMA DEV

6 Likes

Hi, as you are good ui designer, please make some ui tutorials.

2 Likes

#off-topic

Summary

@xoma start ui challenges on this community too

3 Likes

Really helpful GUIDE. And Yea @xoma Start Ui Challenge in Niotron Community :fire::fire::fire::fire::fire:

1 Like

Hey xoma thanks for your guide . Excellent guide

2 Likes

Good guide @Xoma

1 Like