Skip to main content
GET
/
hubspot
/
ticket-details
/
{ticketId}
Get detailed information of a specific HubSpot ticket
curl --request GET \
  --url http://localhost:2000/hubspot/ticket-details/{ticketId} \
  --header 'Authorization: Bearer <token>'
{
  "message": "",
  "data": {
    "id": "123456789"
  }
}
Retrieves the full details of a single HubSpot ticket using its unique ticketId. Requires authentication and a valid HubSpot ticket ID. The endpoint validates the ticket ID before fetching data and returns complete ticket metadata including content, related contacts, categories, and assigned agent.

Request

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token

Path Parameters

ParameterTypeRequiredDescription
ticketIdstringYesUnique HubSpot ticket identifier

Parameter Details

  • ticketId: Must be a valid HubSpot ticket ID
  • Format: String identifier from HubSpot system
  • Validation: Endpoint validates ticket ID before processing

Response

200 OK - Successfully retrieved ticket details

{
  "message": "",
  "data": {
    "ticketId": "12345678",
    "subject": "Late Driver - Airport Pickup",
    "content": "Customer reported that driver was 45 minutes late for scheduled airport pickup. Passenger had to wait at arrivals and missed important meeting. Requesting refund for inconvenience.",
    "feedbackCategory": "Late Driver",
    "agentInvolved": "abdullah",
    "status": "closed",
    "priority": "high",
    "createdAt": "2025-10-01T10:30:00.000Z",
    "updatedAt": "2025-10-01T14:45:00.000Z",
    "closedAt": "2025-10-01T14:45:00.000Z",
    "departmentCode": "OPS",
    "passenger_name": "John Smith",
    "passenger_email": "[email protected]",
    "passenger_phone": "+1-555-123-",
    "chauffeur_name": "Mike Johnson",
    "chauffeur_id": "CH78",
    "reservation_id": "RES",
    "pickup_location": "J",
    "dropoff_location": "o",
    "scheduled_time": "2025-10-01T09:00:00.000Z",
    "actual_time": "2025-10-01T09:45:00.000Z",
    "delay_minutes": 45,
    "resolution_notes": "Apology issued, partial refund processed, driver coached on punctuality",
    "tags": ["urgent", "airport", "refund"],
    "custom_properties": {
      "vehicle_type": "Luxury Sedan",
      "service_level": "Premium",
      "complaint_type": "delay"
    },
    "associated_contacts": [
      {
        "id": "contact-123",
        "name": "John Smith",
        "email": "[email protected]",
        "type": "passenger"
      },
      {
        "id": "contact-123",
        "name": "Mike Johnson",
        "email": "[email protected]",
        "type": "chauffeur"
      }
    ],
    "activity_log": [
      {
        "timestamp": "2025-10-01T10:30:00.000Z",
        "action": "created",
        "user": "system",
        "notes": "Ticket automatically created from feedback form"
      },
      {
        "timestamp": "2025-10-01T11:00:00.000Z",
        "action": "assigned",
        "user": "admin",
        "notes": "Assigned to agent abdullah"
      },
      {
        "timestamp": "2025-10-01T14:45:00.000Z",
        "action": "resolved",
        "user": "abdullah",
        "notes": "Issue resolved with customer satisfaction"
      }
    ]
  }
}

400 Bad Request

{
  "error": {
    "code": "INVALID_TICKET_ID",
    "message": "Invalid or missing ticket ID"
  }
}

404 Not Found

{
  "error": {
    "code": "TICKET_NOT_FOUND",
    "message": "Ticket not found"
  }
}

401 Unauthorized

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid token"
  }
}

500 Internal Server Error

{
  "error": {
    "code": "SERVER_ERROR",
    "message": "Internal server error"
  }
}

Example

curl -X GET 'http://localhost:2000/hubspot/ticket-details/123456' \
  -H 'Authorization:Bearer your-jwt-token'

Data Fields Explained

Core Ticket Information

FieldTypeDescription
ticketIdstringUnique HubSpot ticket identifier
subjectstringTicket subject line
contentstringFull ticket content/description
feedbackCategorystringFeedback category assigned to ticket
agentInvolvedstringAgent handling the ticket
statusstringCurrent ticket status
prioritystringTicket priority level (low, medium, high)

Timestamps

FieldTypeDescription
createdAtstringTicket creation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
closedAtstringTicket closure timestamp (ISO 8601)

