Skip to content

Instantly share code, notes, and snippets.

@eug-L
Last active October 14, 2024 01:58
Show Gist options
  • Save eug-L/c6d0676cf692ec5f330ece73c0f8e88f to your computer and use it in GitHub Desktop.
Save eug-L/c6d0676cf692ec5f330ece73c0f8e88f to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Freshdesk API
version: 1.0.0
description: API for creating tickets in Freshdesk.
servers:
- url: https://tawk.freshdesk.com/api/v2
description: Freshdesk API Server
paths:
/tickets:
post:
summary: Create a new ticket
description: Creates a new support ticket in the Freshdesk system.
operationId: createTicket
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- description
- subject
- email
- name
- priority
- status
- type
properties:
description:
type: string
description: Details about the issue.
example: "Details about the issue..."
subject:
type: string
description: The subject of the support ticket.
example: "Support Needed..."
email:
type: string
format: email
description: The email address of the requester.
example: "[email protected]"
name:
type: string
description: The name of the requester.
example: "Tom from Outer Space"
priority:
type: integer
description: The priority level of the ticket (1=low, 2=medium, 3=high, 4=urgent).
example: 1
enum: [1]
default: 1
status:
type: integer
description: The status of the ticket (2=open, 3=pending, 4=resolved, 5=closed).
example: 2
enum: [2]
default: 2
type:
type: string
description: Ticket category (Question, Incident, Problem, Feature Request, Refund).
example: "Question"
enum: ["Question"]
responses:
'201':
description: Ticket created successfully.
content:
application/json:
schema:
type: object
properties:
id:
type: integer
description: The ID of the created ticket.
example: 1
status:
type: integer
description: The status of the ticket.
example: 2
priority:
type: integer
description: The priority of the ticket.
example: 1
type:
type: string
description: The type of the ticket.
example: "space"
# Other fields omitted for brevity...
'400':
description: Invalid request, bad input data.
'401':
description: Unauthorized, invalid API key.
components:
securitySchemes:
apiKeyAuth:
type: http
scheme: basic
description: Use the Freshdesk API key as the username and 'X' as the password.
security:
- apiKeyAuth: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment