Skip to content

FreshserviceClient

Attributes

ListUsersResponse module-attribute

ListUsersResponse = List[Dict[str, Any]]

TRIGGER_OPERATIONS module-attribute

TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnTicketCreatedV2': {'operation_id': 'OnTicketCreatedV2', 'path': '/{connectionId}/trigger/api/v2/tickets', 'method': 'get', 'required_parameters': [], 'callback_payload_type': 'ListTicketResponse'}}

Classes

AddNoteResponse dataclass

AddNoteResponse(*, conversation: Optional[Dict[str, Any]] = None)

Response for Add a note to a ticket

CreateUpdateTicketResponse dataclass

CreateUpdateTicketResponse(*, ticket: Optional[Dict[str, Any]] = None)

Response for Create a ticket

ListTicketResponse dataclass

ListTicketResponse(*, created_at: Optional[str] = None, department_id: Optional[int] = None, due_by: Optional[str] = None, group_id: Optional[int] = None, id: Optional[int] = None, is_escalated: Optional[bool] = None, priority: Optional[int] = None, requester_id: Optional[int] = None, responder_id: Optional[int] = None, source: Optional[int] = None, spam: Optional[bool] = None, status: Optional[int] = None, subject: Optional[str] = None, type_: Optional[str] = None, updated_at: Optional[str] = None, description_text: Optional[str] = None, description: Optional[str] = None, to_emails: Optional[List[str]] = None)

Response for When a ticket is created

Attributes

created_at class-attribute instance-attribute
created_at: Optional[str] = dataclass_field(default=None, kw_only=True)

yyyy-MM-ddTHH:mm:ss.fffZ

due_by class-attribute instance-attribute
due_by: Optional[str] = dataclass_field(default=None, kw_only=True)

yyyy-MM-ddTHH:mm:ss.fffZ

group_id class-attribute instance-attribute
group_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of Group to which the ticket is assigned.

id class-attribute instance-attribute
id: Optional[int] = dataclass_field(default=None, kw_only=True)

Unique Id of the ticket.

is_escalated class-attribute instance-attribute
is_escalated: Optional[bool] = dataclass_field(default=None, kw_only=True)

Set to true if an escalation was sent.

priority class-attribute instance-attribute
priority: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the priority of the ticket.

requester_id class-attribute instance-attribute
requester_id: Optional[int] = dataclass_field(default=None, kw_only=True)

User-id of the requester. For existing contacts, requester_id can be passed instead of email.

responder_id class-attribute instance-attribute
responder_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of the agent to whom the ticket is assigned.

source class-attribute instance-attribute
source: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the channel through which the ticket was created.

spam class-attribute instance-attribute
spam: Optional[bool] = dataclass_field(default=None, kw_only=True)

Set as true if the ticket is marked as spam.

status class-attribute instance-attribute
status: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the status of the ticket.

subject class-attribute instance-attribute
subject: Optional[str] = dataclass_field(default=None, kw_only=True)

Ticket subject.

type_ class-attribute instance-attribute
type_: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'type'})

Type property field as defined in ticket fields.

updated_at class-attribute instance-attribute
updated_at: Optional[str] = dataclass_field(default=None, kw_only=True)

yyyy-MM-ddTHH:mm:ss.fffZ

description_text class-attribute instance-attribute
description_text: Optional[str] = dataclass_field(default=None, kw_only=True)

Description of the problem.

description class-attribute instance-attribute
description: Optional[str] = dataclass_field(default=None, kw_only=True)

HTML content of the ticket. Description and description_html should not be passed together.

to_emails class-attribute instance-attribute
to_emails: Optional[List[str]] = dataclass_field(default=None, kw_only=True)

Email addresses to which the incoming ticket email was sent.

CreateTicketRequest dataclass

CreateTicketRequest(subject: str, status: str, priority: str, description: str, *, requester_id: Optional[int] = None, email: Optional[str] = None, phone: Optional[str] = None, name: Optional[str] = None, urgency: Optional[str] = None, impact: Optional[str] = None, source: Optional[str] = None)

