How to configure and use REST Web Service connections using WEBCON BPS Authentication. Examples of using WEBCON BPS REST Web Service.
This article was written based on 2021.1.1.56 Express version. Behavior may be different in other versions.
Before we start
Before we will configure a REST Web Service connection, it will be necessary to create an API application account and grant it appropriate permissions. In order not to duplicate the same content, I refer you to the article available on the WEBCON technical blog: Examples of using REST API. There you also will find how WEBCON BPS authentication works.
When you created your API application account, you have a generated client ID and client secret and permission granted on processes, you are ready to go.
Why should you use connection with WEBCON BPS authentication
Long story short: because it makes it much easier to configure the integration between WEBCON BPS instances!
In standard way firstly you should obtain a token using /api/login POST method. Then, using the received token, you are able to call the method you need. When you use standard connection with WEBCON BPS authentication, that connection will handle obtaining and using token which is needed to invoking WEBCON BPS REST API methods.
Configuration of connection with WEBCON BPS authentication
It’s so simple! Just go to Data Source tab and add new connection in the REST WEB Service Connections node. Set “WEBCON BPS” as authentication type and enter proper Client ID, secret and base service URL.
Connection usage – REST WEB Service data source
The connection prepared in this way can be used in the data source configuration. Add new REST Web Service data source. Pick created data connection. Enter suffix URL and custom header parameters. In my example I want to get form fields from WEBCON BPS instance (element) with ID 530.
Then go to response tab and load response.
An finally pick what data you want to use as your data source.
Using REST WEB Service data source
Let’s try what data is returned. I configured example form field which will display data returned from configured data source above.
As you can see no every data is returned. In my case each choice field is blank. That is happening because these values are returned as collections. It seems that there is no way to get this data (when collection is in another collection). This behavior can be problematic and you should keep it in mind if you want to use this data. As a last resort, you can use the values contained in the “svalue” column that returns the full value in text form.
Connection usage – Invoke REST WEB Service action
When I tried to select the created connection in the REST WEB Service invoke action, I was unable to pick the connection. In my opinion, this is a bug that will be fixed in future versions, in particular that using the custom authentication type, it is possible to indicate WEBCON BPS authentication.
The concept of connection using WEBCON BPS authentication is a great idea. It will allow for communication between WEBCON instances in an easy way. You can see, however, that not everything is working perfectly yet, but I hope that the next versions of WEBCON BPS will contain some bug fixes and the possibilities of WEBCON BPS integration will be further developed.