Documentation
¶
Index ¶
- Constants
- func GetHelpdeskAttachmentURL(domain string, aid int64) string
- func GetSolutionArticleURL(domain string, aid int64) string
- func ToJSON(o any) string
- func ToJSONIndent(o any) string
- type Actor
- type Agent
- type AgentActive
- type AgentField
- type AgentGroup
- type AgentGroupUnassignedFor
- type AgentRole
- type AgentScoreboardLevel
- type AgentState
- type Approval
- type ApprovalInfo
- type ApprovalSetting
- type ApprovalStatus
- type ApprovalType
- type Article
- type ArticleInfo
- type ArticleStatus
- type ArticleType
- type AssignRole
- type Attachment
- type Attachments
- type Category
- type Conversation
- type ConversationSource
- type Date
- type Delegatee
- type File
- type Files
- type FilterAgentsOption
- type FilterTicketsOption
- type Folder
- type FolderVisibility
- type Freshservice
- func (fs *Freshservice) AddRequesterToRequesterGroup(rgid, rid int64) error
- func (fs *Freshservice) ConvertAgentToRequester(id int64) (*Agent, error)
- func (fs *Freshservice) ConvertRequesterToAgent(id int64) (*Agent, error)
- func (fs *Freshservice) CreateAgent(agent *Agent) (*Agent, error)
- func (fs *Freshservice) CreateAgentGroup(ag *AgentGroup) (*AgentGroup, error)
- func (fs *Freshservice) CreateArticle(article *Article) (*Article, error)
- func (fs *Freshservice) CreateCategory(category *Category) (*Category, error)
- func (fs *Freshservice) CreateChildTicket(tid int64, ticket *Ticket) (*Ticket, error)
- func (fs *Freshservice) CreateFolder(folder *Folder) (*Folder, error)
- func (fs *Freshservice) CreateNote(tid int64, note *Note) (*Conversation, error)
- func (fs *Freshservice) CreateReply(tid int64, reply *Reply) (*Conversation, error)
- func (fs *Freshservice) CreateRequester(requester *Requester) (*Requester, error)
- func (fs *Freshservice) CreateRequesterGroup(rg *RequesterGroup) (*RequesterGroup, error)
- func (fs *Freshservice) CreateTicket(ticket *Ticket) (*Ticket, error)
- func (fs *Freshservice) CreateTimeEntry(tid int64, tm *TimeEntry) (*TimeEntry, error)
- func (fs *Freshservice) DeactivateAgent(id int64) error
- func (fs *Freshservice) DeactivateRequester(id int64) error
- func (fs *Freshservice) DeleteAgentGroup(id int64) error
- func (fs *Freshservice) DeleteArticle(aid int64) error
- func (fs *Freshservice) DeleteCategory(cid int64) error
- func (fs *Freshservice) DeleteConversation(cid int64) error
- func (fs *Freshservice) DeleteConversationAttachment(cid, aid int64) error
- func (fs *Freshservice) DeleteFolder(fid int64) error
- func (fs *Freshservice) DeleteRequesterFromRequesterGroup(rgid, rid int64) error
- func (fs *Freshservice) DeleteRequesterGroup(id int64) error
- func (fs *Freshservice) DeleteTicket(tid int64) error
- func (fs *Freshservice) DeleteTicketAttachment(tid, aid int64) error
- func (fs *Freshservice) DeleteTimeEntry(tid, teid int64) error
- func (fs *Freshservice) Download(url string) ([]byte, error)
- func (fs *Freshservice) DownloadAttachment(aid int64) ([]byte, error)
- func (fs *Freshservice) DownloadNoAuth(url string) ([]byte, error)
- func (fs *Freshservice) FilterAgents(fao *FilterAgentsOption) ([]*Agent, bool, error)
- func (fs *Freshservice) FilterTickets(fto *FilterTicketsOption) ([]*Ticket, bool, error)
- func (fs *Freshservice) ForgetAgent(id int64) error
- func (fs *Freshservice) ForgetRequester(id int64) error
- func (fs *Freshservice) GetAgent(id int64) (*Agent, error)
- func (fs *Freshservice) GetAgentFields() ([]*AgentField, error)
- func (fs *Freshservice) GetAgentGroup(id int64) (*AgentGroup, error)
- func (fs *Freshservice) GetAgentRole(id int64) (*AgentRole, error)
- func (fs *Freshservice) GetArticle(aid int64) (*Article, error)
- func (fs *Freshservice) GetCategory(cid int64) (*Category, error)
- func (fs *Freshservice) GetFolder(fid int64) (*Folder, error)
- func (fs *Freshservice) GetHelpdeskAttachmentURL(aid int64) string
- func (fs *Freshservice) GetRequester(id int64) (*Requester, error)
- func (fs *Freshservice) GetRequesterFields() ([]*RequesterField, error)
- func (fs *Freshservice) GetRequesterGroup(id int64) (*RequesterGroup, error)
- func (fs *Freshservice) GetSolutionArticleURL(aid int64) string
- func (fs *Freshservice) GetTicket(tid int64, include ...string) (*Ticket, error)
- func (fs *Freshservice) GetTicketActivities(tid int64) ([]*TicketActivity, error)
- func (fs *Freshservice) GetTicketFields() ([]*TicketField, error)
- func (fs *Freshservice) GetTimeEntry(tid, teid int64) (*TimeEntry, error)
- func (fs *Freshservice) IterAgentGroups(lago *ListAgentGroupsOption, iagf func(*AgentGroup) error) error
- func (fs *Freshservice) IterAgentRoles(laro *ListAgentRolesOption, iarf func(*AgentRole) error) error
- func (fs *Freshservice) IterAgents(lao *ListAgentsOption, iaf func(*Agent) error) error
- func (fs *Freshservice) IterApprovals(lao *ListApprovalsOption, iaf func(*Approval) error) error
- func (fs *Freshservice) IterCategories(lco *ListCategoriesOption, icf func(*Category) error) error
- func (fs *Freshservice) IterCategoryFolders(cid int64, lfo *ListFoldersOption, iff func(*Folder) error) error
- func (fs *Freshservice) IterFilterAgents(fao *FilterAgentsOption, iaf func(*Agent) error) error
- func (fs *Freshservice) IterFilterTickets(fto *FilterTicketsOption, itf func(*Ticket) error) error
- func (fs *Freshservice) IterFolderArticles(fid int64, lao *ListArticlesOption, iaf func(*ArticleInfo) error) error
- func (fs *Freshservice) IterRequesterGroupMembers(rgid int64, lrgmo *ListRequesterGroupMembersOption, ...) error
- func (fs *Freshservice) IterRequesterGroups(lrgo *ListRequesterGroupsOption, irgf func(*RequesterGroup) error) error
- func (fs *Freshservice) IterRequesters(lro *ListRequestersOption, irf func(*Requester) error) error
- func (fs *Freshservice) IterTicketConversations(tid int64, lco *ListConversationsOption, icf func(*Conversation) error) error
- func (fs *Freshservice) IterTicketTimeEntries(tid int64, lteo *ListTimeEntriesOption, itef func(*TimeEntry) error) error
- func (fs *Freshservice) IterTickets(lto *ListTicketsOption, itf func(*Ticket) error) error
- func (fs *Freshservice) ListAgentGroups(lago *ListAgentGroupsOption) ([]*AgentGroup, bool, error)
- func (fs *Freshservice) ListAgentRoles(laro *ListAgentRolesOption) ([]*AgentRole, bool, error)
- func (fs *Freshservice) ListAgents(lao *ListAgentsOption) ([]*Agent, bool, error)
- func (fs *Freshservice) ListApprovals(lao *ListApprovalsOption) ([]*Approval, bool, error)
- func (fs *Freshservice) ListCategories(lco *ListCategoriesOption) ([]*Category, bool, error)
- func (fs *Freshservice) ListCategoryFolders(cid int64, lfo *ListFoldersOption) ([]*Folder, bool, error)
- func (fs *Freshservice) ListFolderArticles(fid int64, lao *ListArticlesOption) ([]*ArticleInfo, bool, error)
- func (fs *Freshservice) ListRequesterGroupMembers(rgid int64, lrgmo *ListRequesterGroupMembersOption) ([]*Requester, bool, error)
- func (fs *Freshservice) ListRequesterGroups(lrgo *ListRequesterGroupsOption) ([]*RequesterGroup, bool, error)
- func (fs *Freshservice) ListRequesters(lro *ListRequestersOption) ([]*Requester, bool, error)
- func (fs *Freshservice) ListTicketConversations(tid int64, lco *ListConversationsOption) ([]*Conversation, bool, error)
- func (fs *Freshservice) ListTicketTimeEntries(tid int64, lteo *ListTimeEntriesOption) ([]*TimeEntry, bool, error)
- func (fs *Freshservice) ListTickets(lto *ListTicketsOption) ([]*Ticket, bool, error)
- func (fs *Freshservice) MergeRequesters(id int64, ids ...int64) (*Requester, error)
- func (fs *Freshservice) ReactivateAgent(id int64) (*Agent, error)
- func (fs *Freshservice) ReactivateRequester(id int64) (*Requester, error)
- func (fs *Freshservice) Restore(tid int64) error
- func (fs *Freshservice) SaveAttachment(aid int64, path string) error
- func (fs *Freshservice) SaveFile(url string, path string) error
- func (fs *Freshservice) SaveFileNoAuth(url string, path string) error
- func (fs *Freshservice) SearchArticles(sao *SearchArticlesOption) ([]*ArticleInfo, bool, error)
- func (fs *Freshservice) SendArticleToApproval(aid int64) (*Article, error)
- func (fs *Freshservice) UpdateAgent(id int64, agent *Agent) (*Agent, error)
- func (fs *Freshservice) UpdateAgentGroup(id int64, ag *AgentGroup) (*AgentGroup, error)
- func (fs *Freshservice) UpdateArticle(aid int64, article *Article) (*Article, error)
- func (fs *Freshservice) UpdateCategory(cid int64, category *Category) (*Category, error)
- func (fs *Freshservice) UpdateConversation(cid int64, conversation *Conversation) (*Conversation, error)
- func (fs *Freshservice) UpdateFolder(fid int64, folder *Folder) (*Folder, error)
- func (fs *Freshservice) UpdateRequester(id int64, requester *Requester) (*Requester, error)
- func (fs *Freshservice) UpdateRequesterGroup(id int64, rg *RequesterGroup) (*RequesterGroup, error)
- func (fs *Freshservice) UpdateTicket(tid int64, ticket *Ticket) (*Ticket, error)
- func (fs *Freshservice) UpdateTimeEntry(tid, teid int64, tm *TimeEntry) (*TimeEntry, error)
- type ListAgentGroupsOption
- type ListAgentRolesOption
- type ListAgentsOption
- type ListApprovalsOption
- type ListArticlesOption
- type ListCategoriesOption
- type ListConversationsOption
- type ListFoldersOption
- type ListOption
- type ListRequesterGroupMembersOption
- type ListRequesterGroupsOption
- type ListRequestersOption
- type ListTicketsOption
- type ListTimeEntriesOption
- type Note
- type OrderType
- type PageOption
- type Reply
- type Requester
- type RequesterField
- type RequesterGroup
- type RequesterGroupType
- type SearchArticlesOption
- type Ticket
- type TicketActivity
- type TicketField
- type TicketFilter
- type TicketPriority
- type TicketSource
- type TicketStatus
- type Time
- type TimeEntry
- type TimeSpent
- type Values
- type WithFiles
Constants ¶
const ( AgentStateFulltime AgentState = "fulltime" AgentStateOccasional AgentState = "occasional" AgentActiveTrue AgentActive = "true" AgentActiveFalse AgentActive = "false" AgentActiveALL AgentActive = "" )
const ( ApprovalTypeEveryone ApprovalType = 1 ApprovalTypeAnyone ApprovalType = 2 ApprovalTypeMajority ApprovalType = 3 ApprovalTypeResponder ApprovalType = 4 ApprovalStatusRequested ApprovalStatus = 0 ApprovalStatusApproved ApprovalStatus = 1 ApprovalStatusRejected ApprovalStatus = 2 ApprovalStatusCanceled ApprovalStatus = 3 )
const ( ArticleTypePermanent ArticleType = 1 ArticleTypeWorkaround ArticleType = 2 ArticleStatusDraft ArticleStatus = 1 ArticleStatusPublished ArticleStatus = 2 )
const ( TicketSourceEmail TicketSource = 1 TicketSourcePortal TicketSource = 2 TicketSourcePhone TicketSource = 3 TicketSourceChat TicketSource = 4 TicketSourceFeedbackWidget TicketSource = 5 TicketSourceYammer TicketSource = 6 TicketSourceAWSCloudwatch TicketSource = 7 TicketSourcePagerduty TicketSource = 8 TicketSourceWalkup TicketSource = 9 TicketSourceSlack TicketSource = 10 TicketStatusOpen TicketStatus = 2 TicketStatusPending TicketStatus = 3 TicketStatusResolved TicketStatus = 4 TicketStatusClosed TicketStatus = 5 TicketPriorityLow TicketPriority = 1 TicketPriorityMedium TicketPriority = 2 TicketPriorityHigh TicketPriority = 3 TicketPriorityUrgent TicketPriority = 4 TicketFilterNewAndMyOpen TicketFilter = "new_and_my_open" TicketFilterWatching TicketFilter = "watching" TicketFilterSpam TicketFilter = "spam" TicketFilterDeleted TicketFilter = "deleted" )
const ( TicketIncludeConversations = "conversations" TicketIncludeRequester = "requester" TicketIncludeRequestedFor = "requested_for" TicketIncludeStats = "stats" TicketIncludeProblem = "problem" TicketIncludeAssets = "assets" TicketIncludeChange = "change" TicketIncludeRelatedTickets = "related_tickets" )
Variables ¶
This section is empty.
Functions ¶
func GetHelpdeskAttachmentURL ¶ added in v1.0.15
GetHelpdeskAttachmentURL return a permlink for helpdesk attachment/avator URL
func GetSolutionArticleURL ¶ added in v1.0.15
GetSolutionArticleURL return a permlink for solution article URL
func ToJSONIndent ¶ added in v1.0.10
Types ¶
type Agent ¶ added in v1.0.9
type Agent struct { ID int64 `json:"id,omitempty"` // First name of the agent FirstName string `json:"first_name,omitempty"` // Last name of the agent. LastName string `json:"last_name,omitempty"` // Set to true if this is an occasional agent (true => occasional, false => full-time) Occasional bool `json:"occasional,omitempty"` // Job title of the agent. JobTitle string `json:"job_title,omitempty"` // Email address of the agent. Email string `json:"email,omitempty"` // Work phone number of the agent. WorkPhoneNumber string `json:"work_phone_number,omitempty"` // Mobile phone number of the agent. MobilePhoneNumber string `json:"mobile_phone_number,omitempty"` // Unique IDs of the departments associated with the requester DepartmentIDs []int64 `json:"department_ids,omitempty"` // Set to true if the requester must be allowed to view tickets filed by other members of the department, and false otherwise CanSeeAllTicketsFromAssociatedDepartments bool `json:"can_see_all_tickets_from_associated_departments,omitempty"` // User ID of the requester’s reporting manager. ReportingManagerID int64 `json:"reporting_manager_id,omitempty"` // Address of the requester. Address string `json:"address,omitempty"` // Time zone of the requester. TimeZone string `json:"time_zone,omitempty"` // Time format for the requester.Possible values: 12h (12 hour format), 24h (24 hour format) TimeFormat string `json:"time_format,omitempty"` // Language used by the requester. Language string `json:"language,omitempty"` // Unique ID of the location associated with the requester. LocationID int64 `json:"location_id,omitempty"` // Background information of the requester. BackgroundInformation string `json:"background_information,omitempty"` // Unique ID of the level of the agent in the Arcade. ScoreboardLevelID AgentScoreboardLevel `json:"scoreboard_level_id,omitempty"` // Unique IDs of the groups that the agent is a member of. // The input value for this field should also include the IDs of approval-enabled restricted groups for which the agent’s member access is pending approval by a group leader. // The response value for this field would only contain the list of groups that the agent is an approved member of. // The member_of_pending_approval read-only attribute in the response will include the list of groups for which the agent’s member access is pending approval by a group leader. MemberOf []int64 `json:"member_of,omitempty"` // Unique IDs of the groups that the agent is an observer of. // The input value for this field should also include the IDs of approval-enabled restricted groups for which the agent’s observer access is pending approval by a group leader. // The response value for this field would only contain the list of groups that the agent is an approved observer of. // The observer_of_pending_approval read-only attribute in the response will include the list of groups for which the agent’s observer access is pending approval by a group leader. ObserverOf []int64 `json:"observer_of,omitempty"` // Unique IDs of the restricted groups to which the agent’s addition as a member is pending approval. MemberOfPendingApproval []int64 `json:"member_of_pending_approval,omitempty"` // Unique IDs of the restricted groups to which the agent’s addition as an observer is pending approval. ObserverOfPendingApproval []int64 `json:"observer_of_pending_approval,omitempty"` Roles []*AssignRole `json:"roles,omitempty"` // Timestamp of the agent's last successful login. LastLoginAt *Time `json:"last_login_at,omitempty"` // Timestamp of the agent's recent activity. LastActiveAt *Time `json:"last_active_at,omitempty"` // Key-value pair containing the names and values of the (custom) requester fields. CustomFields map[string]any `json:"custom_fields,omitempty"` // Set to true if the user has logged in to Freshservice at least once, and false otherwise. HasLoggedIn bool `json:"has_logged_in,omitempty"` // True if the agent is active, false if the agent has been deactivated. Active bool `json:"active,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
type AgentActive ¶ added in v1.0.10
type AgentActive string
type AgentField ¶ added in v1.0.9
type AgentField struct { ID int64 `json:"id,omitempty"` // Name of the agent field. Name string `json:"name,omitempty"` // Field label shown to admins while editing an agent’s profile LabelForAdmins string `json:"label_for_admins,omitempty"` // Signifies whether admins can edit the field value. EditableByAdmins bool `json:"editable_by_admins,omitempty"` // Signifies whether admins have to necessarily provide a value for this field. MandatoryForAdmins bool `json:"mandatory_for_admins,omitempty"` // Field label shown to agents while viewing their own profile LabelForAgents string `json:"label_for_agents,omitempty"` // Signifies whether the field is shown to agents while viewing their own profile VisibleTo_Agents bool `json:"visible_to_agents,omitempty"` // Signifies whether the field is editable by agents while viewing their own profile EditableByAgents bool `json:"editable_by_agents,omitempty"` // Signifies whether agents have to necessarily provide a value for this field while viewing their own profile. MandatoryForAgents bool `json:"mandatory_for_agents,omitempty"` // Type of data stored in this field Type string `json:"type,omitempty"` // Indicates whether it is a default field or user-defined custom field DefaultField bool `json:"default_field,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
func (*AgentField) String ¶ added in v1.0.9
func (af *AgentField) String() string
type AgentGroup ¶ added in v1.0.9
type AgentGroup struct { ID int64 `json:"id,omitempty"` // Name of the group Name string `json:"name,omitempty"` // Description of the group. Description string `json:"description,omitempty"` // The time after which an escalation email is sent if a ticket in the group remains unassigned. // The accepted values are “30m” for 30 minutes, “1h” for 1 hour, “2h” for 2 hours, “4h” for 4 hours, “8h” for 8 hours, “12h” for 12 hours, “1d” for 1 day, “2d” for 2 days, and “3d” for 3 days. UnassignedFor AgentGroupUnassignedFor `json:"unassigned_for,omitempty"` // Unique ID of the business hours configuration associated with the group. BusinessHoursID int64 `json:"business_hours_id,omitempty"` // The Unique ID of the user to whom an escalation email is sent if a ticket in this group is unassigned. To create/update a group with an escalate_to value of ‘none’, please set the value of this parameter to ‘null’. EscalateTo int64 `json:"escalate_to,omitempty"` // A comma separated array of user IDs of agents who are members of this group. // If the group is restricted and approvals-enabled, the input value for this field should also include the user IDs of agents whose member access to the group is pending approval by a group leader. // The response value for this field would only contain the list of approved members. // The members_pending_approval read-only attribute in the response will include the list of members whose approval is pending. Members []int64 `json:"members,omitempty"` // A comma separated array of user IDs of agents who are observers of this group. // If the group is restricted and approvals-enabled, the input value for this field should also include the user IDs of agents whose observer access to the group is pending approval by a group leader. // The response value for this field would only contain the list of approved observers. // The observers_pending_approval read-only attribute in the response will include the list of observers whose approval is pending. // This attribute is only applicable for accounts which have the “Access Controls Pro” feature enabled. Observers []int64 `json:"ovservers,omitempty"` // Signifies whether a group is marked as restricted. // This attribute won't be supported if the "Access Controls Pro" feature is unavailable for the account. Set to true if the group is restricted, and false otherwise. Restricted bool `json:"restricted,omitempty"` // A comma separated array of user IDs of agents who are leaders of this group. // If the group is restricted and approvals-enabled, the input value for this field should also include the user IDs of agents whose leader access to the group is pending approval by another group leader. The response value for this field would only contain the list of approved leaders. // The leaders_pending_approval read-only attribute in the response will include the list of leaders whose approval is pending. // This attribute is only applicable for accounts which have the “Access Controls Pro” feature enabled. Leaders []int64 `json:"leaders,omitempty"` // A comma-separated array of user IDs of agents whose member access to the group is pending approval by a group leader. // This attribute is only applicable for accounts which have the “Access Controls Pro” feature enabled. // READ ONLY MembersPendingApproval []int64 `json:"members_pending_approval,omitempty"` // A comma-separated array of user IDs of agents whose observer access to the group is pending approval by a group leader. // This attribute is only applicable for accounts which have the “Access Controls Pro” feature enabled. // READ ONLY ObserversPendingApproval []int64 `json:"observers_pending_approval,omitempty"` // A comma-separated array of user IDs of agents whose leader access to the group is pending approval by an existing group leader. // This attribute is only applicable for accounts which have the “Access Controls Pro” feature enabled. // READ ONLY LeadersPendingApproval []int64 `json:"leaders_pending_approval,omitempty"` // Signifies whether the restricted group requires approvals for membership changes. // This attribute is only applicable for accounts which have the “Access Controls Pro” feature enabled. ApprovalRequired bool `json:"approval_required,omitempty"` // Describes the automatic ticket assignment type. // Will not be supported if the "Round Robin" feature is disabled for the account. // Set to true if automatic ticket assignment is enabled, and false otherwise. AutoTicketAssign bool `json:"auto_ticket_assign,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
func (*AgentGroup) String ¶ added in v1.0.9
func (ag *AgentGroup) String() string
type AgentGroupUnassignedFor ¶ added in v1.0.9
type AgentGroupUnassignedFor string
const ( AgentGroupUnassignedFor30m AgentGroupUnassignedFor = "30m" AgentGroupUnassignedFor1h AgentGroupUnassignedFor = "1h" AgentGroupUnassignedFor2h AgentGroupUnassignedFor = "2h" AgentGroupUnassignedFor4h AgentGroupUnassignedFor = "4h" AgentGroupUnassignedFor8h AgentGroupUnassignedFor = "8h" AgentGroupUnassignedFor12h AgentGroupUnassignedFor = "12h" AgentGroupUnassignedFor1d AgentGroupUnassignedFor = "1d" AgentGroupUnassignedFor2d AgentGroupUnassignedFor = "2d" AgentGroupUnassignedFor3d AgentGroupUnassignedFor = "3d" )
type AgentRole ¶ added in v1.0.9
type AgentRole struct { ID int64 `json:"id,omitempty"` // Name of the role Name string `json:"name,omitempty"` // Description of the role. Description string `json:"description,omitempty"` // default boolean Set to true if it is a default role, and false otherwise Default bool `json:"default,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
type AgentScoreboardLevel ¶ added in v1.0.10
type AgentScoreboardLevel int
const ( AgentScoreboardLevelBeginner AgentScoreboardLevel = 1 AgentScoreboardLevelIntermediate AgentScoreboardLevel = 2 AgentScoreboardLevelProfessional AgentScoreboardLevel = 3 AgentScoreboardLevelExpert AgentScoreboardLevel = 4 AgentScoreboardLevelMaster AgentScoreboardLevel = 5 AgentScoreboardLevelGuru AgentScoreboardLevel = 6 )
func ParseAgentScoreboardLevel ¶ added in v1.0.10
func ParseAgentScoreboardLevel(s string) AgentScoreboardLevel
func (AgentScoreboardLevel) String ¶ added in v1.0.10
func (asl AgentScoreboardLevel) String() string
type AgentState ¶ added in v1.0.9
type AgentState string
type Approval ¶
type Approval struct { ID int64 `json:"id,omitempty"` Parent string `json:"parent,omitempty"` ParentID int64 `json:"parent_id,omitempty"` ApproverID int64 `json:"approver_id,omitempty"` ApproverName string `json:"approver_name,omitempty"` ApprovalType ApprovalType `json:"approval_type,omitempty"` Level int `json:"level,omitempty"` UserID int64 `json:"user_id,omitempty"` UserName string `json:"user_name,omitempty"` MemberID int64 `json:"member_id,omitempty"` MemberName string `json:"member_name,omitempty"` ApprovalStatus *ApprovalInfo `json:"approval_status,omitempty"` Delegatee *Delegatee `json:"delegatee,omitempty"` LatestRemark string `json:"latest_remark,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
type ApprovalInfo ¶ added in v1.0.15
func (*ApprovalInfo) String ¶ added in v1.0.15
func (a *ApprovalInfo) String() string
type ApprovalSetting ¶ added in v1.0.15
type ApprovalSetting struct { ApprovalType int `json:"approval_type,omitempty"` ApproverIDs []int64 `json:"approver_ids,omitempty"` }
func (*ApprovalSetting) String ¶ added in v1.0.15
func (a *ApprovalSetting) String() string
type ApprovalStatus ¶ added in v1.0.9
type ApprovalStatus int
func (ApprovalStatus) String ¶ added in v1.0.15
func (as ApprovalStatus) String() string
type ApprovalType ¶ added in v1.0.15
type ApprovalType int
type Article ¶
type Article struct { ID int64 `json:"id,omitempty"` // Title of the solution article Title string `json:"title,omitempty"` // Description of the solution article Description string `json:"description,omitempty"` // The rank of the solution article in the article listing Position int `json:"position,omitempty"` // The type of the article. ( 1 - permanent, 2 - workaround ) ArticleType ArticleType `json:"article_type,omitempty"` // ID of the folder to which the solution article belongs FolderID int64 `json:"folder_id,omitempty"` // ID of the category to which the solution article belongs CagetoryID int64 `json:"category_id,omitempty"` // Status of the solution article. ( 1 - draft, 2 - published ) Status ArticleStatus `json:"status,omitempty"` // Number of upvotes for the solution article ThumbsUp int `json:"thumbs_up,omitempty"` // Number of down votes for the solution article ThumbsDown int `json:"thumbs_down,omitempty"` // ID of the agent who created the solution article AgentID int64 `json:"agent_id,omitempty"` // Number of views for the solution article Views int64 `json:"views,omitempty"` // Tags that have been associated with the solution article Tags []string `json:"tags,omitempty"` // Keywords that have been associated with the solution article Keywords []string `json:"keywords,omitempty"` // Attachments associated with the article. The total size of all of a article's attachments cannot exceed 25MB. Attachments []*Attachment `json:"attachments,omitempty"` // Article from external url link. URL string `json:"url,omitempty"` ModifiedBy int64 `json:"modified_by,omitempty"` ModifiedAt *Time `json:"modified_at,omitempty"` InsertedIntoTickets int `json:"inserted_into_tickets,omitempty"` // Date in future when this article would need to be reviewed again. ReviewDate *Time `json:"review_date,omitempty"` // Approval status of the article. ApprovalStatus ApprovalStatus `json:"approval_status,omitempty"` Approvals []*Approval `json:"approvals,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
func (*Article) AddAttachment ¶
type ArticleInfo ¶ added in v1.0.11
type ArticleInfo struct { Article // Attachments associated with the article. The total size of all of a article's attachments cannot exceed 25MB. Attachments []string `json:"attachments,omitempty"` GroupFolderGroupIDs []int64 `json:"group_folder_group_ids,omitempty"` FolderDepartmentIDs []int64 `json:"folder_department_ids,omitempty"` GroupFolderRequesterGroupIDs []int64 `json:"group_folder_requester_group_ids,omitempty"` GroupFolderDepartmentIDs []int64 `json:"group_folder_department_ids,omitempty"` FolderVisibility FolderVisibility `json:"folder_visibility,omitempty"` }
func (*ArticleInfo) String ¶ added in v1.0.11
func (ai *ArticleInfo) String() string
type ArticleStatus ¶ added in v1.0.9
type ArticleStatus int
func ParseArticleStatus ¶ added in v1.0.9
func ParseArticleStatus(s string) ArticleStatus
func (ArticleStatus) String ¶ added in v1.0.9
func (as ArticleStatus) String() string
type ArticleType ¶ added in v1.0.9
type ArticleType int
func ParseArticleType ¶ added in v1.0.9
func ParseArticleType(s string) ArticleType
func (ArticleType) String ¶ added in v1.0.9
func (at ArticleType) String() string
type AssignRole ¶ added in v1.0.9
type AssignRole struct { // Unique ID of the role assigned RoleID int64 `json:"role_id,omitempty"` // The scope in which the agent can use the permissions granted by this role. // Possible values include entire_helpdesk (all plans), // member_groups (all plans; in the Pro and Enterprise plans, this also includes groups that the agent is an observer of), // specified_groups (Pro and Enterprise only), and assigned_items (all plans) AssignmentScope string `json:"assignment_scope,omitempty"` // Unique IDs of Groups in which the permissions granted by the role applies. // Mandatory only when the assignment_scope is specified_groups, and should be ignored otherwise. Groups []int64 `json:"groups,omitempty"` }
func (*AssignRole) String ¶ added in v1.0.9
func (ar *AssignRole) String() string
type Attachment ¶
type Attachment = fdk.Attachment
func NewAttachment ¶
func NewAttachment(file string, data ...[]byte) *Attachment
type Attachments ¶ added in v1.0.9
type Attachments = fdk.Attachments
type Category ¶
type Category struct { ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` // The rank of the solution category in the category listing Position int `json:"position,omitempty"` // Set as true if the category is a default one DefaultCategory bool `json:"default_category,omitempty"` // List of portal IDs where this category is visible VisibleInPortals []int64 `json:"visible_in_portals,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
type Conversation ¶ added in v1.0.9
type Conversation struct { // ID of the conversation ID int64 `json:"id,omitempty"` // Attachments (Updatable) associated with the conversation. The total size of all of a ticket's attachments cannot exceed 40MB. Attachments []*Attachment `json:"attachments,omitempty"` // Body (Updatable) Content of the conversation in HTML Body string `json:"body,omitempty"` // Content of the conversation in plain text BodyText string `json:"body_text,omitempty"` // Set to true if a particular conversation should appear as being created from outside (i.e., not through web portal) Incoming bool `json:"incoming,omitempty"` // Set to true if the note is private Private bool `json:"private,omitempty"` // Denotes the type of the conversation. Source ConversationSource `json:"source,omitempty"` // Email address from which the reply is sent. For notes, this value will be null. SupportEmail string `json:"support_email,omitempty"` // ID of the ticket to which this conversation is being added TicketID int64 `json:"ticket_id,omitempty"` // ID of the agent/user who is adding the conversation UserID int64 `json:"user_id,omitempty"` // Email addresses of agents/users who need to be notified about this conversation ToEmails []string `json:"to_emails,omitempty"` // The email address from which the reply is sent. By default the global support email will be used. FromEmail string `json:"from_email,omitempty"` // Email address added in the 'cc' field of the outgoing ticket email. CcEmails []string `json:"cc_emails,omitempty"` // Email address added in the 'bcc' field of the outgoing ticket email. BccEmails []string `json:"bcc_emails,omitempty"` // Conversation creation timestamp CreatedAt *Time `json:"created_at,omitempty"` // Conversation updated timestamp UpdatedAt *Time `json:"updated_at,omitempty"` NotifiedTos []string `json:"notified_to,omitempty"` }
func (*Conversation) AddAttachment ¶ added in v1.0.9
func (c *Conversation) AddAttachment(path string, data ...[]byte)
func (*Conversation) Files ¶ added in v1.0.9
func (c *Conversation) Files() Files
func (*Conversation) String ¶ added in v1.0.9
func (c *Conversation) String() string
func (*Conversation) Values ¶ added in v1.0.9
func (c *Conversation) Values() Values
type ConversationSource ¶ added in v1.0.9
type ConversationSource int
const ( ConversationSourceEmail ConversationSource = 0 ConversationSourceForm ConversationSource = 1 ConversationSourceNote ConversationSource = 2 ConversationSourceStatus ConversationSource = 3 ConversationSourceMeta ConversationSource = 4 ConversationSourceFeedback ConversationSource = 5 ConversationSourceForwardedEmail ConversationSource = 6 )
func ParseConversationSource ¶ added in v1.0.9
func ParseConversationSource(s string) ConversationSource
func (ConversationSource) String ¶ added in v1.0.9
func (cs ConversationSource) String() string
type FilterAgentsOption ¶ added in v1.0.10
func (*FilterAgentsOption) IsNil ¶ added in v1.0.10
func (fao *FilterAgentsOption) IsNil() bool
func (*FilterAgentsOption) Values ¶ added in v1.0.10
func (fao *FilterAgentsOption) Values() Values
type FilterTicketsOption ¶ added in v1.0.9
func (*FilterTicketsOption) IsNil ¶ added in v1.0.9
func (fto *FilterTicketsOption) IsNil() bool
func (*FilterTicketsOption) Values ¶ added in v1.0.9
func (fto *FilterTicketsOption) Values() Values
type Folder ¶
type Folder struct { ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` // Describes the position in which the folder is listed Position int `json:"position,omitempty"` // Set as true is it is a default folder DefaultFolder bool `json:"default_folder,omitempty"` CategoryID int64 `json:"category_id,omitempty"` // Accessibility of this folder. Please refer to Folder Properties table. Visibility FolderVisibility `json:"visibility,omitempty"` // Approval settings that have been associated with the folder. Key-value pair containing the approval_type, approval_ids and its values. ApprovalSettings *ApprovalSetting `json:"approval_settings,omitempty"` // ID of the department to which this solution folder is visible. ( Mandatory if visibility is set to '4') DepartmentIDs []int64 `json:"department_ids,omitempty"` // ID of the Agent Groups to which this solution folder is visible. ( Mandatory if visibility is set to '5') GroupIDs []int64 `json:"group_ids,omitempty"` // ID of the Contact Groups to which this solution folder is visible. ( Mandatory if visibility is set to '6') RequesterGroupIDs []int64 `json:"requester_group_ids,omitempty"` ManageByGroupIDs []int64 `json:"manage_by_group_ids,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
type FolderVisibility ¶ added in v1.0.9
type FolderVisibility int
const ( FolderVisibilityAllUsers FolderVisibility = 1 FolderVisibilityLoggedInUsers FolderVisibility = 2 FolderVisibilityAgents FolderVisibility = 3 FolderVisibilityDepartments FolderVisibility = 4 FolderVisibilityAgentGroups FolderVisibility = 5 FolderVisibilityContactGroups FolderVisibility = 6 )
func ParseFolderVisibility ¶ added in v1.0.9
func ParseFolderVisibility(s string) FolderVisibility
func (FolderVisibility) String ¶ added in v1.0.9
func (fv FolderVisibility) String() string
type Freshservice ¶ added in v1.0.9
func (*Freshservice) AddRequesterToRequesterGroup ¶ added in v1.0.9
func (fs *Freshservice) AddRequesterToRequesterGroup(rgid, rid int64) error
Add Requester to Requester Group Note: 1.Requesters can be added only to manual requester groups. 2.Requester can be added one at a time.
func (*Freshservice) ConvertAgentToRequester ¶ added in v1.0.9
func (fs *Freshservice) ConvertAgentToRequester(id int64) (*Agent, error)
Convert a particular agent into a requester.
func (*Freshservice) ConvertRequesterToAgent ¶ added in v1.0.9
func (fs *Freshservice) ConvertRequesterToAgent(id int64) (*Agent, error)
Convert a requester to an occasional agent with SD Agent role and no group memberships.
func (*Freshservice) CreateAgent ¶ added in v1.0.9
func (fs *Freshservice) CreateAgent(agent *Agent) (*Agent, error)
func (*Freshservice) CreateAgentGroup ¶ added in v1.0.9
func (fs *Freshservice) CreateAgentGroup(ag *AgentGroup) (*AgentGroup, error)
func (*Freshservice) CreateArticle ¶ added in v1.0.9
func (fs *Freshservice) CreateArticle(article *Article) (*Article, error)
func (*Freshservice) CreateCategory ¶ added in v1.0.9
func (fs *Freshservice) CreateCategory(category *Category) (*Category, error)
func (*Freshservice) CreateChildTicket ¶ added in v1.0.9
func (fs *Freshservice) CreateChildTicket(tid int64, ticket *Ticket) (*Ticket, error)
Create a Child Ticket This API lets you to create a new child ticket on an existing ticket Note: 1. Association of child tickets is not available in the Sprout plan. 2. Association of child tickets to a service request is not possible. 3. Association of child tickets to a deleted or a spammed ticket is not allowed. 4. Nesting of a child ticket under another child ticket is not supported.
func (*Freshservice) CreateFolder ¶ added in v1.0.9
func (fs *Freshservice) CreateFolder(folder *Folder) (*Folder, error)
func (*Freshservice) CreateNote ¶ added in v1.0.9
func (fs *Freshservice) CreateNote(tid int64, note *Note) (*Conversation, error)
func (*Freshservice) CreateReply ¶ added in v1.0.9
func (fs *Freshservice) CreateReply(tid int64, reply *Reply) (*Conversation, error)
func (*Freshservice) CreateRequester ¶ added in v1.0.9
func (fs *Freshservice) CreateRequester(requester *Requester) (*Requester, error)
func (*Freshservice) CreateRequesterGroup ¶ added in v1.0.9
func (fs *Freshservice) CreateRequesterGroup(rg *RequesterGroup) (*RequesterGroup, error)
func (*Freshservice) CreateTicket ¶ added in v1.0.9
func (fs *Freshservice) CreateTicket(ticket *Ticket) (*Ticket, error)
func (*Freshservice) CreateTimeEntry ¶ added in v1.0.10
func (fs *Freshservice) CreateTimeEntry(tid int64, tm *TimeEntry) (*TimeEntry, error)
Create a Time Entry This API helps to create a Time Entry. Note: 1. If timer_running is not specified in the request, it is considered as false and time_spent is mandatory in this scenario. 2. time_spent can be set only if timer_running is false or not set. POST /api/v2/tickets/[ticket_id]/time_entries
func (*Freshservice) DeactivateAgent ¶ added in v1.0.9
func (fs *Freshservice) DeactivateAgent(id int64) error
Deactivate a Agent This operation allows you to deactivate a agent.
func (*Freshservice) DeactivateRequester ¶ added in v1.0.9
func (fs *Freshservice) DeactivateRequester(id int64) error
Deactivate a Requester This operation allows you to deactivate a requester.
func (*Freshservice) DeleteAgentGroup ¶ added in v1.0.9
func (fs *Freshservice) DeleteAgentGroup(id int64) error
func (*Freshservice) DeleteArticle ¶ added in v1.0.9
func (fs *Freshservice) DeleteArticle(aid int64) error
func (*Freshservice) DeleteCategory ¶ added in v1.0.9
func (fs *Freshservice) DeleteCategory(cid int64) error
func (*Freshservice) DeleteConversation ¶ added in v1.0.9
func (fs *Freshservice) DeleteConversation(cid int64) error
func (*Freshservice) DeleteConversationAttachment ¶ added in v1.0.9
func (fs *Freshservice) DeleteConversationAttachment(cid, aid int64) error
func (*Freshservice) DeleteFolder ¶ added in v1.0.9
func (fs *Freshservice) DeleteFolder(fid int64) error
func (*Freshservice) DeleteRequesterFromRequesterGroup ¶ added in v1.0.9
func (fs *Freshservice) DeleteRequesterFromRequesterGroup(rgid, rid int64) error
Delete Requester from Requester Group Note: 1.Requesters can be removed only from manual requester groups. 2.Requester can be removed one at a time.
func (*Freshservice) DeleteRequesterGroup ¶ added in v1.0.9
func (fs *Freshservice) DeleteRequesterGroup(id int64) error
Delete Requester Group Note: 1. Deleting a Requester Group will only disband the requester group and will not delete its members. 2. Deleted requester groups cannot be restored.
func (*Freshservice) DeleteTicket ¶ added in v1.0.9
func (fs *Freshservice) DeleteTicket(tid int64) error
func (*Freshservice) DeleteTicketAttachment ¶ added in v1.0.9
func (fs *Freshservice) DeleteTicketAttachment(tid, aid int64) error
func (*Freshservice) DeleteTimeEntry ¶ added in v1.0.10
func (fs *Freshservice) DeleteTimeEntry(tid, teid int64) error
func (*Freshservice) Download ¶ added in v1.0.9
func (fs *Freshservice) Download(url string) ([]byte, error)
func (*Freshservice) DownloadAttachment ¶ added in v1.0.9
func (fs *Freshservice) DownloadAttachment(aid int64) ([]byte, error)
func (*Freshservice) DownloadNoAuth ¶ added in v1.0.9
func (fs *Freshservice) DownloadNoAuth(url string) ([]byte, error)
func (*Freshservice) FilterAgents ¶ added in v1.0.10
func (fs *Freshservice) FilterAgents(fao *FilterAgentsOption) ([]*Agent, bool, error)
FilterAgents Use Agent attributes to filter your list. See: https://api.freshservice.com/#filter_agents Note: 1. Filtered results cannot be sorted. By default it is sorted by created_at in descending order. 2. The query must be URL encoded (see example). 3. Query can be framed using the name of the agent fields, which can be obtained from the Supported Agent Fields Section. 4. Query string must be enclosed between a pair of double quotes and can have up to 512 characters. 5. Logical operators AND, OR along with parenthesis( ) can be used to group conditions. 6. Relational operators greater than or equal to :> and less than or equal to :< can be used along with date fields and numeric fields. 7. Input for date field should be in UTC Format. 8. The number of objects returned per page is 30. 9. To scroll through the pages add the page parameter to the url. The page number starts with 1 and should not exceed 40. 10. To filter for fields with no values assigned, use the null keyword. 11. The "~" query operator can be used for "starts with" text searches. "Starts with" search is supported for one or more of the following attributes: first_name, last_name, name, email, mobile_phone_number, work_phone_number. The query format is https://domain.freshservice.com/api/v2/agents?query="~[attribute_1|attribute_2]:'somestring'". The query needs to be URL encoded. This would return a list of users for whom attribute_1 OR attribute_2 starts with "somestring". Refer to examples 11, 12, and 13. 12. Please note that any update made to an agent either in Freshservice application or through API may take a few minutes to get indexed, after which the updated results will be available through API. Supported Agent Fields: Field Type Description first_name string First name of the agent. last_name string Last name of the agent. name string Concatenation of first_name and last_name with single space in-between fields. job_title string Title of the agent. email string Email address of the agent. work_phone_number string Work phone of the agent. mobile_phone_number string Mobile phone of the agent. department_id integer ID of the department(s) assigned to the agent. reporting_manager_id integer ID of the reporting manager. time_zone string ID of the department. language string Language code(Eg. en, ja-JP). location_id integer ID of the location. created_at date Date (YYYY-MM-DD) when the agent is created. updated_at date Date (YYYY-MM-DD) when the agent is updated.
func (*Freshservice) FilterTickets ¶ added in v1.0.9
func (fs *Freshservice) FilterTickets(fto *FilterTicketsOption) ([]*Ticket, bool, error)
Filter Tickets Custom ticket fields that you have created in your account can also be used to filter through the tickets and get a list of tickets matching the specified ticket fields. Query Format(query) - "(ticket_field:integer OR ticket_field:'string') AND ticket_field:boolean" Note: 1. The query must be URL encoded 2. Query can be framed using the ticket field name in snake case, which can be obtained from Ticket Fields endpoint. Ticket Fields are case sensitive 3. Query string must be enclosed between a pair of double quotes and can have up to 512 characters 4. Logical operators AND, OR along with parentheses () can be used to group conditions 5. Relational operators greater than or equal to :> and less than or equal to :< can be used along with date fields and numeric fields 6. Input for date fields should be in UTC Format 7. The number of objects returned per page is 30 also the total count of the results will be returned along with the result 8. To scroll through the pages add page parameter to the url 9. To filter for agent and group with no values assigned, use the null keyword 10. By default, only tickets from the primary workspace will be returned for accounts with the 'Workspaces' feature enabled. For tickets from other workspaces, use the workspace_id filter. Supported Ticket Fields Field Type Description workspace_id number Workspace ID of the ticket. The attribute is applicable only for accounts with the 'Workspaces' feature enabled. The value 1 for workspace_id will return tickets from all workspaces, with only global level fields. requester_id number User ID of the requester email string Email address of the requester agent_id number ID of the agent to whom the ticket has been assigned group_id number ID of the group to which the ticket has been assigned priority number Priority of the ticket status number Status of the ticket impact number Ticket impact urgency number Ticket urgency tag string Tag that has been associated to the tickets due_by date Date (YYYY-MM-DD) when the ticket is due to be resolved fr_due_by date Date (YYYY-MM-DD) when the first response is due created_at date Ticket creation date (YYYY-MM-DD) Custom Fields Field Type Type Number number Checkbox boolean Dropdown string Date date(YYYY-MM-DD) Note: Queries can be combined using AND or OR. https://domain.freshservice.com/api/v2/tickets/filter?query="priority: 1 AND status: 2 OR urgency: 3" Supported operators 1. priority: 1 (priority equal to 1) 2. priority:> 1 (priority greater than or equal to 1) 3. priority :< 1 (priority less than or equal to 1) Formatting 1. String fields to be enclosed in single quotes (”) 2. Number fields to be given as number without quotes. 3. Date and date_time fields to be enclosed in single quotes('yyyy-mm-dd') 4. only :> and :< are supported for date and date_time fields. Both fields expect input in the same format as 'yyyy-mm-dd'
func (*Freshservice) ForgetAgent ¶ added in v1.0.9
func (fs *Freshservice) ForgetAgent(id int64) error
Forget a Agent This operation allows you to permanently delete a agent and the tickets that they requested.
func (*Freshservice) ForgetRequester ¶ added in v1.0.9
func (fs *Freshservice) ForgetRequester(id int64) error
Forget a Requester This operation allows you to permanently delete a requester and the tickets that they requested.
func (*Freshservice) GetAgent ¶ added in v1.0.9
func (fs *Freshservice) GetAgent(id int64) (*Agent, error)
func (*Freshservice) GetAgentFields ¶ added in v1.0.9
func (fs *Freshservice) GetAgentFields() ([]*AgentField, error)
func (*Freshservice) GetAgentGroup ¶ added in v1.0.9
func (fs *Freshservice) GetAgentGroup(id int64) (*AgentGroup, error)
func (*Freshservice) GetAgentRole ¶ added in v1.0.9
func (fs *Freshservice) GetAgentRole(id int64) (*AgentRole, error)
func (*Freshservice) GetArticle ¶ added in v1.0.9
func (fs *Freshservice) GetArticle(aid int64) (*Article, error)
func (*Freshservice) GetCategory ¶ added in v1.0.9
func (fs *Freshservice) GetCategory(cid int64) (*Category, error)
func (*Freshservice) GetFolder ¶ added in v1.0.9
func (fs *Freshservice) GetFolder(fid int64) (*Folder, error)
func (*Freshservice) GetHelpdeskAttachmentURL ¶ added in v1.0.9
func (fs *Freshservice) GetHelpdeskAttachmentURL(aid int64) string
GetHelpdeskAttachmentURL return a permlink for helpdesk attachment/avator URL
func (*Freshservice) GetRequester ¶ added in v1.0.9
func (fs *Freshservice) GetRequester(id int64) (*Requester, error)
func (*Freshservice) GetRequesterFields ¶ added in v1.0.9
func (fs *Freshservice) GetRequesterFields() ([]*RequesterField, error)
func (*Freshservice) GetRequesterGroup ¶ added in v1.0.9
func (fs *Freshservice) GetRequesterGroup(id int64) (*RequesterGroup, error)
func (*Freshservice) GetSolutionArticleURL ¶ added in v1.0.10
func (fs *Freshservice) GetSolutionArticleURL(aid int64) string
GetSolutionArticleURL return a permlink for solution article URL
func (*Freshservice) GetTicket ¶ added in v1.0.9
func (fs *Freshservice) GetTicket(tid int64, include ...string) (*Ticket, error)
GetTicket Get a Ticket include: conversations, requester, requested_for, stats, problem, assets, change, related_tickets
func (*Freshservice) GetTicketActivities ¶ added in v1.0.9
func (fs *Freshservice) GetTicketActivities(tid int64) ([]*TicketActivity, error)
func (*Freshservice) GetTicketFields ¶ added in v1.0.9
func (fs *Freshservice) GetTicketFields() ([]*TicketField, error)
func (*Freshservice) GetTimeEntry ¶ added in v1.0.10
func (fs *Freshservice) GetTimeEntry(tid, teid int64) (*TimeEntry, error)
View a Time Entry This API call helps to list a particular Time Entry. GET /api/v2/tickets/[ticket_id]/time_entries/[id]
func (*Freshservice) IterAgentGroups ¶ added in v1.0.10
func (fs *Freshservice) IterAgentGroups(lago *ListAgentGroupsOption, iagf func(*AgentGroup) error) error
func (*Freshservice) IterAgentRoles ¶ added in v1.0.10
func (fs *Freshservice) IterAgentRoles(laro *ListAgentRolesOption, iarf func(*AgentRole) error) error
func (*Freshservice) IterAgents ¶ added in v1.0.10
func (fs *Freshservice) IterAgents(lao *ListAgentsOption, iaf func(*Agent) error) error
func (*Freshservice) IterApprovals ¶ added in v1.0.15
func (fs *Freshservice) IterApprovals(lao *ListApprovalsOption, iaf func(*Approval) error) error
func (*Freshservice) IterCategories ¶ added in v1.0.9
func (fs *Freshservice) IterCategories(lco *ListCategoriesOption, icf func(*Category) error) error
func (*Freshservice) IterCategoryFolders ¶ added in v1.0.9
func (fs *Freshservice) IterCategoryFolders(cid int64, lfo *ListFoldersOption, iff func(*Folder) error) error
func (*Freshservice) IterFilterAgents ¶ added in v1.0.10
func (fs *Freshservice) IterFilterAgents(fao *FilterAgentsOption, iaf func(*Agent) error) error
func (*Freshservice) IterFilterTickets ¶ added in v1.0.10
func (fs *Freshservice) IterFilterTickets(fto *FilterTicketsOption, itf func(*Ticket) error) error
func (*Freshservice) IterFolderArticles ¶ added in v1.0.9
func (fs *Freshservice) IterFolderArticles(fid int64, lao *ListArticlesOption, iaf func(*ArticleInfo) error) error
func (*Freshservice) IterRequesterGroupMembers ¶ added in v1.0.10
func (fs *Freshservice) IterRequesterGroupMembers(rgid int64, lrgmo *ListRequesterGroupMembersOption, irgmf func(*Requester) error) error
func (*Freshservice) IterRequesterGroups ¶ added in v1.0.10
func (fs *Freshservice) IterRequesterGroups(lrgo *ListRequesterGroupsOption, irgf func(*RequesterGroup) error) error
func (*Freshservice) IterRequesters ¶ added in v1.0.10
func (fs *Freshservice) IterRequesters(lro *ListRequestersOption, irf func(*Requester) error) error
func (*Freshservice) IterTicketConversations ¶ added in v1.0.9
func (fs *Freshservice) IterTicketConversations(tid int64, lco *ListConversationsOption, icf func(*Conversation) error) error
func (*Freshservice) IterTicketTimeEntries ¶ added in v1.0.10
func (fs *Freshservice) IterTicketTimeEntries(tid int64, lteo *ListTimeEntriesOption, itef func(*TimeEntry) error) error
func (*Freshservice) IterTickets ¶ added in v1.0.9
func (fs *Freshservice) IterTickets(lto *ListTicketsOption, itf func(*Ticket) error) error
func (*Freshservice) ListAgentGroups ¶ added in v1.0.9
func (fs *Freshservice) ListAgentGroups(lago *ListAgentGroupsOption) ([]*AgentGroup, bool, error)
func (*Freshservice) ListAgentRoles ¶ added in v1.0.9
func (fs *Freshservice) ListAgentRoles(laro *ListAgentRolesOption) ([]*AgentRole, bool, error)
func (*Freshservice) ListAgents ¶ added in v1.0.9
func (fs *Freshservice) ListAgents(lao *ListAgentsOption) ([]*Agent, bool, error)
func (*Freshservice) ListApprovals ¶ added in v1.0.15
func (fs *Freshservice) ListApprovals(lao *ListApprovalsOption) ([]*Approval, bool, error)
func (*Freshservice) ListCategories ¶ added in v1.0.9
func (fs *Freshservice) ListCategories(lco *ListCategoriesOption) ([]*Category, bool, error)
func (*Freshservice) ListCategoryFolders ¶ added in v1.0.9
func (fs *Freshservice) ListCategoryFolders(cid int64, lfo *ListFoldersOption) ([]*Folder, bool, error)
func (*Freshservice) ListFolderArticles ¶ added in v1.0.9
func (fs *Freshservice) ListFolderArticles(fid int64, lao *ListArticlesOption) ([]*ArticleInfo, bool, error)
func (*Freshservice) ListRequesterGroupMembers ¶ added in v1.0.9
func (fs *Freshservice) ListRequesterGroupMembers(rgid int64, lrgmo *ListRequesterGroupMembersOption) ([]*Requester, bool, error)
func (*Freshservice) ListRequesterGroups ¶ added in v1.0.9
func (fs *Freshservice) ListRequesterGroups(lrgo *ListRequesterGroupsOption) ([]*RequesterGroup, bool, error)
func (*Freshservice) ListRequesters ¶ added in v1.0.9
func (fs *Freshservice) ListRequesters(lro *ListRequestersOption) ([]*Requester, bool, error)
List Requesters Use Requester attributes to filter your list. Note: 1. Filtered results cannot be sorted. By default it is sorted by created_at in descending order. 2. Adding "include_agents=true" to the query string will include agents in the response. The default response includes only requesters and not agents. Only users who also have the "Manage Agents" permission will be able to use this modifier. 3. The query must be URL encoded (see example). 4. Query can be framed using the name of the requester fields, which can be obtained from the Supported Requester Fields Section. 5. Query string must be enclosed between a pair of double quotes and can have up to 512 characters. 6. Logical operators AND, OR along with parenthesis( ) can be used to group conditions. 7. Relational operators greater than or equal to :> and less than or equal to :< can be used along with date fields and numeric fields. 8. Input for date field should be in UTC Format. 9. The number of objects returned per page is 30. 10. To scroll through the pages add the page parameter to the url. The page number starts with 1 and should not exceed 40. 11. To filter for fields with no values assigned, use the null keyword. 12. The "~" query operator can be used for "starts with" text searches. "Starts with" search is supported for one or more of the following attributes: first_name, last_name, name, primary_email, mobile_phone_number, work_phone_number. The query format is https://domain.freshservice.com/api/v2/requesters?query="~[attribute_1|attribute_2]:'somestring'". The query needs to be URL encoded. This would return a list of users for whom attribute_1 OR attribute_2 starts with "somestring". Refer to examples 13, 14, and 15. 13. Please note that any update made to requester either in Freshservice application or through API may take a few minutes to get indexed, after which the updated results will be available through API. == Custom Fields Supported Type Single line text string Number integer Dropdown string Date date Phone number string
func (*Freshservice) ListTicketConversations ¶ added in v1.0.9
func (fs *Freshservice) ListTicketConversations(tid int64, lco *ListConversationsOption) ([]*Conversation, bool, error)
func (*Freshservice) ListTicketTimeEntries ¶ added in v1.0.10
func (fs *Freshservice) ListTicketTimeEntries(tid int64, lteo *ListTimeEntriesOption) ([]*TimeEntry, bool, error)
List All Time Entries of a Ticket This API helps to view all time entries of a particular ticket. GET /api/v2/tickets/[ticket_id]/time_entries
func (*Freshservice) ListTickets ¶ added in v1.0.9
func (fs *Freshservice) ListTickets(lto *ListTicketsOption) ([]*Ticket, bool, error)
List of Tickets Use filters to view only specific tickets (those which match the criteria that you choose). By default only tickets that have not been deleted or marked as spam will be returned, unless you use the 'deleted' filter. Note: 1. By default only tickets that have been created within the past 30 days will be returned. For older tickets, use the updated_since filter. 2. Use 'include' to embed additional details in the response. Each include will consume an additional 2 credits. For example if you embed the stats information you will be charged a total of 3 API credits (1 credit for the API call, and 2 credits for the additional stats embedding). 3. By default, only tickets from the primary workspace will be returned for accounts with the 'Workspaces' feature enabled. For tickets from other workspaces, use the workspace_id filter.
func (*Freshservice) MergeRequesters ¶ added in v1.0.9
func (fs *Freshservice) MergeRequesters(id int64, ids ...int64) (*Requester, error)
Merge secondary requesters into a primary requester.
func (*Freshservice) ReactivateAgent ¶ added in v1.0.9
func (fs *Freshservice) ReactivateAgent(id int64) (*Agent, error)
Reactivate a Agent This operation allows you to reactivate a particular deactivated agent.
func (*Freshservice) ReactivateRequester ¶ added in v1.0.9
func (fs *Freshservice) ReactivateRequester(id int64) (*Requester, error)
Reactivate a Requester This operation allows you to reactivate a particular deactivated requester.
func (*Freshservice) Restore ¶ added in v1.0.9
func (fs *Freshservice) Restore(tid int64) error
Restore a Ticket The API mentioned previously. If you deleted some tickets and regret doing so now, this API will help you restore them.
func (*Freshservice) SaveAttachment ¶ added in v1.0.9
func (fs *Freshservice) SaveAttachment(aid int64, path string) error
func (*Freshservice) SaveFile ¶ added in v1.0.9
func (fs *Freshservice) SaveFile(url string, path string) error
func (*Freshservice) SaveFileNoAuth ¶ added in v1.0.9
func (fs *Freshservice) SaveFileNoAuth(url string, path string) error
func (*Freshservice) SearchArticles ¶ added in v1.0.9
func (fs *Freshservice) SearchArticles(sao *SearchArticlesOption) ([]*ArticleInfo, bool, error)
func (*Freshservice) SendArticleToApproval ¶ added in v1.0.9
func (fs *Freshservice) SendArticleToApproval(aid int64) (*Article, error)
func (*Freshservice) UpdateAgent ¶ added in v1.0.9
func (fs *Freshservice) UpdateAgent(id int64, agent *Agent) (*Agent, error)
Update an Agent This operation allows you to modify the profile of a particular agent. Note: can_see_all_tickets_from_associated_departments will automatically be set to false unless it is explicitly set to true in the payload, irrespective of the previous value of the field.
func (*Freshservice) UpdateAgentGroup ¶ added in v1.0.9
func (fs *Freshservice) UpdateAgentGroup(id int64, ag *AgentGroup) (*AgentGroup, error)
func (*Freshservice) UpdateArticle ¶ added in v1.0.9
func (fs *Freshservice) UpdateArticle(aid int64, article *Article) (*Article, error)
func (*Freshservice) UpdateCategory ¶ added in v1.0.9
func (fs *Freshservice) UpdateCategory(cid int64, category *Category) (*Category, error)
func (*Freshservice) UpdateConversation ¶ added in v1.0.9
func (fs *Freshservice) UpdateConversation(cid int64, conversation *Conversation) (*Conversation, error)
Update a Conversation Only public & private notes can be edited.
func (*Freshservice) UpdateFolder ¶ added in v1.0.9
func (fs *Freshservice) UpdateFolder(fid int64, folder *Folder) (*Folder, error)
func (*Freshservice) UpdateRequester ¶ added in v1.0.9
func (fs *Freshservice) UpdateRequester(id int64, requester *Requester) (*Requester, error)
Update a Requester This operation allows you to modify the profile of a particular requester. Note: can_see_all_tickets_from_associated_departments will automatically be set to false unless it is explicitly set to true in the payload, irrespective of the previous value of the field.
func (*Freshservice) UpdateRequesterGroup ¶ added in v1.0.9
func (fs *Freshservice) UpdateRequesterGroup(id int64, rg *RequesterGroup) (*RequesterGroup, error)
Note: Only groups of type “manual” can be updated through this API.
func (*Freshservice) UpdateTicket ¶ added in v1.0.9
func (fs *Freshservice) UpdateTicket(tid int64, ticket *Ticket) (*Ticket, error)
Update a Ticket This API lets you make changes to the parameters of a ticket from updating statuses to changing ticket type. Note: 1. While updating tags, all the tags that need to stay associated with the Ticket should be provided in the PUT request payload. 2. The requested_for_id field can be updated only for Service Request tickets. Query Parameters Handle bypass_mandatory: To bypass mandatory fields check while updating the ticket except for requester_id, source. Any business rules trying to mandate certain fields will also be bypassed. All fields configured as mandatory upon closing or resolving the ticket will be skipped while updating the ticket. This can only be passed by an admin.
func (*Freshservice) UpdateTimeEntry ¶ added in v1.0.10
func (fs *Freshservice) UpdateTimeEntry(tid, teid int64, tm *TimeEntry) (*TimeEntry, error)
Update a Time Entry This API can be used to update/modify existing time entry. Note: 1. For a running timer, time_spent cannot be updated without stopping it.
type ListAgentGroupsOption ¶ added in v1.0.10
type ListAgentGroupsOption = PageOption
type ListAgentRolesOption ¶ added in v1.0.10
type ListAgentRolesOption = PageOption
type ListAgentsOption ¶ added in v1.0.9
type ListAgentsOption struct { Email string MobilePhoneNumber string WorkPhoneNumber string Active AgentActive State AgentState // fulltime or occasional Page int PerPage int }
func (*ListAgentsOption) IsNil ¶ added in v1.0.9
func (lao *ListAgentsOption) IsNil() bool
func (*ListAgentsOption) Values ¶ added in v1.0.9
func (lao *ListAgentsOption) Values() Values
type ListApprovalsOption ¶ added in v1.0.15
type ListApprovalsOption struct { Parent string ParentID int64 Status string ApproverID int64 Level int DelegateeID int64 Page int PerPage int }
func (*ListApprovalsOption) IsNil ¶ added in v1.0.15
func (lao *ListApprovalsOption) IsNil() bool
func (*ListApprovalsOption) Values ¶ added in v1.0.15
func (lao *ListApprovalsOption) Values() Values
type ListArticlesOption ¶ added in v1.0.9
PerPage: 1 ~ 100, default: 30
func (*ListArticlesOption) IsNil ¶ added in v1.0.9
func (lao *ListArticlesOption) IsNil() bool
func (*ListArticlesOption) Values ¶ added in v1.0.9
func (lao *ListArticlesOption) Values() Values
type ListCategoriesOption ¶ added in v1.0.9
type ListCategoriesOption = PageOption
PerPage: 1 ~ 100, default: 30
type ListConversationsOption ¶ added in v1.0.9
type ListConversationsOption = PageOption
PerPage: 1 ~ 100, default: 30
type ListFoldersOption ¶ added in v1.0.9
PerPage: 1 ~ 100, default: 30
func (*ListFoldersOption) IsNil ¶ added in v1.0.9
func (lfo *ListFoldersOption) IsNil() bool
func (*ListFoldersOption) Values ¶ added in v1.0.9
func (lfo *ListFoldersOption) Values() Values
type ListOption ¶
type ListOption = fdk.ListOption
type ListRequesterGroupMembersOption ¶ added in v1.0.10
type ListRequesterGroupMembersOption = PageOption
type ListRequesterGroupsOption ¶ added in v1.0.10
type ListRequesterGroupsOption = PageOption
type ListRequestersOption ¶ added in v1.0.9
type ListRequestersOption struct { FirstName string LastName string Name string // Concatenation of first_name and last_name with single space in-between fields. JobTitle string PrimaryEmail string Email string MobilePhoneNumber string WorkPhoneNumber string DepartmentID int64 TimeZone string Language string LocationID int64 CreatedAt Date // Date (YYYY-MM-DD) when the requester is created. UpdatedAt Date // Date (YYYY-MM-DD) when the requester is updated. IncludeAgents bool Page int PerPage int }
func (*ListRequestersOption) IsNil ¶ added in v1.0.9
func (lro *ListRequestersOption) IsNil() bool
func (*ListRequestersOption) Values ¶ added in v1.0.9
func (lro *ListRequestersOption) Values() Values
type ListTicketsOption ¶ added in v1.0.9
type ListTicketsOption struct { Filter string // The various filters available are new_and_my_open, watching, spam, deleted. WorkspaceID int64 RequestID int64 Type string UpdatedSince Time Include string // stats, requester, requester_for OrderType OrderType // asc, desc (default) Page int PerPage int }
func (*ListTicketsOption) IsNil ¶ added in v1.0.9
func (lto *ListTicketsOption) IsNil() bool
func (*ListTicketsOption) Values ¶ added in v1.0.9
func (lto *ListTicketsOption) Values() Values
type ListTimeEntriesOption ¶ added in v1.0.10
type ListTimeEntriesOption = PageOption
PerPage: 1 ~ 100, default: 30
type Note ¶ added in v1.0.9
type Note struct { // Attachments associated with the conversation. The total size of all of a ticket's attachments cannot exceed 20MB. Attachments []*Attachment `json:"attachments,omitempty"` // Content of the conversation in HTML Body string `json:"body,omitempty"` // Set to true if a particular conversation should appear as being created from outside (i.e., not through web portal) Incoming bool `json:"incoming"` // Email addresses of agents/users who need to be notified about this note NotifyEmails []string `json:"notify_emails,omitempty"` // Set to true if the note is private. The default value is true. Private bool `json:"private"` // ID of the agent/user who is adding the conversation UserID int64 `json:"user_id,omitempty"` }
func (*Note) AddAttachment ¶ added in v1.0.9
type PageOption ¶ added in v1.0.9
type PageOption = fdk.PageOption
type Reply ¶ added in v1.0.9
type Reply struct { // Content of the conversation in HTML Body string `json:"body,omitempty"` // Attachments associated with the conversation. The total size of all of a ticket's attachments cannot exceed 20MB. Attachments []*Attachment `json:"attachments,omitempty"` // The email address from which the reply is sent. By default the global support email will be used. FromEmail string `json:"from_email,omitempty"` // ID of the agent/user who is adding the conversation UserID int64 `json:"user_id,omitempty"` // Email address added in the 'cc' field of the outgoing ticket email. CcEmails []string `json:"cc_emails,omitempty"` // Email address added in the 'bcc' field of the outgoing ticket email. BccEmails []string `json:"bcc_emails,omitempty"` }
func (*Reply) AddAttachment ¶ added in v1.0.9
type Requester ¶ added in v1.0.9
type Requester struct { ID int64 `json:"id,omitempty"` // First name of the requester FirstName string `json:"first_name,omitempty"` // Last name of the requester. LastName string `json:"last_name,omitempty"` // Job title of the requester. JobTitle string `json:"job_title,omitempty"` // Primary email address of the requester. PrimaryEmail string `json:"primary_email,omitempty"` // Additional/secondary emails associated with the requester. SecondaryEmails []string `json:"secondary_emails,omitempty"` // Work phone number of the requester. WorkPhoneNumber string `json:"work_phone_number,omitempty"` // Mobile phone number of the requester. MobilePhoneNumber string `json:"mobile_phone_number,omitempty"` // Unique IDs of the departments associated with the requester DepartmentIDs []int64 `json:"department_ids,omitempty"` // Set to true if the requester must be allowed to view tickets filed by other members of the department, and false otherwise CanSeeAllTicketsFromAssociatedDepartments bool `json:"can_see_all_tickets_from_associated_departments,omitempty"` // User ID of the requester’s reporting manager. ReportingManagerID int64 `json:"reporting_manager_id,omitempty"` // Address of the requester. Address string `json:"address,omitempty"` // Time zone of the requester. TimeZone string `json:"time_zone,omitempty"` // Time format for the requester.Possible values: 12h (12 hour format), 24h (24 hour format) TimeFormat string `json:"time_format,omitempty"` // Language used by the requester. Language string `json:"language,omitempty"` // Unique ID of the location associated with the requester. LocationID int64 `json:"location_id,omitempty"` // Background information of the requester. BackgroundInformation string `json:"background_information,omitempty"` // Key-value pair containing the names and values of the (custom) requester fields. CustomFields map[string]any `json:"custom_fields,omitempty"` // Set to true if the user is active, and false if the user account has been deactivated. Active bool `json:"active,omitempty"` // Set to true if the user has logged in to Freshservice at least once, and false otherwise. HasLoggedIn bool `json:"has_logged_in,omitempty"` // Set to true if the user is an agent, false if the user is a requester IsAgent bool `json:"is_agent,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
type RequesterField ¶ added in v1.0.9
type RequesterField struct { ID int64 `json:"id,omitempty"` // Label of the requester field. Label string `json:"label,omitempty"` // Display name for the field (as seen in the support portal). LabelForRequesters string `json:"label_for_requesters,omitempty"` // Name of the requester field. Name string `json:"name,omitempty"` // Position of the requester field. Position int `json:"position,omitempty"` // For custom requester fields, type of value associated with the field will be given (Examples custom_date, custom_text...). Type string `json:"type,omitempty"` // Set to true if the field can be updated by requesters during signup. EditableInSignup bool `json:"editable_in_signup,omitempty"` // Requesters can edit the field in the support portal. RequestersCanEdit bool `json:"requesters_can_edit,omitempty"` // Set to true if the field is mandatory in the support portal. RequiredForRequesters bool `json:"required_for_requesters,omitempty"` // Requesters can see the field in the support portal. DisplayedForRequesters bool `json:"displayed_for_requesters,omitempty"` // Set to true if the field is mandatory for agents. RequiredForAgents bool `json:"required_for_agents,omitempty"` // List of values supported by the field. Choices any `json:"choices,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
func (*RequesterField) String ¶ added in v1.0.9
func (rf *RequesterField) String() string
type RequesterGroup ¶ added in v1.0.9
type RequesterGroup struct { ID int64 `json:"id,omitempty"` // Name of the requester group. Name string `json:"name,omitempty"` // Description of the requester group. Description string `json:"description,omitempty"` // Method of requester addition. “manual” if individual requesters can be chosen manually, and “rule_based” if members are automatically added based on rules. Type RequesterGroupType `json:"type,omitempty"` }
func (*RequesterGroup) String ¶ added in v1.0.9
func (rg *RequesterGroup) String() string
type RequesterGroupType ¶ added in v1.0.9
type RequesterGroupType string
const ( RequesterGroupTypeManual RequesterGroupType = "manual" RequesterGroupTypeRuleBased RequesterGroupType = "rule_based" )
type SearchArticlesOption ¶
type SearchArticlesOption struct { SearchTerm string // The keywords for which the solution articles have to be searched. UserEmail string // By default, the API will search the articles for the user whose API key is provided. If you want to search articles for a different user, please provide their user_email. Page int PerPage int }
func (*SearchArticlesOption) IsNil ¶ added in v1.0.9
func (sao *SearchArticlesOption) IsNil() bool
func (*SearchArticlesOption) Values ¶
func (sao *SearchArticlesOption) Values() Values
type Ticket ¶ added in v1.0.9
type Ticket struct { // Unique ID of the ticket ID int64 `json:"id,omitempty"` // ID of the workspace to which the ticket belongs. // The attribute is applicable only for accounts with the 'Workspaces' feature enabled. WorkspaceID int64 `json:"workspace_id,omitempty"` // ID of the department to which this ticket belongs. DepartmentID int64 `json:"department_id,omitempty"` // Ticket attachments. The total size of these attachments cannot exceed 40MB. Attachments []*Attachment `json:"attachments,omitempty"` // Name of the requester Name string `json:"name,omitempty"` // Email address of the requester. If no contact exists with this email address in Freshdesk, it will be added as a new contact. Email string `json:"email,omitempty"` // Phone number of the requester. If no contact exists with this phone number in Freshdesk, it will be added as a new contact. If the phone number is set and the email address is not, then the name attribute is mandatory. Phone string `json:"phone,omitempty"` // User ID of the requester. For existing contacts, the requester_id can be passed instead of the requester's email. RequesterID int64 `json:"requester_id,omitempty"` // ID of the agent to whom the ticket has been assigned. ResponderID int64 `json:"responder_id,omitempty"` // Helps categorize the ticket according to the different kinds of issues your support team deals with. Type string `json:"type,omitempty"` // Status of the ticket Status TicketStatus `json:"status,omitempty"` // Priority of the ticket Priority TicketPriority `json:"priority,omitempty"` // The channel through which the ticket was created Source TicketSource `json:"source,omitempty"` // Set to true if the ticket has been deleted/trashed. Deleted tickets will not be displayed in any views except the "deleted" filter Deleted bool `json:"deleted,omitempty"` // Set to true if the ticket has been marked as spam Spam bool `json:"spam,omitempty"` // Timestamp that denotes when the ticket is due to be resolved DueBy *Time `json:"due_by,omitempty"` // Timestamp that denotes when the first response is due FrDueBy *Time `json:"fr_due_by,omitempty"` // Set to true if the ticket has been escalated for any reason IsEscalated bool `json:"is_escalated,omitempty"` // Set to true if the ticket has been escalated as the result of first response time being breached FrEscalated bool `json:"fr_escalated,omitempty"` // Email addresses to which the ticket was originally sent ToEmails []string `json:"to_emails,omitempty"` // Email address added in the 'cc' field of the incoming ticket email CcEmails []string `json:"cc_emails,omitempty"` // Email address(e)s added while forwarding a ticket FwdEmails []string `json:"fwd_emails,omitempty"` // Email address added while replying to a ticket ReplyCcEmails []string `json:"reply_cc_emails,omitempty"` // ID of email config which is used for this ticket. (i.e., support@yourcompany.com/sales@yourcompany.com) EmailConfigID int64 `json:"email_config_id,omitempty"` // ID of the group to which the ticket has been assigned GroupID int64 `json:"group_id,omitempty"` // Subject of the ticket Subject string `json:"subject,omitempty"` // HTML content of the ticket Description string `json:"description,omitempty"` // Content of the ticket in plain text DescriptionText string `json:"description_text,omitempty"` // Tags that have been associated with the ticket Tags []string `json:"tags,omitempty"` // Key value pairs containing the names and values of custom fields. CustomFields map[string]any `json:"custom_fields,omitempty"` // include=requester Requester *Requester `json:"requester,omitempty"` // include=conversations Conversations []*Conversation `json:"conversations,omitempty"` // Ticket Category. Category string `json:"category,omitempty"` // Ticket sub category. SubCategory string `json:"sub_category,omitempty"` // Ticket item category. ItemCategory string `json:"item_category,omitempty"` // Ticket creation timestamp CreatedAt *Time `json:"created_at,omitempty"` // Ticket updated timestamp UpdatedAt *Time `json:"updated_at,omitempty"` }
func (*Ticket) AddAttachment ¶ added in v1.0.9
type TicketActivity ¶ added in v1.0.9
type TicketActivity struct { Actor *Actor `json:"actor,omitempty"` Content string `json:"content,omitempty"` SubContents []string `json:"sub_contents,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` }
func (*TicketActivity) String ¶ added in v1.0.9
func (ta *TicketActivity) String() string
type TicketField ¶ added in v1.0.9
type TicketField struct { ID int64 `json:"id,omitempty"` // ID of the workspace to which this ticket belongs. The attribute is applicable only for accounts with the 'Workspaces' feature enabled. WorkspaceID int64 `json:"workspace_id,omitempty"` // Name of the ticket field. Name string `json:"name,omitempty"` // Label of the field for display Label string `json:"label,omitempty"` // Description of the field Description string `json:"description,omitempty"` // Indicates if the field is a checkbox, dropdown, text field FieldType string `json:"field_type,omitempty"` // True if the field is marked mandatory Required bool `json:"required,omitempty"` // True if the field is marked mandatory while closing the Release item RequiredForClosure bool `json:"required_for_closure,omitempty"` // True if the field is a default field. False if customm DefaultField bool `json:"default_field,omitempty"` // List of values supported by the field. Choices any `json:"choices,omitempty"` // contain details of nested fields NestedFields any `json:"nested_fields,omitempty"` // Set to true if the field is mandatory for Agents RequiredForAgents bool `json:"required_for_agents,omitempty"` // Set to true if the field is mandatory in the customer portal RequiredForCustomers bool `json:"required_for_customer,omitempty"` // Display name for the field (as seen in the customer portal) LabelForCustomers bool `json:"label_for_customers,omitempty"` // Set to true if the field can be updated by customers CustomersCanEdit bool `json:"customer_can_edit,omitempty"` // Set to true if the field is displayed in the customer portal DisplayedToCustomers bool `json:"displayed_to_customers,omitempty"` // Applicable only for the requester field. Set to true if customer can add additional requesters to a ticket PortalCc bool `json:"portal_cc,omitempty"` // Applicable only if portal_cc is set to true. Value will be all when a customer can add any requester to the CC list and company when a customer can add only company contacts to the CC list PortalCcTo bool `json:"portal_cc_to,omitempty"` // Applicable only for custom_date field. When ‘Request time information’ is selected, the field date_only returns false and if unchecked, date_only returns true DateOnly bool `json:"date_only,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` }
func (*TicketField) String ¶ added in v1.0.9
func (tf *TicketField) String() string
type TicketFilter ¶ added in v1.0.9
type TicketFilter string
type TicketPriority ¶ added in v1.0.9
type TicketPriority int
func ParseTicketPriority ¶ added in v1.0.9
func ParseTicketPriority(s string) TicketPriority
func (TicketPriority) String ¶ added in v1.0.9
func (tp TicketPriority) String() string
type TicketSource ¶ added in v1.0.9
type TicketSource int
func ParseTicketSource ¶ added in v1.0.9
func ParseTicketSource(s string) TicketSource
func (TicketSource) String ¶ added in v1.0.9
func (ts TicketSource) String() string
type TicketStatus ¶ added in v1.0.9
type TicketStatus int
func ParseTicketStatus ¶ added in v1.0.9
func ParseTicketStatus(s string) TicketStatus
func (TicketStatus) String ¶ added in v1.0.9
func (ts TicketStatus) String() string
type TimeEntry ¶ added in v1.0.10
type TimeEntry struct { // Id of the time entry ID int64 `json:"id,omitempty"` // ID of the workspace to which the time entry belongs(inherited from the ticket's workspace). The attribute is applicable only for accounts with the 'Workspaces' feature enabled. WorkspaceID int64 `json:"workspace_id,omitempty"` // Set to true if timer is currently running. Default value is false. // At a time, only one timer can be running for an agent across the account TimerRunning bool `json:"timer_running"` // Boolean Set as true if the time-entry is billable. Default value is true Billable bool `json:"billable"` // The total amount of time spent by the timer in hh::mm format. // This field cannot be set if timer_running is true. // Mandatory if timer_running is false TimeSpent TimeSpent `json:"time_spent,omitempty"` // Time at which the timer is executed. // Default value (unless given in request) is the time at which timer is added. // Should be less than or equal to current date_time ExecutedAt *Time `json:"executed_at,omitempty"` // Id of the task assigned to the time-entry. Task should be valid on the given ticket and assigned to agent_id TaskID int64 `json:"task_id,omitempty"` // Description of the time-entry Note string `json:"note,omitempty"` // The user/agent to whom this time-entry is assigned AgentID int64 `json:"agent_id,omitempty"` // Key value pairs containing the names and values of custom fields. CustomFields map[string]any `json:"custom_fields,omitempty"` // The time at which the time-entry is added. If a timer, which is in stopped state, is started again, this holds date_time at which the timer is started again StartTime *Time `json:"start_time,omitempty"` // Ticket creation timestamp CreatedAt *Time `json:"created_at,omitempty"` // Ticket updated timestamp UpdatedAt *Time `json:"updated_at,omitempty"` }
type TimeSpent ¶ added in v1.0.10
func ParseTimeSpent ¶ added in v1.0.10
Source Files
¶
- agent.go
- agent_field.go
- agent_group.go
- agent_groups.go
- agent_role.go
- agent_roles.go
- agents.go
- approval.go
- approvals.go
- article.go
- category.go
- conversation.go
- folder.go
- freshservice.go
- note.go
- reply.go
- requester.go
- requester_field.go
- requester_group.go
- requesters.go
- solutions.go
- ticket.go
- ticket_activity.go
- ticket_field.go
- tickets.go
- time_entries.go
- time_entry.go