Definition: CreateTicket_Request

Attributes

requester_id class-attribute instance-attribute
requester_id: Optional[int] = dataclass_field(default=None, kw_only=True)

User-id of the requester. One of the Requester ID, Requester Email and Requester Phone is required

email class-attribute instance-attribute
email: Optional[str] = dataclass_field(default=None, kw_only=True)

Email of the requester. One of the Requester ID, Requester Email and Requester Phone is required

phone class-attribute instance-attribute
phone: Optional[str] = dataclass_field(default=None, kw_only=True)

Phone number of the requester. One of the Requester ID, Requester Email and Requester Phone is required

name class-attribute instance-attribute
name: Optional[str] = dataclass_field(default=None, kw_only=True)

Name of the requester. This is a required field only if Requester Phone value is provided

subject instance-attribute
subject: str

The subject of the ticket.

status instance-attribute
status: str

Status of the ticket.

priority instance-attribute
priority: str

The priority of the ticket (such as Low, Medium, or High).

description instance-attribute
description: str

The description of the ticket.

urgency class-attribute instance-attribute
urgency: Optional[str] = dataclass_field(default=None, kw_only=True)

Urgency of the problem (such as Low, Medium or High).

impact class-attribute instance-attribute
impact: Optional[str] = dataclass_field(default=None, kw_only=True)

Impact of the problem (such as Low, Medium or High).

source class-attribute instance-attribute
source: Optional[str] = dataclass_field(default=None, kw_only=True)

The channel through which the ticket was created.

UpdateTicketRequest dataclass

UpdateTicketRequest(*, requester_id: Optional[int] = None, subject: Optional[str] = None, status: Optional[str] = None, priority: Optional[str] = None, urgency: Optional[str] = None, impact: Optional[str] = None, source: Optional[str] = None)

Definition: UpdateTicket_Request

Attributes

requester_id class-attribute instance-attribute
requester_id: Optional[int] = dataclass_field(default=None, kw_only=True)

User-id of the requester. For existing contacts, requester_id can be passed instead of email.

subject class-attribute instance-attribute
subject: Optional[str] = dataclass_field(default=None, kw_only=True)

The subject of the ticket.

status class-attribute instance-attribute
status: Optional[str] = dataclass_field(default=None, kw_only=True)

Status of the ticket.

priority class-attribute instance-attribute
priority: Optional[str] = dataclass_field(default=None, kw_only=True)

The priority of the ticket (such as Low, Medium, or High).

urgency class-attribute instance-attribute
urgency: Optional[str] = dataclass_field(default=None, kw_only=True)

Urgency of the problem (such as Low, Medium or High).

impact class-attribute instance-attribute
impact: Optional[str] = dataclass_field(default=None, kw_only=True)

Impact of the problem (such as Low, Medium or High).

source class-attribute instance-attribute
source: Optional[str] = dataclass_field(default=None, kw_only=True)

The channel through which the ticket was created.

AddNoteRequest dataclass

AddNoteRequest(body: str, *, private: Optional[bool] = None)

Definition: AddNote_Request

Attributes

body instance-attribute
body: str

The note to be added to the ticket.

private class-attribute instance-attribute
private: Optional[bool] = dataclass_field(default=None, kw_only=True)

Set to true if message is private.

TicketResponse dataclass

