how to call external API

1
+6
-1

I want to call an external api in a ui designer variable, that returns JSON array, so that I could fill the dropdown widget with this array. Is this possible in Bonita or is it only possible to call Bonita API? Thanks in advance,
Regards,
Magdalina Civovic

1 answer

1
0
-1

This is a late answer but i was looking for this info weeks ago, maybe someone coud use it.
If you want to call an external api and use the data in the JSON you have to create a new variable in the UI Designer, select API type, paste the url and just use it.

I used this fake api url: https://jsonplaceholder.typicode.com/

There you can select different elements (pots, albums,comments ,etc)
Once you have added the new variable you can use it in your form with {{ nameOfYourVariable.elementInYourJson }}

Comments

Submitted by PaSol on Sat, 06/23/2018 - 23:30

Do I correct understand that there aren't any way call REST required authentification?

Submitted by PaSol on Thu, 06/21/2018 - 12:17

There aren't any options for authorization parameters of RestAPI in UI. So only RestAPI not required authorization can be used in UI?

Submitted by zsoilihi on Sat, 04/20/2019 - 13:46

the bracket [] behind url are mandatory ?

Submitted by antoine.mottier on Thu, 05/09/2019 - 17:57

The example URL to use to get an array of objects is: https://jsonplaceholder.typicode.com/posts

Notifications