Service Information

FieldTypeDescription
departmentCodestringDepartment code associated with ticket
reservation_idstringAssociated reservation ID
pickup_locationstringPickup location details
dropoff_locationstringDropoff location details
scheduled_timestringScheduled service time (ISO 8601)
actual_timestringActual service time (ISO 8601)
delay_minutesintegerDelay in minutes (if applicable)

People Information

FieldTypeDescription
passenger_namestringPassenger name
passenger_emailstringPassenger email address
passenger_phonestringPassenger phone number
chauffeur_namestringChauffeur name
chauffeur_idstringChauffeur ID

Additional Information

FieldTypeDescription
resolution_notesstringNotes about ticket resolution
tagsarrayTags associated with ticket
custom_propertiesobjectCustom HubSpot properties
associated_contactsarrayRelated contact information
activity_logarrayTicket activity history

Use Cases

  • Ticket Details View: Display complete ticket information
  • Customer Service: Provide detailed ticket history
  • Analytics: Analyze ticket patterns and details
  • Reporting: Generate detailed ticket reports
  • Audit Trail: Track ticket activity and changes

Implementation Examples

React Ticket Detail Component

import React, { useState, useEffect } from 'react';

function TicketDetail({ ticketId }) {
  const [ticket, setTicket] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    fetchTicketDetails();
  }, [ticketId]);

  const fetchTicketDetails = async () => {
    try {
      const response = await fetch(`/hubspot/ticket-details/${ticketId}`, {
        headers: { 'Authorization': `Bearer ${token}` }
      });
      
      if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
      }
      
      const data = await response.json();
      setTicket(data.data);
    } catch (error) {
      setError(error.message);
    } finally {
      setLoading(false);
    }
  };

  if (loading) return <LoadingSpinner />;
  if (error) return <ErrorMessage error={error} />;
  if (!ticket) return <div>No ticket found</div>;

  return (
    <div className="ticket-detail">
      <TicketHeader ticket={ticket} />
      <TicketContent ticket={ticket} />
      <TicketActivity activity={ticket.activity_log} />
      <TicketContacts contacts={ticket.associated_contacts} />
    </div>
  );
}

Activity Timeline Component

function ActivityTimeline({ activity }) {
  return (
    <div className="activity-timeline">
      <h3>Activity Log</h3>
      {activity.map((item, index) => (
        <div key={index} className="activity-item">
          <div className="activity-time">
            {new Date(item.timestamp).toLocaleString()}
          </div>
          <div className="activity-action">{item.action}</div>
          <div className="activity-user">{item.user}</div>
          <div className="activity-notes">{item.notes}</div>
        </div>
      ))}
    </div>
  );
}

Ticket Status Badge

function TicketStatus({ status }) {
  const statusConfig = {
    'open': { color: 'orange', label: 'Open' },
    'closed': { color: 'green', label: 'Closed' },
    'pending': { color: 'blue', label: 'Pending' },
    'escalated': { color: 'red', label: 'Escalated' }
  };

  const config = statusConfig[status] || { color: 'gray', label: status };

  return (
    <span className={`status-badge status-${config.color}`}>
      {config.label}
    </span>
  );
}

Best Practices

  1. Error Handling: Handle ticket not found and invalid ID cases
  2. Loading States: Show loading indicators while fetching details
  3. Data Validation: Validate ticket ID format before API call
  4. Caching: Cache ticket details for short periods
  5. Responsive Design: Ensure detail view works on mobile devices

Performance Considerations

  • Data Size: Ticket details can be large with activity logs
  • API Calls: Minimize unnecessary detail API calls
  • Images: Handle any associated images efficiently
  • Real-time Updates: Consider WebSocket for live updates
  • Use /hubspot/tickets/list to browse and find tickets
  • Use /hubspot/tickets/list/filters for filter options
  • Use /hubspot/tickets/list/export to export ticket data

Notes

  • Ticket details include all available HubSpot properties
  • Activity log shows chronological ticket history
  • Associated contacts include passengers, chauffeurs, and staff
  • Custom properties vary based on HubSpot configuration
  • Response time depends on ticket complexity and activity log size

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

ticketId
string
required

Unique HubSpot Ticket ID

Response

Successfully retrieved ticket details

message
string
Example:

""

data
object

HubSpot ticket details