TicketResponse(*, created_at: Optional[str] = None, deleted: Optional[bool] = None, department_id_value: Optional[int] = None, display_id: Optional[int] = None, due_by: Optional[str] = None, group_id: Optional[int] = None, id: Optional[int] = None, impact: Optional[int] = None, isescalated: Optional[bool] = None, owner_id: Optional[str] = None, priority: Optional[int] = None, requester_id: Optional[int] = None, responder_id: Optional[int] = None, source: Optional[int] = None, spam: Optional[bool] = None, status: Optional[int] = None, subject: Optional[str] = None, ticket_type: Optional[str] = None, to_email: Optional[str] = None, updated_at: Optional[str] = None, urgency: Optional[int] = None, description: Optional[str] = None, description_html: Optional[str] = None, status_name: Optional[str] = None, priority_name: Optional[str] = None, source_name: Optional[str] = None, responder_name: Optional[str] = None, to_emails: Optional[List[str]] = None, department_name: Optional[str] = None, assoc_problem_id: Optional[int] = None, assoc_change_id: Optional[int] = None, assoc_change_cause_id: Optional[int] = None, assoc_asset_id: Optional[int] = None, urgency_name: Optional[str] = None, impact_name: Optional[str] = None)

Definition: Ticket_Response

Attributes

created_at class-attribute instance-attribute
created_at: Optional[str] = dataclass_field(default=None, kw_only=True)

yyyy-MM-ddTHH:mm:ss.fffZ

deleted class-attribute instance-attribute
deleted: Optional[bool] = dataclass_field(default=None, kw_only=True)

Set as true if the ticket is deleted/trashed. Deleted tickets will not be considered in any views except 'deleted' filter.

display_id class-attribute instance-attribute
display_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Ticket Id specific to your account.

due_by class-attribute instance-attribute
due_by: Optional[str] = dataclass_field(default=None, kw_only=True)

yyyy-MM-ddTHH:mm:ss.fffZ

group_id class-attribute instance-attribute
group_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of Group to which the ticket is assigned.

id class-attribute instance-attribute
id: Optional[int] = dataclass_field(default=None, kw_only=True)

Unique Id of the ticket.

impact class-attribute instance-attribute
impact: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the impact of the problem.

isescalated class-attribute instance-attribute
isescalated: Optional[bool] = dataclass_field(default=None, kw_only=True)

Set to true if an escalation was sent.

owner_id class-attribute instance-attribute
owner_id: Optional[str] = dataclass_field(default=None, kw_only=True)

Id of the agent to whom the problem is assigned.

priority class-attribute instance-attribute
priority: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the priority of the ticket.

requester_id class-attribute instance-attribute
requester_id: Optional[int] = dataclass_field(default=None, kw_only=True)

User-id of the requester. For existing contacts, requester_id can be passed instead of email.

responder_id class-attribute instance-attribute
responder_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of the agent to whom the ticket is assigned.

source class-attribute instance-attribute
source: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the channel through which the ticket was created.

spam class-attribute instance-attribute
spam: Optional[bool] = dataclass_field(default=None, kw_only=True)

Set as true if the ticket is marked as spam.

status class-attribute instance-attribute
status: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the status of the ticket.

subject class-attribute instance-attribute
subject: Optional[str] = dataclass_field(default=None, kw_only=True)

Ticket subject.

ticket_type class-attribute instance-attribute
ticket_type: Optional[str] = dataclass_field(default=None, kw_only=True)

Type property field as defined in ticket fields.

to_email class-attribute instance-attribute
to_email: Optional[str] = dataclass_field(default=None, kw_only=True)

Email address to which the incoming ticket email was sent.

updated_at class-attribute instance-attribute
updated_at: Optional[str] = dataclass_field(default=None, kw_only=True)

yyyy-MM-ddTHH:mm:ss.fffZ

urgency class-attribute instance-attribute
urgency: Optional[int] = dataclass_field(default=None, kw_only=True)

A number representing the urgency of the problem.

description class-attribute instance-attribute
description: Optional[str] = dataclass_field(default=None, kw_only=True)

Description of the problem.

description_html class-attribute instance-attribute
description_html: Optional[str] = dataclass_field(default=None, kw_only=True)

HTML content of the ticket. Description and description_html should not be passed together.

status_name class-attribute instance-attribute
status_name: Optional[str] = dataclass_field(default=None, kw_only=True)

Status of the ticket.

priority_name class-attribute instance-attribute
priority_name: Optional[str] = dataclass_field(default=None, kw_only=True)

Priority of the ticket.

