Use the Web Service Provider (WSP) object to expose a REST API from Cleo Integration Cloud. A WSP listens for incoming requests, runs a Business Process you design, and returns the response to the caller. It is the building block for turning an integration into an API that partners, applications, and internal teams can call.
Quick Notes
- Protocol: REST only
- Max Payload: 10 MB.
- ASYNC Support: CIC Studio v5.2.13+
- Required: These objects must be deployed to operate.
In this article
- How a WSP works end-to-end
- Create a WSP
- Configure a WSP (fields reference)
- Example: a synchronous order-status API
- Asynchronous WSPs
- Authorization types and calling your API
- API group and authorization rules (avoid deployment errors)
- Common use cases
- Troubleshooting
- Best practices
How a WSP works end-to-end
Building an API with a WSP involves three places in the platform:
- CIC Studio: you create and configure the WSP, and edit the Business Process that does the work.
- Deployment: WSP objects must be deployed to the Integration Server before they can receive requests.
- CIC Cockpit: once deployed, you create an API Provider Endpoint in the Cockpit to make the API available to consumers. Multiple WSPs that reference the same host and vault alias value are combined into a single API Endpoint, which you can view from the Jobs page in the Cockpit. See API Provider Endpoint.
Each incoming call runs the WSP's Business Process as a job, so you get the same visibility, retry, and troubleshooting tooling you already use for the rest of your integrations.
Create a WSP
- In CIC Studio, select File | New | Web Service Provider.
- Choose the Source folder, Package, and Name. The name also becomes the name of the service you provide, so use a descriptive name that follows the recommended naming conventions.
- Click Finish. The WSP editor opens.
Configure a WSP (fields reference)
In the WSP editor you define the REST service and how it is consumed. The fields are:
| Field | Required | What it controls |
|---|---|---|
| Resource Name | Yes (auto-filled) | Last segment of the URL. Defaults to <wsProviderFileName>Rest and can be edited. |
| Path | No | Optional sub-path that keeps endpoints unique and organized. |
| API | No | Name of the API group. Groups share credentials and auth settings. Blank uses the default security group. |
| Async | No | Return immediately with 202 Accepted instead of waiting for the Business Process to finish. |
| Business Process | Yes (auto-created) | The process that runs for each request. |
| Authorization Type | Yes | How callers are authenticated. |
| Default Response HTTP Headers | No | Headers added to every response. |
Resource Name, Path, and API: how the URL is built
These three fields combine to form the URL your consumers call:
https://<hostname>/<API>/<Path>/<ResourceName>
Use Path to separate read operations from write operations, or to group endpoints by domain. For example, a beverages inventory service might expose:
# Read Path: getBeverages https://cleointegration.cloud/beverages/getBeverages/GetBeersInventoryWSPRest # Write Path: postBeverages https://cleointegration.cloud/beverages/postBeverages/PostBeersInventoryWSPRest
Here beverages is the API group, getBeverages and postBeverages are paths, and the final segments are the resource names.
Business Process
CIC Studio creates a package with a Business Process already wired to your WSP. It contains two pre-configured tasks:
-
SendRestReplysends the response message back to the consumer. -
SetExitStatussets the Business Process exit status totrue.
This skeleton returns a reply but does no real work yet. Add your own tasks between request and reply. Typical additions include GetProperty to read a value from the request (such as a purchase order number), tasks that gather or transform data, and SendEmail to notify someone.
Default Response HTTP Headers
Use this section to add headers to every response, override common headers, or define custom ones. Typical examples are cache-control directives, CORS headers for browser-based consumers, or a custom header that carries a version identifier.
Example: a synchronous order-status API
This walkthrough builds a simple endpoint that returns the status of a purchase order, using the fields above.
1. Configure the WSP
| Field | Value |
|---|---|
| Name | GetOrderStatus |
| Resource Name |
GetOrderStatusRest (default) |
| Path | orders |
| API | partner-api |
| Async | Off |
| Authorization Type | Basic Authentication |
2. Extend the Business Process
Between the start of the process and SendRestReply, add tasks to:
- Read the order number from the incoming request (
GetProperty). - Look up the order in your system of record (for example, through a Web Service Consumer or database task).
- Set the response body so
SendRestReplyreturns the result.
3. Deploy, then create the endpoint
Deploy the project to the Integration Server, then create an API Provider Endpoint in the CIC Cockpit (Network > Endpoint) and select your API provider.
4. Call it
curl -u "<username>:<password>" \ "https://<hostname>/partner-api/orders/GetOrderStatusRest"
The URL follows the <hostname>/<API>/<Path>/<ResourceName> pattern. Each call appears as a job in the Cockpit.
Asynchronous WSPs
Enable Async when the work behind the API takes too long for a caller to wait: large file processing, multi-step orchestration, or calls to slow downstream systems. The caller gets an immediate answer and the Business Process runs in the background.
202 Accepted and includes the job ID in the payload.Configure an asynchronous WSP
- In CIC Studio, open the WSP you want to make asynchronous.
- Enable the Async flag in the editor.
- Save your changes and close the editor.
- Deploy the API Provider.
- In the CIC Cockpit, go to Network > Endpoint and select the API Provider when you create your API Endpoint. The endpoint shows confirmation that the API is asynchronous.
When the endpoint is invoked, the response is immediate and a Job is created in the Cockpit.
What the caller sees
curl -i -X POST -u "<username>:<password>" \ -H "Content-Type: application/json" \ -d @large-order-batch.json \ "https://<hostname>/partner-api/orders/SubmitOrderBatchRest" HTTP/1.1 202 Accepted ... (payload includes the job ID)
Your consumer should treat 202 as "received," not "finished." Store the job ID so you can trace the request in the Cockpit if something goes wrong.
If you need both behaviors, put them in separate API groups (for example,
partner-api and partner-api-async).
Authorization types and calling your API
Authorization is validated for each WSP according to the type you select:
| Type | Good fit for |
|---|---|
| OAuth2_Client_Credentials | Machine-to-machine integrations and modern partner APIs |
| Basic Authentication | Simple internal or legacy consumers (see Using Basic Authentication with API Endpoints) |
| Key Authentication | Lightweight access control with an API key |
| Custom Authentication | Authentication logic you implement yourself |
API group and authorization rules (avoid deployment errors)
Because auth type is enforced per API group, a wrong combination of the API and Authorization Type fields causes deployment to fail. Plan your API groups before you build.
| Scenario | Result |
|---|---|
| Two WSPs, same API group, same Authorization Type and Async setting | Deploys |
| Two WSPs, same API group, different Authorization Types | Deployment fails |
| Two WSPs, same API group, one Async and one synchronous | Deployment fails |
| Two WSPs in different API groups with different Authorization Types | Deploys (unless a default-group rule below applies) |
If no APIs are deployed yet
Once an API is deployed under the default API group name with a defined Authorization Type, no other API group name (default or non-default) can be deployed with a different auth type.
If an API is already deployed
Suppose a deployed project contains a WSP whose API field is internal and whose Authorization Type is OAuth2_Client_Credentials. You cannot deploy another project that uses the internal API field with Basic Authentication or Custom Authentication.
To deploy the second project, first un-deploy the original project, then deploy the one with the API field and Authorization Type combination you want. The same applies any time you want to change the auth type for an existing API group: un-deploy first, then associate the new auth type.
Common use cases
- Order and shipment status lookups. Expose a read-only endpoint that trading partners call instead of emailing or phoning for updates.
- Inbound transaction intake. Accept purchase orders, ASNs, or invoices as JSON over REST and hand them to a Business Process that maps and routes them to ERP or EDI flows.
-
Long-running batch submission. Use an async WSP so a partner can submit a large batch, get a
202and job ID immediately, and not hold a connection open. -
Internal service APIs. Wrap an existing integration as an API so internal apps can trigger it on demand, using a separate
internalAPI group with its own auth. - Partner-specific access. Use API groups to issue different credentials per consumer or per product line, while a single consumer can still access multiple APIs in its group.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Deployment error after enabling Async on one WSP | Other WSPs in the same API group are synchronous | Enable Async on all WSPs in the group, or move the async WSP to its own API group. |
| Deployment error after changing Authorization Type | Another deployed WSP in the same API group uses a different type | Un-deploy the existing project first, then deploy with the new combination. |
| Custom-auth API not available on a specific endpoint | Custom Authentication binds to the Default API Provider Endpoint only | Use the Default API Provider Endpoint, or choose a different Authorization Type. |
| Request rejected for size | Payload exceeds 10 MB | Split the payload, or pass a reference to the data instead of the data itself. |
| Endpoint not visible in the Cockpit | WSP not deployed | Deploy the project to the Integration Server, then create the API Provider Endpoint. |
Best practices
- Design API groups first. Decide your groups, auth types, and sync/async behavior up front. Changing them later means un-deploying.
- Keep sync APIs fast. If a Business Process can run long, make it async.
- Use meaningful paths. Separate read and write operations, and keep resource names descriptive.
- Mind the 10 MB limit. Plan for large payloads before consumers hit it.
- Test in the Cockpit. Every call is a job, so review job details when validating a new endpoint.
Comments
0 comments
Please sign in to leave a comment.