Workflow API
General information​
Workflow API serves to interact with process instances and some other auxiliary operations of Workflow Server (for example, working with users, stopping timers in a server instance, etc.). The comprehensive Workflow API documentation is included in the server admin.
This page contains a list of all Workflow API methods available, forms for test requests, and code examples that can be copied and pasted directly into your application.
- The name and description of the chosen API method.
- The button for opening / closing a form with the method parameters.
- All of the method parameters.
- The button for sending a request with the filled-in parameters to the server.
- In this window, the code is generated that can be copied and pasted into your program so that to call the Workflow API method. So far, the code can be generated in two languages: javascript and C#.
- The result of the request execution.
Access to Workflow API​
By default, the access to Workflow API is not restricted in any way. The access settings are available in the admin panel on the Dashboard page.
- Api access token - you can set an access token for Workflow API; if the token is set, then each request to Workflow API must contain a token field with the correct value.
- Use OpenId Connect for token access - if you check this box, the token access mechanism will work through the Identity Server tools, launched along with each instance of Workflow Server. To enable this setting, you should fill in the Api access token field. How the access token works using the Identity Server (OpenId) is described in the next section.
Token Access Using Identity Server​
First, let us describe the process of obtaining an access token manually. This is essential to understand the method, but, as a rule, it is recommended to use ready-made libraries.
Open this address in your browser http://localhost:8077/.well-known/openid-configuration to receive JSON with the addresses of all endpoints of the identity server.
In this JSON, you are interested in the address
"token_endpoint": "http://localhost:8077/connect/token"
.To obtain a Workflow API access token, a request should be sent to this address with the following parameters:
- client_id = workflowapi
- client_secret = the value of Api access token
- grant_type = client_credentials
Example request:
POST /connect/token HTTP/1.1
Host: localhost:8077
Content-Type: application/x-www-form-urlencoded
Content-Length: 194
client_id=workflowapi&client_secret=fc9rmnuvwR6Nsbfg0H9hAxqz9OrUhK3CFjLNNj0HC7mBWT02QmyikLhk7gxQIEllCFt6Fj1Kjvf7wkgB4sXOykZUdpGuRNhWm5goUYSNF8VcL5a1Na4OcOwHMaNNAjrB&grant_type=client_credentialsJSON is obtained in response. The access_token property should be taken from it.
The access_token obtained must be used with each request to Workflow API.
Example request:
POST /workflowapi/createinstance/f54104f0-5de2-ea7b-e3be-47c9199a3967 HTTP/1.1
Host: localhost:8077
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkRDQTJFMTI2Nzg4QkY2RjZFQjU3MDY4NjAwQzc3RENDMzlFRkNGRTRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjNLTGhKbmlMOXZiclZ3YUdBTWQ5ekRudnotUSJ9.eyJuYmYiOjE2MDY5ODgyMDUsImV4cCI6MTYwNjk5MTgwNSwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDc3IiwiYXVkIjoiV29ya2Zsb3dBcGkiLCJjbGllbnRfaWQiOiJ3b3JrZmxvd2FwaSIsImp0aSI6IjYwQzE3NTZBRkU4REFDQTY4M0Y0QzVDNkU4RDMwRkE3IiwiaWF0IjoxNjA2OTg4MjA1LCJzY29wZSI6WyJXb3JrZmxvd0FwaSJdfQ.auuTeD3hEBl40ZEXK58oSIGyHihuTMTxsFf_qAOeScsw4bcYz7YFVNWQqUPgx7Cno541wKMz70oOwO01M2Es31u9lN87y-jCJCn721vbGQeOXqXAlqztGUB5cJiTerOgVK_Fp4IMpm7TFQdzDKN42k3TPIX4IjOVBnc3bINXCtDnr5iteaLYcvwYI1vU-WyYqjfW4KCcEqwCjUA3F6eUYVMuXIsejD6DTI-7hwLqTP1Hopdtmq5x6W38kBcg1I-LrqPhLpg2-tj0xE7CcqttDWSC0G3wEjO04rflDkA0R58iDOgIuMhcPPZGaT8pAwhA5E0pkEjvIHKBV0aaeJ9pug
Content-Length: 37
{
"schemeCode" : "TestScheme"
}
If you are using .NET Application when calling the workflow API methods, you can read this instruction.