Skip to content

Invoking the API Manager from the BPEL Engine

Once the workflow configurations are finalized at the BPEL, the call-back URL of the APIM, which is originally configured in the <APIM_HOME>/repository/conf/api-manager.xml file and sent to the BPEL engine in the outflow will be called to progress the workflow. In APIM, the endpoint is available in both SOAP and REST variants as follows:

Type URI
SOAP

https://localhost:8243/services/WorkflowCallbackService

WSDL Location : http://localhost:8280/services/WorkflowCallbackService?wsdl

REST https://localhost:9443/api/am/admin/v4/workflows/update-workflow-status

Both the endpoints are secured via basic authentication. Therefore, when you invoke either endpoint, you need to include an authorization header with a base64-encoded value of the username and password with the request. E.g., Authorization: Basic <base64 encoded username:password > .

The endpoint expects the following list of parameters:

Parameter Description Mandatory
workflowReference
The unique identifier sent to the BPEL against which the workflow is tracked in API Manager YES
status
The next status to which the workflow needs to be promoted to. YES
description
Notes, that may need to be persisted against a particular workflow. NO

A sample curl request for invoking the REST endpoint is as follows:

curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -X POST https://localhost:9443/api/am/admin/v4/workflows/update-workflow-status -d 'workflowReference=b530be39-9174-43b3-acb3-2603a223b094&status=APPROVED&description=DESCRIPTION'

A sample SOAP request is given below:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://callback.workflow.apimgt.carbon.wso2.org">
   <soapenv:Header/>
   <soapenv:Body>
      <cal:resumeEvent>
         <cal:workflowReference>b530be39-9174-43b3-acb3-2603a223b094</cal:workflowReference>
         <cal:status>APPROVED</cal:status>
         <cal:description>DESCRIPTION</cal:description>
      </cal:resumeEvent>
   </soapenv:Body>
</soapenv:Envelope>