Support Ticket API
Introduction to Support Ticket API
Welcome to SMSGatewayCenter's Support Ticket API! This powerful API allows mobile app users to create, manage, and track support tickets programmatically. Submit technical issues, ask questions, reply to conversations, star important tickets, and get help directly from your mobile application. Our RESTful endpoints support POST and GET methods over HTTP with full VAPT compliance for secure integration.
About Support Ticket API
The Support Ticket API enables you to:
- Create new support tickets with subject and detailed message
- Reply to existing tickets to continue conversations
- Read all tickets with pagination and filtering
- Read single ticket with complete conversation history
- Star/unstar tickets to mark important ones
- Filter tickets by status (open, closed, starred)
- Track ticket status (open, answered, closed)
All operations include comprehensive VAPT security measures including input sanitization, XSS prevention, SQL injection prevention, and authorization checks.
VAPT Security Features
- Input Sanitization: All inputs sanitized with strip_tags() and htmlspecialchars()
- SQL Injection Prevention: All database queries use prepared statements
- XSS Prevention: HTML entities encoded, script tags stripped
- Authorization: Ticket ownership verified before access/modification
- Duplicate Detection: Prevents spam and duplicate submissions
- Activity Logging: All operations logged for audit trail
Create Support Ticket
Create a new support ticket with a subject and detailed message. Automatically generates a unique ticket ID for tracking.
API Endpoint
https://unify.smsgateway.center/SMSApi/support/createHTTP Method
POST
| Key | Value | Description |
|---|---|---|
| Login Credentials (Required) | ||
| Authenticate your API request using userid-password or apiKey—choose one method. | ||
| userid | Your Registered Username | Your registered username; use if apiKey isn't provided. Signup for User ID |
| password | Your Password | URL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key |
| Header (optional) Parameters | ||
| apiKey | Your unique apiKey | apiKey needs to be sent as HTTP header when you are not using userid-password method. You can avail this from your user control panel and use instead of userid-password HTTP Request parameter. Please do not disclose this to anyone. |
| Parameter | Type | Required | Description |
|---|---|---|---|
subject | String | Yes | Ticket subject (5-200 characters). Cannot be a URL. Must include letters or numbers |
message | String | Yes | Detailed message describing your issue (5-10000 characters) |
output | String | Optional | Response format. Use json for JSON response (recommended) |
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://unify.smsgateway.center/SMSApi/support/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array(
'userid' => 'YourUsername',
'password' => 'YourPassword',
'subject' => 'Unable to send SMS to DND numbers',
'message' => 'I am getting error when trying to send SMS to DND numbers. Error code 1001 appears. Please help me resolve this issue.',
'output' => 'json'
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"response": {
"api": "support",
"action": "create",
"status": "success",
"msg": "Support ticket created successfully - Ticket ID: 9320799726018928",
"code": 200,
"count": 1,
"ticket": {
"ticketId": "9320799726018928",
"id": 12345,
"status": "open",
"timestamp": "2025-12-04T15:14:02+05:30"
}
}
}
Reply to Ticket
Add a reply to an existing support ticket to continue the conversation. Requires the ticket ID from when the ticket was created.
API Endpoint
https://unify.smsgateway.center/SMSApi/support/replyHTTP Method
POST
| Key | Value | Description |
|---|---|---|
| Login Credentials (Required) | ||
| Authenticate your API request using userid-password or apiKey—choose one method. | ||
| userid | Your Registered Username | Your registered username; use if apiKey isn't provided. Signup for User ID |
| password | Your Password | URL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key |
| Header (optional) Parameters | ||
| apiKey | Your unique apiKey | apiKey needs to be sent as HTTP header when you are not using userid-password method. You can avail this from your user control panel and use instead of userid-password HTTP Request parameter. Please do not disclose this to anyone. |
| Parameter | Type | Required | Description |
|---|---|---|---|
ticketId | String | Yes | Unique ticket ID (UUID format, e.g., "9320799726018928") |
message | String | Yes | Reply message (5-10000 characters) |
output | String | Optional | Response format. Use json for JSON response (recommended) |
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://unify.smsgateway.center/SMSApi/support/reply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array(
'userid' => 'YourUsername',
'password' => 'YourPassword',
'ticketId' => '9320799726018928',
'message' => 'I tried clearing cache but still facing the same issue. Can you please investigate further?',
'output' => 'json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"response": {
"api": "support",
"action": "reply",
"status": "success",
"msg": "Reply submitted successfully - Reply ID: 12346",
"code": 200,
"count": 1,
"reply": {
"replyId": 12346,
"ticketId": "9320799726018928",
"timestamp": "2025-12-04T16:15:00+05:30"
}
}
}
Read Tickets
Retrieve support tickets with two modes: (1) Read single ticket with full conversation, or (2) Read all tickets with pagination and filters.
API Endpoint
https://unify.smsgateway.center/SMSApi/support/readHTTP Method
POST GET
| Key | Value | Description |
|---|---|---|
| Login Credentials (Required) | ||
| Authenticate your API request using userid-password or apiKey—choose one method. | ||
| userid | Your Registered Username | Your registered username; use if apiKey isn't provided. Signup for User ID |
| password | Your Password | URL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key |
| Header (optional) Parameters | ||
| apiKey | Your unique apiKey | apiKey needs to be sent as HTTP header when you are not using userid-password method. You can avail this from your user control panel and use instead of userid-password HTTP Request parameter. Please do not disclose this to anyone. |
| Parameter | Type | Required | Description |
|---|---|---|---|
ticketId | String | Optional | If provided, returns single ticket with full conversation. If omitted, returns all tickets |
status | String | Optional | Filter by status: open, closed, starred. Default: all except closed |
limit | Integer | Optional | Number of tickets per page (1-500). Default: 50 |
offset | Integer | Optional | Number of tickets to skip for pagination. Default: 0 |
output | String | Optional | Response format. Use json for JSON response (recommended) |
Mode 1: Read Single Ticket with Conversation
curl --location 'https://unify.smsgateway.center/SMSApi/support/read?userid=your_username&password=your_password&ticketId=9320799726018928&output=json'{
"response": {
"api": "support",
"action": "read",
"status": "success",
"msg": "Ticket retrieved successfully",
"code": 200,
"count": 1,
"ticket": {
"ticketId": "9320799726018928",
"id": 12345,
"subject": "Unable to send SMS to DND numbers",
"message": "I am getting error when trying to send SMS to DND numbers...",
"status": "answered",
"starred": false,
"isRead": true,
"isAnswered": true,
"createdAt": "2025-12-04T15:14:02+05:30",
"replies": [
{
"replyId": 12346,
"message": "Thank you for contacting us. Please check your DLT settings...",
"isFromAdmin": true,
"createdAt": "2025-12-04T16:00:00+05:30"
},
{
"replyId": 12347,
"message": "I tried clearing cache but still facing the same issue.",
"isFromAdmin": false,
"createdAt": "2025-12-04T16:15:00+05:30"
}
]
}
}
}
Mode 2: Read All Tickets with Pagination
# Get all open tickets
curl --location 'https://unify.smsgateway.center/SMSApi/support/read?userid=your_username&password=your_password&output=json'
# With filters and pagination
curl --location 'https://unify.smsgateway.center/SMSApi/support/read?userid=your_username&password=your_password&status=open&limit=50&offset=0&output=json'{
"response": {
"api": "support",
"action": "read",
"status": "success",
"msg": "Tickets retrieved successfully - Total: 125",
"code": 200,
"count": 125,
"data": {
"tickets": [
{
"ticketId": "9320799726018928",
"id": 12345,
"subject": "Unable to send SMS to DND numbers",
"message": "I am getting error...",
"status": "answered",
"starred": false,
"isRead": true,
"isAnswered": true,
"createdAt": "2025-12-04T15:14:02+05:30"
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 125,
"returned": 1
}
}
}
}
Star/Unstar Ticket
Mark important tickets with a star for quick access, or remove the star when no longer needed.
API Endpoint
https://unify.smsgateway.center/SMSApi/support/starHTTP Method
POST
| Key | Value | Description |
|---|---|---|
| Login Credentials (Required) | ||
| Authenticate your API request using userid-password or apiKey—choose one method. | ||
| userid | Your Registered Username | Your registered username; use if apiKey isn't provided. Signup for User ID |
| password | Your Password | URL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key |
| Header (optional) Parameters | ||
| apiKey | Your unique apiKey | apiKey needs to be sent as HTTP header when you are not using userid-password method. You can avail this from your user control panel and use instead of userid-password HTTP Request parameter. Please do not disclose this to anyone. |
| Parameter | Type | Required | Description |
|---|---|---|---|
ticketId | String | Yes | Unique ticket ID (UUID format) |
status | Integer | Yes | Star status: 1 to star, 0 to unstar |
output | String | Optional | Response format. Use json for JSON response (recommended) |
curl --location 'https://unify.smsgateway.center/SMSApi/support/star' \
--form 'userid="your_username"' \
--form 'password="your_password"' \
--form 'ticketId="9320799726018928"' \
--form 'status="1"' \
--form 'output="json"'{
"response": {
"api": "support",
"action": "star",
"status": "success",
"msg": "Ticket starred successfully",
"code": 200,
"count": 1,
"star": {
"ticketId": "9320799726018928",
"starred": true,
"timestamp": "2025-12-04T17:00:00+05:30"
}
}
}
Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
200 | 200 | Success - Request completed successfully |
| Create Ticket Errors (426-436) | ||
426 | 400 | Subject is required |
427 | 400 | Subject is too short (minimum 5 characters) |
428 | 400 | Subject is too long (maximum 200 characters) |
429 | 400 | Subject cannot be a URL |
430 | 400 | Subject must include letters or numbers |
431 | 400 | Message is required |
432 | 400 | Message is too short (minimum 5 characters) |
433 | 400 | Message is too long (maximum 10000 characters) |
434 | 400 | You already have an open ticket with similar message |
435 | 500 | Failed to create support ticket. Please try again |
436 | 500 | An error occurred while creating the ticket |
| Reply Errors (437-445) | ||
437 | 400 | Ticket ID is required |
438 | 400 | Message is required |
439 | 400 | Message is too short (minimum 5 characters) |
440 | 400 | Message is too long (maximum 10000 characters) |
441 | 404 | Ticket not found |
442 | 403 | You do not have permission to reply to this ticket |
443 | 409 | You already have a similar reply in an open ticket |
444 | 500 | Failed to submit reply. Please try again |
445 | 500 | An error occurred while submitting the reply |
| Read Errors (446-447) | ||
446 | 404 | Ticket not found or you do not have permission to view it |
447 | 500 | An error occurred while retrieving tickets |
| Star Errors (448-454) | ||
448 | 400 | Ticket ID is required |
449 | 400 | Status is required (1 to star, 0 to unstar) |
450 | 400 | Status must be 1 (star) or 0 (unstar) |
451 | 404 | Ticket not found |
452 | 403 | You do not have permission to modify this ticket |
453 | 400 | No changes made. Ticket may already be in the requested state |
454 | 500 | An error occurred while updating star status |
| General Errors (455-457) | ||
455 | 405 | Update action is not supported. Use reply action instead |
456 | 405 | Delete action is not available via API |
457 | 400 | Invalid action |
Understanding Ticket Status
| Status | Description | When Applied |
|---|---|---|
| open | Ticket is open and awaiting response | When ticket is created and not yet answered by admin |
| answered | Admin has replied to the ticket | After admin provides a response to your ticket |
| closed | Ticket is closed and resolved | When ticket is marked as closed by admin |
Integration Examples
Example 1: Create Ticket from Mobile App
// React Native / JavaScript example
async function createSupportTicket(subject, message) {
const formData = new FormData();
formData.append('userid', 'YourUsername');
formData.append('password', 'YourPassword');
formData.append('subject', subject);
formData.append('message', message);
formData.append('output', 'json');
try {
const response = await fetch('https://unify.smsgateway.center/SMSApi/support/create', {
method: 'POST',
body: formData
});
const data = await response.json();
if (data.response.status === 'success') {
const ticketId = data.response.ticket.ticketId;
console.log(`Ticket created: ${ticketId}`);
return ticketId;
} else {
console.error(`Error: ${data.response.msg}`);
}
} catch (error) {
console.error('Network error:', error);
}
}
// Usage
createSupportTicket(
'API Integration Issue',
'Getting 401 error when calling send SMS API. Please help.'
);Example 2: Load Tickets with Pagination
import requests
def get_tickets(status='open', page=1, per_page=50):
offset = (page - 1) * per_page
url = 'https://unify.smsgateway.center/SMSApi/support/read'
params = {
'userid': 'YourUsername',
'password': 'YourPassword',
'status': status,
'limit': per_page,
'offset': offset,
'output': 'json'
}
response = requests.get(url, params=params)
data = response.json()
if data['response']['status'] == 'success':
tickets = data['response']['data']['tickets']
pagination = data['response']['data']['pagination']
print(f"Found {pagination['total']} tickets")
print(f"Showing {pagination['returned']} tickets (Page {page})")
for ticket in tickets:
print(f"\n{ticket['subject']} - Status: {ticket['status']}")
print(f" Ticket ID: {ticket['ticketId']}")
return tickets, pagination
else:
print(f"Error: {data['response']['msg']}")
# Usage
tickets, pagination = get_tickets(status='open', page=1)Example 3: View Ticket Conversation
<?php
function getTicketConversation($ticketId) {
$url = "https://unify.smsgateway.center/SMSApi/support/read";
$params = http_build_query([
'userid' => 'YourUsername',
'password' => 'YourPassword',
'ticketId' => $ticketId,
'output' => 'json'
]);
$response = file_get_contents($url . '?' . $params);
$data = json_decode($response, true);
if ($data['response']['status'] === 'success') {
$ticket = $data['response']['ticket'];
echo "Subject: " . $ticket['subject'] . "\n\n";
echo "Original Message:\n" . $ticket['message'] . "\n\n";
echo "Conversation:\n";
foreach ($ticket['replies'] as $reply) {
$from = $reply['isFromAdmin'] ? 'Admin' : 'You';
echo "[$from] " . $reply['message'] . "\n";
}
}
}
// Usage
getTicketConversation('9320799726018928');
Best Practices
Recommendations
- Clear Subject Lines: Use descriptive subjects (not URLs) to help support team understand your issue quickly
- Detailed Messages: Provide comprehensive information including error codes, steps to reproduce, and screenshots
- Check for Duplicates: Search existing tickets before creating new ones to avoid duplicates
- Star Important Tickets: Use star feature to mark critical issues for quick access
- Pagination: Implement proper pagination when loading ticket lists (max 500 per request)
- Error Handling: Implement comprehensive error handling for all error codes (426-457)
- Security: Never expose credentials in error messages or logs
- Ticket IDs: Store ticket IDs securely for future reference and replies
- Status Filters: Use status filters to organize tickets by open, closed, or starred
- Activity Logging: All operations are logged automatically for audit compliance
Use Cases
In-App Support
Integrate support ticket system directly into your mobile app for seamless customer service.
Priority Management
Star critical tickets to prioritize and track important issues effectively.
Ticket Dashboard
Build comprehensive ticket management dashboards with filtering and pagination.
Conversation Tracking
View complete conversation history with admin replies in chronological order.
Testimonials
Why do Great Businesses Trust SMS Gateway Center?

