How to Trigger API?

This might be a dumb question, but I tried playing around and can’t seem to figure it out: how can I trigger an API call?

For example, if I have a POST request that I made in Divhunt’s API, and I want it to execute when I push a button, how would I make that happen?

Hi @chelce

That part is not possible yet, we need to have workflow system first in order to support that.
The only way for now is to trigger API manually with custom code.

I’ll write you detailed example here in 1-2 once I get back home

Here’s the system that will be used by workflow once we create the UI for it.

So this is called mdActions.

To see list of all actions, check console



But as for now, there’s only 1 action (REST)

If you check more deeply, you can see the input and output options, input is what you send, output is what you receive.

So for REST API, you send the ID and Properties.

let input = {
    id: 90, // Your REST API Request ID (find it inside admin panel from URL section
    properties: [ // Properties that are configured inside Request. 
        {key: 'property-key1', value: 'property-value2'},
        {key: 'property-key2', value: 'property-value2'}

mdActions.ItemGet('REST').Fn('run', {}, input, (success) => 
    console.log(success); // Will return {success, message, data}
(error) => 
    console.log(error);  // Will return {success, message}

So what you would want to do, is to catch form submission and run this code with provided values.

Or wait until we create workflow :slight_smile:

Awesome, @dejan, thank you so much! I know you guys are working like crazy on development (it shows in the changes to the builder). You guys have made it so easy to do all of the easy stuff that I actually feel curious enough to venture into some of the more advanced stuff. Thank you for all of your help! :slight_smile:

1 Like