Skip to content

Latest commit

 

History

History
155 lines (123 loc) · 3.38 KB

File metadata and controls

155 lines (123 loc) · 3.38 KB

Fetch Open Tickets

Retrieve all open support tickets for the authenticated user.

Endpoint

POST /tickets/fetchOpenTickets

Description

This endpoint retrieves all open support tickets associated with the authenticated user. Tickets are returned in descending order by creation date. Only tickets with Status = false (open) are included in the results. The Subject field is truncated to 100 characters maximum.

You can filter tickets by search term, platform (ResourceAffected), and priority level.

Authentication

This endpoint requires Bearer token authentication via the Authorization header.

Request Parameters

All parameters are optional.

Parameter Type Required Description
search String No Search term to filter tickets by Subject or Description (case-insensitive)
platform String No Filter by ResourceAffected (e.g., 'renaissance', 'api', 'general', 'overture', 'winners', etc.)
priority Number No Filter by Priority: 1 (Low), 2 (Medium), 3 (High)
page Number No Page number for pagination (default: 1, 20 tickets per page)

Code Examples

cURL

curl -X POST "https://api-v3.sweeppea.com/tickets/fetchOpenTickets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "search": "login issue",
    "platform": "renaissance",
    "priority": 3,
    "page": 1
  }'

JavaScript

const response = await fetch('https://api-v3.sweeppea.com/tickets/fetchOpenTickets', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    search: 'login issue',
    platform: 'renaissance',
    priority: 3,
    page: 1
  })
});

const data = await response.json();
console.log(data);

Python

import requests
import json

url = "https://api-v3.sweeppea.com/tickets/fetchOpenTickets"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "search": "login issue",
    "platform": "renaissance",
    "priority": 3,
    "page": 1
}

response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.json())

Response

200 OK

{
  "Response": true,
  "Data": {
    "TotalTickets": 45,
    "Page": 1,
    "Limit": 20,
    "TotalPages": 3,
    "Tickets": [
      {
        "CaseNumber": "ABC1234",
        "Subject": "Issue with sweepstakes configuration (truncated to 100 chars max)",
        "Date": "2025-01-26T10:00:00.000Z",
        "Priority": 2,
        "ResourceAffected": "renaissance"
      },
      {
        "CaseNumber": "XYZ5678",
        "Subject": "API integration question",
        "Date": "2025-01-25T14:00:00.000Z",
        "Priority": 1,
        "ResourceAffected": "api"
      }
    ]
  }
}

401 Unauthorized

{
  "Response": false,
  "Message": "Invalid or Missing Bearer Token",
  "Code": 401
}

403 Forbidden

{
  "Response": false,
  "Message": "Invalid API Token",
  "Code": 403
}

500 Internal Server Error

{
  "Response": false,
  "Message": "Internal Server Error",
  "Code": 500
}

Notes

  • Results are paginated at 20 tickets per page.
  • The Subject field is truncated to a maximum of 100 characters in the list response.
  • Open tickets have Status = false internally.