This article moved to workflowserver.io permanently.

Workflow API

Table of contents

  1. General information
  2. Access to Workflow API
  3. Token Access Using Identity Server

General information

Table of contents

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.

Fig1

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.

Fig2

  1. The name and description of the chosen API method.
  2. The button for opening / closing a form with the method parameters.
  3. All of the method parameters.
  4. The button for sending a request with the filled-in parameters to the server.
  5. 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#.
  6. The result of the request execution.

Access to Workflow API

Table of contents

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.

Fig3

  • 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

Table of contents

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.

  1. 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.

  2. In this JSON, you are interested in the address "token_endpoint":http://localhost:8077/connect/token.

  3. 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_credentials
  4. JSON is obtained in response. The access_token property should be taken from it.

  5. 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.

Table of contents

Top