← All Posts
Interacting with the S1SEVEN API via our custom Node-Red module

Interacting with the S1SEVEN API via our custom Node-Red module

Eamon O'CallaghanEamon O'CallaghanNovember 23, 2022
Share

Simplifying the process with Node-Red

While we have previously published two articles detailing how to set up Node-Red to allow you to interact with the S1SEVEN API here and here, which will enable you to customize the workflow in any way you want, in most cases, a quick and easy option is preferable to a highly configurable but more complex option.

We have created and published a custom module that can be installed directly in Node-Red, allowing you to interact with the API via the UI. To get started, make sure you have Node-Red set up (if necessary, follow the instructions here).

To install our custom node, click on the menu button on the top right, then choose Manage palette.

637e1b98ca19c03e6b61895c_1*tok9Z9fgWo37mqeOTXeBLA.png

Manage palette menu option

Open the Install tab and type in S1Seven. Choose the @s1seven/node-red-s1seven-api node and click install.

637e1b983720a36e2eeeb66c_1*yiBdkOFn7V1b6Ds0RkgD0A.png

Installing a node

This will add a custom S1Seven section to the left sidebar containing several custom nodes.

637e1b98345b29dcfa3340d5_1*6__hIXgbSPSghvjo_GivDA.png

S1SEVEN custom nodes

These nodes can be easily connected to an inject node and a debug node. In the example below, all the api nodes are connected to show how it can be done, but you should connect only the nodes you want to use.

637e1b98cd9033285012e91d_1*SpUKv36tiSKL1792W8Y4Ew.png

Example using our API nodes

To keep the example as simple as possible, we will inject the certificate via the inject node, as you can see in the following screenshot:

637e1b9895f59f833214f9ca_1*IorwZzxAhqzyeLralbgvVw.png

Double-click on the inject node and paste the certificate beside msg.payload

Double-click on the api node that you want to configure. In this example, we will configure the verify certificate node.

637e1b98fd493915c47952d7_1*um2DeYgaSuOrVJfRl-PX5w.png

Adding a new API configuration

Select the option Add new api-config…, and click the edit button beside it (the one that looks like a pencil). Here you can configure the environment you want to work with, for example, development or staging.

Fill out all the options using your desired configuration, add a memorable name and click done. You can find more information on how to generate an access token in the S1SEVEN user manual.

637e1b99fcacb52525f76c53_1*F6CFPGLDonVaBIrkBhPD7A.png

API configuration example

Make sure that your desired environment is selected:

637e1b9856cdc69cb8b918ca_1*mLoTWhNMXmfwmlYpeHqCIQ.png

Select an API configuration

Then click the inject button to verify your certificate. You should see the result of the request in the debug panel to the right.

Conclusion

In the example above, we have shown you how to configure and use the verify certificate node. The other nodes can be configured in the same way. Each node may require different information; for example, the notarize certificate node also requires you to input an identity. Information on how to find this information can be found in the S1SEVEN user manual.