source_name class-attribute instance-attribute
source_name: Optional[str] = dataclass_field(default=None, kw_only=True)

The channel through which the ticket was created.

responder_name class-attribute instance-attribute
responder_name: Optional[str] = dataclass_field(default=None, kw_only=True)

Name of the agent to whom the ticket is assigned.

to_emails class-attribute instance-attribute
to_emails: Optional[List[str]] = dataclass_field(default=None, kw_only=True)

Email addresses to which the incoming ticket email was sent.

department_name class-attribute instance-attribute
department_name: Optional[str] = dataclass_field(default=None, kw_only=True)

Name of the department.

assoc_problem_id class-attribute instance-attribute
assoc_problem_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of the associated problem to the ticket.

assoc_change_id class-attribute instance-attribute
assoc_change_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of the associated change to the problem.

assoc_change_cause_id class-attribute instance-attribute
assoc_change_cause_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of the change causing the ticket.

assoc_asset_id class-attribute instance-attribute
assoc_asset_id: Optional[int] = dataclass_field(default=None, kw_only=True)

Id of the asset associated to the ticket.

urgency_name class-attribute instance-attribute
urgency_name: Optional[str] = dataclass_field(default=None, kw_only=True)

Urgency of the problem.

impact_name class-attribute instance-attribute
impact_name: Optional[str] = dataclass_field(default=None, kw_only=True)

Impact of the problem.

UpdateTicketResponse dataclass

UpdateTicketResponse(*, ticket: Optional[Dict[str, Any]] = None)

Definition: UpdateTicket_Response

FreshserviceClient

FreshserviceClient(connection_runtime_url: str, credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)

Bases: ConnectorClientBase

Typed client for freshservice connector.

Initialize a FreshserviceClient.

Parameters:

Name Type Description Default
connection_runtime_url str

The connection runtime URL from Azure Portal.

required
credential AsyncTokenCredential | AzureKeyCredential

Caller-owned Azure Core credential.

required
max_retry_attempts int

The maximum number of request attempts.

3
timeout float

The network timeout in seconds for each request. The value configures Azure Core retry and transport deadlines. Nonpositive values disable SDK and transport deadlines.

30.0
use_exponential_backoff bool

Whether retries use exponential backoff.

True
initial_retry_delay_seconds float

The initial retry delay in seconds.

0.5
maximum_retry_delay_seconds float

The maximum retry delay in seconds.

120.0
retry_jitter_factor float

The jitter fraction applied to retry delays.

0.1
retry_unsafe_http_methods bool

Whether unsafe HTTP methods may be retried.

False
transport Optional[AsyncHttpTransport]

Optional Azure Core async HTTP transport closed by the client through its asynchronous lifecycle.

None
**kwargs Any

Optional Azure Core pipeline policy settings.

{}

Methods:

add_note async
add_note(input: AddNoteRequest | Mapping[str, Any], ticket_id: int, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Add a note to a ticket

Add a private or public note to a ticket.

Swagger operation ID: AddNoteV2.

Parameters:

Name Type Description Default
input AddNoteRequest | Mapping[str, Any]

The request body. Mapping keys use serialized Swagger wire names.

required
ticket_id int

The ticket id to update.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

create_ticket async
create_ticket(input: CreateTicketRequest | Mapping[str, Any], *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Create a ticket

Create a ticket.

Swagger operation ID: CreateTicketV2.

Parameters:

Name Type Description Default
input CreateTicketRequest | Mapping[str, Any]

The request body. Mapping keys use serialized Swagger wire names.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

update_ticket async
update_ticket(input: UpdateTicketRequest | Mapping[str, Any], ticket_id: int, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Update a ticket

Update a ticket (only specified values will be updated).

Swagger operation ID: UpdateTicketV2.

Parameters:

Name Type Description Default
input UpdateTicketRequest | Mapping[str, Any]

The request body. Mapping keys use serialized Swagger wire names.

required
ticket_id int

The ticket id to update.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.