Creating a REST service
Procedure
To create the REST service:
Results
To invoke a REST service, the appropriate snapshot must be activated.
In the development environment, the REST service on the tip or the default track can be invoked directly. Make sure to make the track the default to open the OpenAPI definition URL in REST service directly.
In a test, staging, or production runtime environment, the consumer can either invoke the REST automation service from the default snapshot or consume the REST automation service from a dedicated snapshot.
http://host_name[:port]/[custom_prefix/]automationservices/rest/process_app_acronym/[snapshot_acronym/]rest_service_name/docshost_nameis the host name.portis the optional port number.custom_prefixis an optional custom prefixprocess_app_acronymis the acronym of the process appsnapshot_acronymis the optional snapshot acronym that, if not specified, resolves to either the tip of the default branch in the development environment, or to the default snapshot in a runtime environment.rest_service_nameis the name of the REST service.
Basic authentication works for service accounts and LDAP users managed by IBM Cloud Pak® for Business Automation or Identity Manager/Zen; it does not work for users managed by Okta. Zen API key authentication works for all user types. See Authorizing HTTP requests by using the Zen API key for more information.
For basic authentication, the user or service accounts should be registered in Cloud Pak for Business Automation.
- Execute the command:
oc get wfps wfps-instance1 -o yaml - In the
endpointssection, locate the URI of the external Workflow Process Service, for example:- name: External Base URL scope: External type: https uri: https://cpd-wfps3.apps.fjk-ocp474.cp.example.com/wfps-instance1-wfps - The URL of your REST service has the following
structure:
Where,http://host_name:port/[custom_prefix/]automationservices/rest/process_app_acronym/[snapshot_acronym/]rest_service_name/docs{}https://host_name:port/[custom_prefix/]is your uri value from the previous step, process_app_name is the name of the process application, snapshot_name is the optional name of the snapshot, and rest_service_name is the name of the REST service.
- Synchronous operations are of short-running nature, and are implemented by service flows. In the OpenAPI definition, you can see the inputs and outputs in their REST operation.
- Asynchronous operations are typically of a long-running nature, and are implemented by processes. In the OpenAPI definition, you can see the inputs in their REST operation, and the outputs are provided through callbacks. For more information, see Response handling for asynchronous operations.
This topic is shared by BAW, CP4BA, CP4BASaaS. Last updated on 2025-03-13 12:15