Complete API Documentation for WesalVoC Platform
Voice of Customer (VoC) platform for collecting and analyzing customer feedback through surveys.
Welcome to the Wesal Cloud API documentation. This API provides endpoints for managing authentication and accessing survey data in the WesalVoC platform.
https://api.wesal.cloud/api/v1
Current version: v1
The API uses token-based authentication. After logging in, you'll receive a JWT token that must be included in subsequent requests.
Include the token in the Authorization header:
Authorization: YOUR_TOKEN_HERE
Authenticate a user and receive an access token for subsequent API calls. Two authentication modes are supported: User Account and API Token.
| Header | Value | Required | Description |
|---|---|---|---|
| Content-Type | application/json |
Yes | Request content type |
| X-Client-Id | RW5jb2RlIHRvIEJhc2U2NCBmb3JtYXQ |
Yes | Base64 encoded client identifier |
| Field | Type | Required | Description |
|---|---|---|---|
| company | string | Yes | Company identifier |
Use this mode to authenticate with user email and password credentials.
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | User email address | |
| password | string | Yes | User password |
{
"company": "COMPANY_NAME",
"email": "user@example.com",
"password": "USER_PASSWORD"
}
Use this mode to authenticate with API token for enhanced security and control. This is the recommended method for API integrations.
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | User email address | |
| password | string | Yes | API token (use instead of user password) |
{
"company": "COMPANY_NAME",
"email": "user@example.com",
"password": "YOUR_API_TOKEN_HERE"
}
| Field | Type | Description |
|---|---|---|
| user | object | User information including profile and company details |
| token | string | JWT authentication token |
| result | string | Operation result status |
{
"user": {
"_id": "37e4be421508c0e91f59d752",
"uuid": "1d285d8a-aaee-4e27-a3ef-3bd26d6cc3b0",
"firstName": "First Name",
"lastName": "Last Name",
"email": "user@example.com",
"phone": "0500000000",
"role": "admin",
"status": "active",
"createdAt": "2025-01-08T10:50:19.128Z",
"updatedAt": "2025-03-16T11:19:23.625Z",
"company": {
"_id": "37e4be421508c0e91f59d752",
"name": "COMPANY_NAME",
"settings": {
"region": "mypurecloud.de",
"questionsSchema": [
{
"id": "AgentSatisfaction",
"name": "Agent Satisfaction",
"type": "rating",
"minAnswer": 1,
"maxAnswer": 5,
"counts": 5
},
{
"id": "ServiceSatisfaction",
"name": "Service Satisfaction",
"type": "rating",
"minAnswer": 1,
"maxAnswer": 5,
"counts": 5
}
]
}
}
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"result": "success"
}
Retrieve survey data based on specified filters including date range, agents, queues, and answers.
| Header | Value | Required | Description |
|---|---|---|---|
| Content-Type | application/json |
Yes | Request content type |
| Authorization | {{token}} |
Yes | JWT token from login response |
| Field | Type | Required | Description |
|---|---|---|---|
| startDate | string | Yes | Start date in ISO 8601 format |
| endDate | string | Yes | End date in ISO 8601 format |
| agents | array | Yes | Array of agent names to filter by |
| queues | array | Yes | Array of queue names to filter by |
| answers | object | Yes | Filter criteria for survey answers |
| companyId | string | Yes | Company identifier |
| page | number | Yes | Page number for pagination |
{
"startDate": "2025-11-01T00:00:00",
"endDate": "2025-11-12T23:59:59",
"agents": [],
"queues": ["Sales"],
"answers": {
"ServiceSatisfaction": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
"AgentSatisfaction": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
"interactionType": ["voice"]
},
"companyId": "37e4be421508c0e91f59d752",
"page": 1
}
| Field | Type | Description |
|---|---|---|
| surveys | array | Array of survey objects |
| total | number | Total number of surveys matching criteria |
| pageTotal | number | Number of surveys in current page |
| result | string | Operation result status |
| Field | Type | Description |
|---|---|---|
| _id | string | Unique survey identifier |
| interactionId | string | Associated interaction ID |
| surveyDate | string | Survey completion date |
| type | string | Interaction type (e.g., voice) |
| number | string | Contact number |
| direction | string | Call direction (inbound/outbound) |
| queue | string | Queue name |
| agent | string | Agent name |
| answers | object | Survey answers object |
{
"surveys": [
{
"_id": "6912d1249dfba0a82101ce9f",
"interactionId": "a08013f9-5458-4f14-a4c8-fc41b451dbe4",
"surveyDate": "2025-11-11T08:58:37",
"type": "voice",
"number": "tel:+966×××××××××",
"direction": "inbound",
"queue": "Sales",
"agent": "Nourah",
"answers": {
"ServiceSatisfaction": "4",
"AgentSatisfaction": "5"
}
},
{
"_id": "6912d13f9dfba0a82101cea0",
"interactionId": "a08013f9-5458-4f14-a4c8-fc41b451dbe2",
"surveyDate": "2025-11-11T08:58:37",
"type": "voice",
"number": "tel:+966×××××××××",
"direction": "inbound",
"queue": "Sales",
"agent": "Ahmed",
"answers": {
"ServiceSatisfaction": "3",
"AgentSatisfaction": "4"
}
}
],
"total": 2,
"pageTotal": 2,
"result": "success"
}
Initiate a password reset process. A verification code will be sent to the user's email or phone.
| Header | Value | Required | Description |
|---|---|---|---|
| Content-Type | application/json |
Yes | Request content type |
| Field | Type | Required | Description |
|---|---|---|---|
| companyId | string | Yes | Company identifier |
| method | string | Yes | Reset method: "email" or "phone" |
| string | Conditional | User email address (required if method is "email") | |
| phone | string | Conditional | User phone number (required if method is "phone") |
{
"companyId": "37e4be421508c0e91f59d752",
"method": "email",
"email": "user@example.com",
"phone": "NO"
}
{
"result": "success",
"message": "Reset done, please check your email"
}
Complete the password reset process by verifying the code and setting a new password.
| Header | Value | Required | Description |
|---|---|---|---|
| Content-Type | application/json |
Yes | Request content type |
| Field | Type | Required | Description |
|---|---|---|---|
| companyId | string | Yes | Company identifier |
| method | string | Yes | Reset method: "email" or "phone" |
| string | Yes | User email address | |
| verifyCode | string | No | Verification code from email |
| otp | string | Yes | One-time password/verification code |
| password | string | Yes | New password |
{
"companyId": "37e4be421508c0e91f59d752",
"method": "email",
"email": "user@example.com",
"verifyCode": "",
"otp": "1234",
"password": "NEW_PASSWORD"
}
{
"result": "success",
"message": "Password reset successfully"
}
{
"result": "error",
"message": "Incorrect verify code"
}
Logout the current user and invalidate the authentication token.
| Header | Value | Required | Description |
|---|---|---|---|
| Content-Type | application/json |
Yes | Request content type |
| Authorization | {{token}} |
Yes | JWT token from login response |
{
"result": "success",
"message": "Logged out successfully"
}
The API uses standard HTTP status codes to indicate the success or failure of requests.
| Status Code | Description |
|---|---|
| 200 | OK - Request successful |
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Resource not found |
| 500 | Internal Server Error - Server-side error |
For support, questions, or more information about Wesal Cloud APIs, please reach out to us:
| Contact Method | Details |
|---|---|
| support@wesalcx.com | |
| Website | www.wesalcx.com |
| Phone | +966 XX XXX XXXX |
Sunday - Thursday: 9:00 AM - 5:00 PM (GMT+3)
Friday - Saturday: Closed