Skip to content

Tutorial: Cancel an Inquiry

This tutorial walks you through the workflow for canceling an existing inquiry from a given order using the public API layer in People Cloud.

This public endpoint is routed through the same internal validation and business logic used by the main People Cloud platform, ensuring consistency across environments.


Step 1: Make a POST Request to Cancel a Position

Send a POST request to the following endpoint to cancel an existing position:

POST /api/public/inquiry/{orderId}/cancel

Replace {orderId} with the inquiry (order) ID you want to cancel.


Authorization

This endpoint requires authentication. Use the Bearer token from the authenticated user session.

Request Headers

Authorization: Bearer <your_token_here>
Accept: application/json
Content-Type: application/json

Request Body

No body is required for this cancel request. It is a simple action trigger.


Step 2: Cancel the Position

You can use the following curl command to cancel a position:

Example CURL command

curl -X POST "http://127.0.0.1:8000/api/public/inquiry/12/cancel" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"

This command cancels the inquiry with ID 12.


Step 3: Evaluate Response

If the cancellation is successful, you will receive a response like this:

{
  "message": "Inquiry successfully cancelled"
}

Step 4: Error Handling

Status Meaning Description
200 OK Inquiry was canceled successfully.
401 Unauthorized Missing or invalid Bearer token.
403 Forbidden You don’t have permission to cancel this inquiry.
404 Not Found The inquiry was not found.
409 Conflict Inquiry cannot be canceled due to its current state.
422 Validation Invalid input or state for canceling the inquiry.