Documentation
¶
Index ¶
- Constants
- func GetAgentTicketURL(domain string, tid int64) string
- func GetHelpdeskAttachmentURL(domain string, aid int64) string
- func GetSolutionArticleURL(domain string, aid int64) string
- type Actor
- type Agent
- type AgentActive
- type AgentCreate
- type AgentField
- type AgentGroup
- type AgentGroupCreate
- type AgentGroupUnassignedFor
- type AgentGroupUpdate
- type AgentRole
- type AgentScoreboardLevel
- type AgentState
- type AgentUpdate
- type Approval
- type ApprovalInfo
- type ApprovalSetting
- type ApprovalStatus
- type ApprovalType
- type Article
- type ArticleCreate
- type ArticleInfo
- type ArticleStatus
- type ArticleType
- type ArticleUpdate
- type AssignRole
- type Attachment
- type Attachments
- type Category
- type CategoryCreate
- type CategoryUpdate
- type Client
- func (c *Client) AddRequesterToRequesterGroup(ctx context.Context, rgid, rid int64) error
- func (c *Client) ConvertAgentToRequester(ctx context.Context, id int64) (*Agent, error)
- func (c *Client) ConvertRequesterToAgent(ctx context.Context, id int64) (*Agent, error)
- func (c *Client) CopyAttachment(ctx context.Context, aid int64, w io.Writer) error
- func (c *Client) CreateAgent(ctx context.Context, agent *AgentCreate) (*Agent, error)
- func (c *Client) CreateAgentGroup(ctx context.Context, ag *AgentGroupCreate) (*AgentGroup, error)
- func (c *Client) CreateArticle(ctx context.Context, article *ArticleCreate) (*Article, error)
- func (c *Client) CreateCategory(ctx context.Context, category *CategoryCreate) (*Category, error)
- func (c *Client) CreateChildTicket(ctx context.Context, tid int64, ticket *Ticket) (*Ticket, error)
- func (c *Client) CreateFolder(ctx context.Context, folder *FolderCreate) (*Folder, error)
- func (c *Client) CreateNote(ctx context.Context, tid int64, note *Note) (*Conversation, error)
- func (c *Client) CreateReply(ctx context.Context, tid int64, reply *Reply) (*Conversation, error)
- func (c *Client) CreateRequester(ctx context.Context, requester *RequesterCreate) (*Requester, error)
- func (c *Client) CreateRequesterGroup(ctx context.Context, rg *RequesterGroup) (*RequesterGroup, error)
- func (c *Client) CreateTicket(ctx context.Context, ticket *TicketCreate) (*Ticket, error)
- func (c *Client) CreateTimeEntry(ctx context.Context, tid int64, tm *TimeEntryCreate) (*TimeEntry, error)
- func (c *Client) DeactivateAgent(ctx context.Context, id int64) error
- func (c *Client) DeactivateRequester(ctx context.Context, id int64) error
- func (c *Client) DeleteAgentGroup(ctx context.Context, id int64) error
- func (c *Client) DeleteArticle(ctx context.Context, aid int64) error
- func (c *Client) DeleteCategory(ctx context.Context, cid int64) error
- func (c *Client) DeleteConversation(ctx context.Context, cid int64) error
- func (c *Client) DeleteConversationAttachment(ctx context.Context, cid, aid int64) error
- func (c *Client) DeleteFolder(ctx context.Context, fid int64) error
- func (c *Client) DeleteRequesterFromRequesterGroup(ctx context.Context, rgid, rid int64) error
- func (c *Client) DeleteRequesterGroup(ctx context.Context, id int64) error
- func (c *Client) DeleteTicket(ctx context.Context, tid int64) error
- func (c *Client) DeleteTicketAttachment(ctx context.Context, tid, aid int64) error
- func (c *Client) DeleteTimeEntry(ctx context.Context, tid, teid int64) error
- func (c *Client) DoCopyFile(ctx context.Context, url string, w io.Writer) error
- func (c *Client) DoCopyFileNoAuth(ctx context.Context, url string, w io.Writer) error
- func (c *Client) DoDelete(ctx context.Context, url string) error
- func (c *Client) DoGet(ctx context.Context, url string, result any) error
- func (c *Client) DoList(ctx context.Context, url string, lo ListOption, result any) (bool, error)
- func (c *Client) DoPost(ctx context.Context, url string, source, result any) error
- func (c *Client) DoPut(ctx context.Context, url string, source, result any) error
- func (c *Client) DoReadFile(ctx context.Context, url string) ([]byte, error)
- func (c *Client) DoReadFileNoAuth(ctx context.Context, url string) ([]byte, error)
- func (c *Client) DoSaveFile(ctx context.Context, url string, path string) error
- func (c *Client) DoSaveFileNoAuth(ctx context.Context, url string, path string) error
- func (c *Client) Endpoint(format string, a ...any) string
- func (c *Client) FilterAgents(ctx context.Context, fao *FilterAgentsOption) ([]*Agent, bool, error)
- func (c *Client) FilterTickets(ctx context.Context, fto *FilterTicketsOption) ([]*Ticket, bool, error)
- func (c *Client) ForgetAgent(ctx context.Context, id int64) error
- func (c *Client) ForgetRequester(ctx context.Context, id int64) error
- func (c *Client) GetAgent(ctx context.Context, id int64) (*Agent, error)
- func (c *Client) GetAgentFields(ctx context.Context) ([]*AgentField, error)
- func (c *Client) GetAgentGroup(ctx context.Context, id int64) (*AgentGroup, error)
- func (c *Client) GetAgentRole(ctx context.Context, id int64) (*AgentRole, error)
- func (c *Client) GetAgentTicketURL(tid int64) string
- func (c *Client) GetArticle(ctx context.Context, aid int64) (*Article, error)
- func (c *Client) GetCategory(ctx context.Context, cid int64) (*Category, error)
- func (c *Client) GetFolder(ctx context.Context, fid int64) (*Folder, error)
- func (c *Client) GetHelpdeskAttachmentURL(aid int64) string
- func (c *Client) GetRequester(ctx context.Context, id int64) (*Requester, error)
- func (c *Client) GetRequesterFields(ctx context.Context, include ...string) ([]*RequesterField, error)
- func (c *Client) GetRequesterGroup(ctx context.Context, id int64) (*RequesterGroup, error)
- func (c *Client) GetSolutionArticleURL(aid int64) string
- func (c *Client) GetTicket(ctx context.Context, tid int64, include ...string) (*Ticket, error)
- func (c *Client) GetTicketActivities(ctx context.Context, tid int64) ([]*TicketActivity, error)
- func (c *Client) GetTimeEntry(ctx context.Context, tid, teid int64) (*TimeEntry, error)
- func (c *Client) GetWorkspace(ctx context.Context, id int64) (*Workspace, error)
- func (c *Client) IterAgentGroups(ctx context.Context, lago *ListAgentGroupsOption, iagf func(*AgentGroup) error) error
- func (c *Client) IterAgentRoles(ctx context.Context, laro *ListAgentRolesOption, iarf func(*AgentRole) error) error
- func (c *Client) IterAgents(ctx context.Context, lao *ListAgentsOption, iaf func(*Agent) error) error
- func (c *Client) IterApprovals(ctx context.Context, lao *ListApprovalsOption, iaf func(*Approval) error) error
- func (c *Client) IterCategories(ctx context.Context, lco *ListCategoriesOption, icf func(*Category) error) error
- func (c *Client) IterCategoryFolders(ctx context.Context, cid int64, lfo *ListFoldersOption, ...) error
- func (c *Client) IterFilterAgents(ctx context.Context, fao *FilterAgentsOption, iaf func(*Agent) error) error
- func (c *Client) IterFilterTickets(ctx context.Context, fto *FilterTicketsOption, itf func(*Ticket) error) error
- func (c *Client) IterFolderArticles(ctx context.Context, fid int64, lao *ListArticlesOption, ...) error
- func (c *Client) IterRequesterGroupMembers(ctx context.Context, rgid int64, lrgmo *ListRequesterGroupMembersOption, ...) error
- func (c *Client) IterRequesterGroups(ctx context.Context, lrgo *ListRequesterGroupsOption, ...) error
- func (c *Client) IterRequesters(ctx context.Context, lro *ListRequestersOption, irf func(*Requester) error) error
- func (c *Client) IterTicketConversations(ctx context.Context, tid int64, lco *ListConversationsOption, ...) error
- func (c *Client) IterTicketTimeEntries(ctx context.Context, tid int64, lteo *ListTimeEntriesOption, ...) error
- func (c *Client) IterTickets(ctx context.Context, lto *ListTicketsOption, itf func(*Ticket) error) error
- func (c *Client) IterWorkspaces(ctx context.Context, lwo *ListWorkspacesOption, iwf func(*Workspace) error) error
- func (c *Client) ListAgentGroups(ctx context.Context, lago *ListAgentGroupsOption) ([]*AgentGroup, bool, error)
- func (c *Client) ListAgentRoles(ctx context.Context, laro *ListAgentRolesOption) ([]*AgentRole, bool, error)
- func (c *Client) ListAgents(ctx context.Context, lao *ListAgentsOption) ([]*Agent, bool, error)
- func (c *Client) ListApprovals(ctx context.Context, lao *ListApprovalsOption) ([]*Approval, bool, error)
- func (c *Client) ListCategories(ctx context.Context, lco *ListCategoriesOption) ([]*Category, bool, error)
- func (c *Client) ListCategoryFolders(ctx context.Context, cid int64, lfo *ListFoldersOption) ([]*Folder, bool, error)
- func (c *Client) ListFolderArticles(ctx context.Context, fid int64, lao *ListArticlesOption) ([]*ArticleInfo, bool, error)
- func (c *Client) ListRequesterGroupMembers(ctx context.Context, rgid int64, lrgmo *ListRequesterGroupMembersOption) ([]*Requester, bool, error)
- func (c *Client) ListRequesterGroups(ctx context.Context, lrgo *ListRequesterGroupsOption) ([]*RequesterGroup, bool, error)
- func (c *Client) ListRequesters(ctx context.Context, lro *ListRequestersOption) ([]*Requester, bool, error)
- func (c *Client) ListTicketConversations(ctx context.Context, tid int64, lco *ListConversationsOption) ([]*Conversation, bool, error)
- func (c *Client) ListTicketFields(ctx context.Context) ([]*TicketField, error)
- func (c *Client) ListTicketTimeEntries(ctx context.Context, tid int64, lteo *ListTimeEntriesOption) ([]*TimeEntry, bool, error)
- func (c *Client) ListTickets(ctx context.Context, lto *ListTicketsOption) ([]*Ticket, bool, error)
- func (c *Client) ListWorkspaces(ctx context.Context, lwo *ListWorkspacesOption) ([]*Workspace, bool, error)
- func (c *Client) MergeRequesters(ctx context.Context, id int64, ids ...int64) (*Requester, error)
- func (c *Client) ReactivateAgent(ctx context.Context, id int64) (*Agent, error)
- func (c *Client) ReactivateRequester(ctx context.Context, id int64) (*Requester, error)
- func (c *Client) ReadAttachment(ctx context.Context, aid int64) ([]byte, error)
- func (c *Client) Restore(ctx context.Context, tid int64) error
- func (c *Client) SaveAttachment(ctx context.Context, aid int64, path string) error
- func (c *Client) SearchArticles(ctx context.Context, sao *SearchArticlesOption) ([]*ArticleInfo, bool, error)
- func (c *Client) SendArticleToApproval(ctx context.Context, aid int64) (*Article, error)
- func (c *Client) UpdateAgent(ctx context.Context, id int64, agent *AgentUpdate) (*Agent, error)
- func (c *Client) UpdateAgentGroup(ctx context.Context, id int64, ag *AgentGroupUpdate) (*AgentGroup, error)
- func (c *Client) UpdateArticle(ctx context.Context, aid int64, article *ArticleUpdate) (*Article, error)
- func (c *Client) UpdateCategory(ctx context.Context, cid int64, category *CategoryUpdate) (*Category, error)
- func (c *Client) UpdateConversation(ctx context.Context, cid int64, note *Note) (*Conversation, error)
- func (c *Client) UpdateFolder(ctx context.Context, fid int64, folder *FolderUpdate) (*Folder, error)
- func (c *Client) UpdateRequester(ctx context.Context, id int64, requester *RequesterUpdate) (*Requester, error)
- func (c *Client) UpdateRequesterGroup(ctx context.Context, id int64, rg *RequesterGroup) (*RequesterGroup, error)
- func (c *Client) UpdateTicket(ctx context.Context, tid int64, ticket *TicketUpdate) (*Ticket, error)
- func (c *Client) UpdateTimeEntry(ctx context.Context, tid, teid int64, tm *TimeEntryUpdate) (*TimeEntry, error)
- type Conversation
- type ConversationSource
- type Date
- type Delegatee
- type FieldError
- type File
- type Files
- type FilterAgentsOption
- type FilterOption
- type FilterTicketsOption
- type Folder
- type FolderCreate
- type FolderUpdate
- type FolderVisibility
- type Freshservice
- 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 ListWorkspacesOption
- type Note
- type OrderType
- type PageOption
- type Reply
- type Requester
- type RequesterCreate
- type RequesterField
- type RequesterGroup
- type RequesterGroupType
- type RequesterUpdate
- type ResultError
- type SearchArticlesOption
- type Ticket
- type TicketActivity
- type TicketCreate
- type TicketField
- type TicketImpact
- type TicketPriority
- type TicketSource
- type TicketStatus
- type TicketUpdate
- type TicketUrgency
- type Time
- type TimeEntry
- type TimeEntryCreate
- type TimeEntryUpdate
- type TimeSpent
- type Values
- type WithFiles
- type Workspace
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 TicketUrgencyLow TicketUrgency = 1 TicketUrgencyMedium TicketUrgency = 2 TicketUrgencyHigh TicketUrgency = 3 TicketImpactLow TicketImpact = 1 TicketImpactMedium TicketImpact = 2 TicketImpactHigh TicketImpact = 3 TicketFilterNewAndMyOpen = "new_and_my_open" TicketFilterWatching = "watching" TicketFilterSpam = "spam" TicketFilterDeleted = "deleted" )
const ( TicketIncludeTags = "tags" TicketIncludeConversations = "conversations" TicketIncludeRequester = "requester" TicketIncludeRequestedFor = "requested_for" TicketIncludeStats = "stats" TicketIncludeProblem = "problem" TicketIncludeAssets = "assets" TicketIncludeChanges = "changes" TicketIncludeRelatedTickets = "related_tickets" TicketIncludeOnboardingContext = "onboarding_context" TicketIncludeOffboardingContext = "offboarding_context" TicketTypeIncident = "Incident" TicketTypeServiceRequest = "Service Request" )
const ( WorkspaceStateActive = "active" WorkspaceStateDraft = "draft" )
const RequesterFieldIncludeUserFieldGroups = "user_field_groups"
Variables ¶
This section is empty.
Functions ¶
func GetAgentTicketURL ¶
GetAgentTicketURL return a permlink for agent ticket URL
func GetHelpdeskAttachmentURL ¶
GetHelpdeskAttachmentURL return a permlink for helpdesk attachment/avator URL
func GetSolutionArticleURL ¶
GetSolutionArticleURL return a permlink for solution article URL
Types ¶
type Agent ¶
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 ¶
type AgentActive string
type AgentCreate ¶
type AgentCreate struct {
// 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"`
Roles []*AssignRole `json:"roles,omitempty"`
// Signature of the agent in HTML format.
Signature string `json:"signature,omitempty"`
// Key-value pair containing the names and values of the (custom) requester fields.
CustomFields map[string]any `json:"custom_fields,omitempty"`
}
func (*AgentCreate) String ¶
func (a *AgentCreate) String() string
type AgentField ¶
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 ¶
func (af *AgentField) String() string
type AgentGroup ¶
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"`
// WorkspaceID ID of the workspace to which this agent group belongs.
// The attribute is applicable only for accounts with the 'Workspaces' feature enabled.
// The default value is the ID of the primary workspace of the account.
// The response contains workspace_id to which an agent group belongs.
WorkspaceID int64 `json:"workspace_id,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 ¶
func (ag *AgentGroup) String() string
type AgentGroupCreate ¶
type AgentGroupCreate struct {
// Name of the group
Name string `json:"name,omitempty"`
// Description of the group.
Description string `json:"description,omitempty"`
// WorkspaceID ID of the workspace to which this agent group belongs.
// The attribute is applicable only for accounts with the 'Workspaces' feature enabled.
// The default value is the ID of the primary workspace of the account.
// The response contains workspace_id to which an agent group belongs.
WorkspaceID int64 `json:"workspace_id,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"`
// 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"`
}
func (*AgentGroupCreate) String ¶
func (ag *AgentGroupCreate) String() string
type AgentGroupUnassignedFor ¶
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 AgentGroupUpdate ¶
type AgentGroupUpdate = AgentGroupCreate
type AgentRole ¶
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 ¶
type AgentScoreboardLevel int
const ( AgentScoreboardLevelBeginner AgentScoreboardLevel = 1 AgentScoreboardLevelIntermediate AgentScoreboardLevel = 2 AgentScoreboardLevelProfessional AgentScoreboardLevel = 3 AgentScoreboardLevelExpert AgentScoreboardLevel = 4 AgentScoreboardLevelMaster AgentScoreboardLevel = 5 AgentScoreboardLevelGuru AgentScoreboardLevel = 6 )
func ParseAgentScoreboardLevel ¶
func ParseAgentScoreboardLevel(s string) AgentScoreboardLevel
func (AgentScoreboardLevel) String ¶
func (asl AgentScoreboardLevel) String() string
type AgentState ¶
type AgentState string
type AgentUpdate ¶
type AgentUpdate = AgentCreate
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 ¶
func (*ApprovalInfo) String ¶
func (a *ApprovalInfo) String() string
type ApprovalSetting ¶
type ApprovalSetting struct {
ApprovalType int `json:"approval_type,omitempty"`
ApproverIDs []int64 `json:"approver_ids,omitempty"`
}
func (*ApprovalSetting) String ¶
func (a *ApprovalSetting) String() string
type ApprovalStatus ¶
type ApprovalStatus int
func (ApprovalStatus) String ¶
func (as ApprovalStatus) String() string
type ApprovalType ¶
type ApprovalType int
type Article ¶
type Article struct {
ID int64 `json:"id,omitempty"`
// WorkspaceID ID of the workspace to which the solution article belongs.
// This attribute is applicable only to accounts on the Employee Support Mode.
WorkspaceID int64 `json:"workspace_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 *Date `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"`
}
type ArticleCreate ¶
type ArticleCreate struct {
// Title of the solution article
Title string `json:"title,omitempty"`
// Article from external url link
URL string `json:"url,omitempty"`
// Description of the solution article
Description string `json:"description,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"`
// Status of the solution article. ( 1 - draft, 2 - published )
Status ArticleStatus `json:"status,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"`
// Date in future when this article would need to be reviewed again.
ReviewDate *Date `json:"review_date,omitempty"`
// Unique ID of the primary language article
ParentID int64 `json:"parent_id,omitempty"`
// Language of secondary solution article, For example: French -> “fr”
Language string `json:"language,omitempty"`
}
func (*ArticleCreate) AddAttachment ¶
func (a *ArticleCreate) AddAttachment(path string, data ...[]byte)
func (*ArticleCreate) Files ¶
func (a *ArticleCreate) Files() Files
func (*ArticleCreate) String ¶
func (a *ArticleCreate) String() string
func (*ArticleCreate) Values ¶
func (a *ArticleCreate) Values() Values
type ArticleInfo ¶
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 ¶
func (ai *ArticleInfo) String() string
type ArticleStatus ¶
type ArticleStatus int
func ParseArticleStatus ¶
func ParseArticleStatus(s string) ArticleStatus
func (ArticleStatus) String ¶
func (as ArticleStatus) String() string
type ArticleType ¶
type ArticleType int
func ParseArticleType ¶
func ParseArticleType(s string) ArticleType
func (ArticleType) String ¶
func (at ArticleType) String() string
type ArticleUpdate ¶
type ArticleUpdate = ArticleCreate
type AssignRole ¶
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 ¶
func (ar *AssignRole) String() string
type Attachment ¶
type Attachment = fresh.Attachment
func NewAttachment ¶
func NewAttachment(file string, data ...[]byte) *Attachment
type Attachments ¶
type Attachments = fresh.Attachments
type Category ¶
type Category struct {
ID int64 `json:"id,omitempty"`
// WorkspaceID ID of the workspace to which the solution category belongs.
// This attribute is applicable only to accounts on the Employee Support Mode.
WorkspaceID int64 `json:"workspace_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 CategoryCreate ¶
type CategoryCreate struct {
// WorkspaceID ID of the workspace to which the solution category belongs.
// This attribute is applicable only to accounts on the Employee Support Mode.
WorkspaceID int64 `json:"workspace_id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
// List of portal IDs where this category is visible
VisibleInPortals []int64 `json:"visible_in_portals,omitempty"`
}
func (*CategoryCreate) String ¶
func (c *CategoryCreate) String() string
type CategoryUpdate ¶
type CategoryUpdate = CategoryCreate
type Client ¶ added in v1.1.6
func (*Client) AddRequesterToRequesterGroup ¶ added in v1.1.6
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 (*Client) ConvertAgentToRequester ¶ added in v1.1.6
Convert a particular agent into a requester.
func (*Client) ConvertRequesterToAgent ¶ added in v1.1.6
Convert a requester to an occasional agent with SD Agent role and no group memberships.
func (*Client) CopyAttachment ¶ added in v1.1.6
func (*Client) CreateAgent ¶ added in v1.1.6
func (*Client) CreateAgentGroup ¶ added in v1.1.6
func (c *Client) CreateAgentGroup(ctx context.Context, ag *AgentGroupCreate) (*AgentGroup, error)
func (*Client) CreateArticle ¶ added in v1.1.6
func (*Client) CreateCategory ¶ added in v1.1.6
func (*Client) CreateChildTicket ¶ added in v1.1.6
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 (*Client) CreateFolder ¶ added in v1.1.6
func (*Client) CreateNote ¶ added in v1.1.6
func (*Client) CreateReply ¶ added in v1.1.6
func (*Client) CreateRequester ¶ added in v1.1.6
func (*Client) CreateRequesterGroup ¶ added in v1.1.6
func (c *Client) CreateRequesterGroup(ctx context.Context, rg *RequesterGroup) (*RequesterGroup, error)
func (*Client) CreateTicket ¶ added in v1.1.6
func (*Client) CreateTimeEntry ¶ added in v1.1.6
func (c *Client) CreateTimeEntry(ctx context.Context, tid int64, tm *TimeEntryCreate) (*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 (*Client) DeactivateAgent ¶ added in v1.1.6
Deactivate a Agent This operation allows you to deactivate a agent.
func (*Client) DeactivateRequester ¶ added in v1.1.6
Deactivate a Requester This operation allows you to deactivate a requester.
func (*Client) DeleteAgentGroup ¶ added in v1.1.6
func (*Client) DeleteArticle ¶ added in v1.1.6
func (*Client) DeleteCategory ¶ added in v1.1.6
func (*Client) DeleteConversation ¶ added in v1.1.6
func (*Client) DeleteConversationAttachment ¶ added in v1.1.6
func (*Client) DeleteFolder ¶ added in v1.1.6
func (*Client) DeleteRequesterFromRequesterGroup ¶ added in v1.1.6
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 (*Client) DeleteRequesterGroup ¶ added in v1.1.6
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 (*Client) DeleteTicket ¶ added in v1.1.6
func (*Client) DeleteTicketAttachment ¶ added in v1.1.6
func (*Client) DeleteTimeEntry ¶ added in v1.1.6
func (*Client) DoCopyFile ¶ added in v1.1.6
func (*Client) DoCopyFileNoAuth ¶ added in v1.1.6
func (*Client) DoReadFile ¶ added in v1.1.6
func (*Client) DoReadFileNoAuth ¶ added in v1.1.6
func (*Client) DoSaveFile ¶ added in v1.1.6
func (*Client) DoSaveFileNoAuth ¶ added in v1.1.6
func (*Client) FilterAgents ¶ added in v1.1.6
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 (*Client) FilterTickets ¶ added in v1.1.6
func (c *Client) FilterTickets(ctx context.Context, 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 (*Client) ForgetAgent ¶ added in v1.1.6
Forget a Agent This operation allows you to permanently delete a agent and the tickets that they requested.
func (*Client) ForgetRequester ¶ added in v1.1.6
Forget a Requester This operation allows you to permanently delete a requester and the tickets that they requested.
func (*Client) GetAgentFields ¶ added in v1.1.6
func (c *Client) GetAgentFields(ctx context.Context) ([]*AgentField, error)
func (*Client) GetAgentGroup ¶ added in v1.1.6
func (*Client) GetAgentRole ¶ added in v1.1.6
func (*Client) GetAgentTicketURL ¶ added in v1.1.6
GetAgentTicketURL return a permlink for agent ticket URL
func (*Client) GetArticle ¶ added in v1.1.6
func (*Client) GetCategory ¶ added in v1.1.6
func (*Client) GetHelpdeskAttachmentURL ¶ added in v1.1.6
GetHelpdeskAttachmentURL return a permlink for helpdesk attachment/avator URL
func (*Client) GetRequester ¶ added in v1.1.6
func (*Client) GetRequesterFields ¶ added in v1.1.6
func (*Client) GetRequesterGroup ¶ added in v1.1.6
func (*Client) GetSolutionArticleURL ¶ added in v1.1.6
GetSolutionArticleURL return a permlink for solution article URL
func (*Client) GetTicket ¶ added in v1.1.6
GetTicket Get a Ticket include: conversations, requester, requested_for, stats, problem, assets, change, related_tickets
func (*Client) GetTicketActivities ¶ added in v1.1.6
func (*Client) GetTimeEntry ¶ added in v1.1.6
View a Time Entry This API call helps to list a particular Time Entry. GET /api/v2/tickets/[ticket_id]/time_entries/[id]
func (*Client) GetWorkspace ¶ added in v1.1.6
func (*Client) IterAgentGroups ¶ added in v1.1.6
func (c *Client) IterAgentGroups(ctx context.Context, lago *ListAgentGroupsOption, iagf func(*AgentGroup) error) error
func (*Client) IterAgentRoles ¶ added in v1.1.6
func (*Client) IterAgents ¶ added in v1.1.6
func (*Client) IterApprovals ¶ added in v1.1.6
func (*Client) IterCategories ¶ added in v1.1.6
func (*Client) IterCategoryFolders ¶ added in v1.1.6
func (*Client) IterFilterAgents ¶ added in v1.1.6
func (*Client) IterFilterTickets ¶ added in v1.1.6
func (*Client) IterFolderArticles ¶ added in v1.1.6
func (c *Client) IterFolderArticles(ctx context.Context, fid int64, lao *ListArticlesOption, iaf func(*ArticleInfo) error) error
func (*Client) IterRequesterGroupMembers ¶ added in v1.1.6
func (*Client) IterRequesterGroups ¶ added in v1.1.6
func (c *Client) IterRequesterGroups(ctx context.Context, lrgo *ListRequesterGroupsOption, irgf func(*RequesterGroup) error) error
func (*Client) IterRequesters ¶ added in v1.1.6
func (*Client) IterTicketConversations ¶ added in v1.1.6
func (c *Client) IterTicketConversations(ctx context.Context, tid int64, lco *ListConversationsOption, icf func(*Conversation) error) error
func (*Client) IterTicketTimeEntries ¶ added in v1.1.6
func (*Client) IterTickets ¶ added in v1.1.6
func (*Client) IterWorkspaces ¶ added in v1.1.6
func (*Client) ListAgentGroups ¶ added in v1.1.6
func (c *Client) ListAgentGroups(ctx context.Context, lago *ListAgentGroupsOption) ([]*AgentGroup, bool, error)
func (*Client) ListAgentRoles ¶ added in v1.1.6
func (*Client) ListAgents ¶ added in v1.1.6
func (*Client) ListApprovals ¶ added in v1.1.6
func (*Client) ListCategories ¶ added in v1.1.6
func (*Client) ListCategoryFolders ¶ added in v1.1.6
func (*Client) ListFolderArticles ¶ added in v1.1.6
func (c *Client) ListFolderArticles(ctx context.Context, fid int64, lao *ListArticlesOption) ([]*ArticleInfo, bool, error)
func (*Client) ListRequesterGroupMembers ¶ added in v1.1.6
func (*Client) ListRequesterGroups ¶ added in v1.1.6
func (c *Client) ListRequesterGroups(ctx context.Context, lrgo *ListRequesterGroupsOption) ([]*RequesterGroup, bool, error)
func (*Client) ListRequesters ¶ added in v1.1.6
func (c *Client) ListRequesters(ctx context.Context, 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 (*Client) ListTicketConversations ¶ added in v1.1.6
func (c *Client) ListTicketConversations(ctx context.Context, tid int64, lco *ListConversationsOption) ([]*Conversation, bool, error)
func (*Client) ListTicketFields ¶ added in v1.1.6
func (c *Client) ListTicketFields(ctx context.Context) ([]*TicketField, error)
func (*Client) ListTicketTimeEntries ¶ added in v1.1.6
func (c *Client) ListTicketTimeEntries(ctx context.Context, 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 (*Client) ListTickets ¶ added in v1.1.6
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 (*Client) ListWorkspaces ¶ added in v1.1.6
func (*Client) MergeRequesters ¶ added in v1.1.6
Merge secondary requesters into a primary requester.
func (*Client) ReactivateAgent ¶ added in v1.1.6
Reactivate a Agent This operation allows you to reactivate a particular deactivated agent.
func (*Client) ReactivateRequester ¶ added in v1.1.6
Reactivate a Requester This operation allows you to reactivate a particular deactivated requester.
func (*Client) ReadAttachment ¶ added in v1.1.6
func (*Client) Restore ¶ added in v1.1.6
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 (*Client) SaveAttachment ¶ added in v1.1.6
func (*Client) SearchArticles ¶ added in v1.1.6
func (c *Client) SearchArticles(ctx context.Context, sao *SearchArticlesOption) ([]*ArticleInfo, bool, error)
func (*Client) SendArticleToApproval ¶ added in v1.1.6
func (*Client) UpdateAgent ¶ added in v1.1.6
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 (*Client) UpdateAgentGroup ¶ added in v1.1.6
func (c *Client) UpdateAgentGroup(ctx context.Context, id int64, ag *AgentGroupUpdate) (*AgentGroup, error)
func (*Client) UpdateArticle ¶ added in v1.1.6
func (*Client) UpdateCategory ¶ added in v1.1.6
func (*Client) UpdateConversation ¶ added in v1.1.6
func (c *Client) UpdateConversation(ctx context.Context, cid int64, note *Note) (*Conversation, error)
Update a Conversation Only public & private notes can be edited.
func (*Client) UpdateFolder ¶ added in v1.1.6
func (*Client) UpdateRequester ¶ added in v1.1.6
func (c *Client) UpdateRequester(ctx context.Context, id int64, requester *RequesterUpdate) (*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 (*Client) UpdateRequesterGroup ¶ added in v1.1.6
func (c *Client) UpdateRequesterGroup(ctx context.Context, id int64, rg *RequesterGroup) (*RequesterGroup, error)
Note: Only groups of type “manual” can be updated through this API.
func (*Client) UpdateTicket ¶ added in v1.1.6
func (c *Client) UpdateTicket(ctx context.Context, tid int64, ticket *TicketUpdate) (*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 (*Client) UpdateTimeEntry ¶ added in v1.1.6
func (c *Client) UpdateTimeEntry(ctx context.Context, tid, teid int64, tm *TimeEntryUpdate) (*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 Conversation ¶
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"`
// The email address from which the reply is sent.
FromEmail string `json:"from_email,omitempty"`
// Email addresses of agents/users who need to be notified about this conversation
ToEmails []string `json:"to_emails,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"`
// response
NotifiedTos []string `json:"notified_to,omitempty"`
// Conversation creation timestamp
CreatedAt Time `json:"created_at,omitempty"`
// Conversation updated timestamp
UpdatedAt Time `json:"updated_at,omitempty"`
}
func (*Conversation) String ¶
func (c *Conversation) String() string
type ConversationSource ¶
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 ¶
func ParseConversationSource(s string) ConversationSource
func (ConversationSource) String ¶
func (cs ConversationSource) String() string
type FieldError ¶
type FieldError = fresh.FieldError
type FilterAgentsOption ¶
type FilterAgentsOption = FilterOption
type FilterOption ¶
func (*FilterOption) IsNil ¶
func (fo *FilterOption) IsNil() bool
func (*FilterOption) Values ¶
func (fo *FilterOption) Values() Values
type FilterTicketsOption ¶
type FilterTicketsOption = FilterOption
type Folder ¶
type Folder struct {
ID int64 `json:"id,omitempty"`
// WorkspaceID ID of the workspace to which the solution folder belongs.
// This attribute is applicable only to accounts on the Employee Support Mode.
WorkspaceID int64 `json:"workspace_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 FolderCreate ¶
type FolderCreate struct {
// WorkspaceID ID of the workspace to which the solution folder belongs.
// This attribute is applicable only to accounts on the Employee Support Mode.
WorkspaceID int64 `json:"workspace_id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,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"`
}
func (*FolderCreate) String ¶
func (f *FolderCreate) String() string
type FolderUpdate ¶
type FolderUpdate = FolderCreate
type FolderVisibility ¶
type FolderVisibility int
const ( FolderVisibilityAllUsers FolderVisibility = 1 FolderVisibilityLoggedInUsers FolderVisibility = 2 FolderVisibilityAgents FolderVisibility = 3 FolderVisibilityDepartments FolderVisibility = 4 FolderVisibilityAgentGroups FolderVisibility = 5 FolderVisibilityContactGroups FolderVisibility = 6 )
func ParseFolderVisibility ¶
func ParseFolderVisibility(s string) FolderVisibility
func (FolderVisibility) String ¶
func (fv FolderVisibility) String() string
type ListAgentGroupsOption ¶
type ListAgentGroupsOption = PageOption
type ListAgentRolesOption ¶
type ListAgentRolesOption = PageOption
type ListAgentsOption ¶
type ListAgentsOption struct {
Email string
MobilePhoneNumber string
WorkPhoneNumber string
Active AgentActive
State AgentState // fulltime or occasional
Page int
PerPage int
}
func (*ListAgentsOption) IsNil ¶
func (lao *ListAgentsOption) IsNil() bool
func (*ListAgentsOption) Values ¶
func (lao *ListAgentsOption) Values() Values
type ListApprovalsOption ¶
type ListApprovalsOption struct {
Parent string
ParentID int64
Status string
ApproverID int64
Level int
DelegateeID int64
Page int
PerPage int
}
func (*ListApprovalsOption) IsNil ¶
func (lao *ListApprovalsOption) IsNil() bool
func (*ListApprovalsOption) Values ¶
func (lao *ListApprovalsOption) Values() Values
type ListArticlesOption ¶
PerPage: 1 ~ 100, default: 30
func (*ListArticlesOption) IsNil ¶
func (lao *ListArticlesOption) IsNil() bool
func (*ListArticlesOption) Values ¶
func (lao *ListArticlesOption) Values() Values
type ListConversationsOption ¶
type ListConversationsOption = PageOption
PerPage: 1 ~ 100, default: 30
type ListFoldersOption ¶
PerPage: 1 ~ 100, default: 30
func (*ListFoldersOption) IsNil ¶
func (lfo *ListFoldersOption) IsNil() bool
func (*ListFoldersOption) Values ¶
func (lfo *ListFoldersOption) Values() Values
type ListOption ¶
type ListOption = fresh.ListOption
type ListRequesterGroupMembersOption ¶
type ListRequesterGroupMembersOption = PageOption
type ListRequesterGroupsOption ¶
type ListRequesterGroupsOption = PageOption
type ListRequestersOption ¶
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 ¶
func (lro *ListRequestersOption) IsNil() bool
func (*ListRequestersOption) Values ¶
func (lro *ListRequestersOption) Values() Values
type ListTicketsOption ¶
type ListTicketsOption struct {
Filter string // The various filters available are new_and_my_open, watching, spam, deleted.
WorkspaceID int64
RequestID int64
Email string
Type string // Incident, Service Request
UpdatedSince Time
Include string // stats, requester, requester_for
OrderType OrderType // asc, desc (default)
Page int
PerPage int
}
func (*ListTicketsOption) IsNil ¶
func (lto *ListTicketsOption) IsNil() bool
func (*ListTicketsOption) Values ¶
func (lto *ListTicketsOption) Values() Values
type ListWorkspacesOption ¶
type ListWorkspacesOption = PageOption
type Note ¶
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"`
// Note creation timestamp
CreatedAt *Time `json:"created_at,omitempty"`
// Note updated timestamp
UpdatedAt *Time `json:"updated_at,omitempty"`
}
func (*Note) AddAttachment ¶
type PageOption ¶
type PageOption = fresh.PageOption
type Reply ¶
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"`
// Reply creation timestamp
CreatedAt *Time `json:"created_at,omitempty"`
// Reply updated timestamp
UpdatedAt *Time `json:"updated_at,omitempty"`
}
func (*Reply) AddAttachment ¶
type Requester ¶
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 RequesterCreate ¶
type RequesterCreate struct {
// 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"`
}
func (*RequesterCreate) String ¶
func (r *RequesterCreate) String() string
type RequesterField ¶
type RequesterField struct {
ID int64 `json:"id,omitempty"`
// Label of the requester field.
Label string `json:"label,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"`
// ID of the user field group.
UserFieldGroupID int64 `json:"user_field_group_id,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"`
// Display name for the field (as seen in the support portal).
LabelForRequesters string `json:"label_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 ¶
func (rf *RequesterField) String() string
type RequesterGroup ¶
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 ¶
func (rg *RequesterGroup) String() string
type RequesterGroupType ¶
type RequesterGroupType string
const ( RequesterGroupTypeManual RequesterGroupType = "manual" RequesterGroupTypeRuleBased RequesterGroupType = "rule_based" )
type RequesterUpdate ¶
type RequesterUpdate = RequesterCreate
type ResultError ¶
type ResultError = fresh.ResultError
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 ¶
func (sao *SearchArticlesOption) IsNil() bool
func (*SearchArticlesOption) Values ¶
func (sao *SearchArticlesOption) Values() Values
type Ticket ¶
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 urgency.
Urgency TicketUrgency `json:"urgency,omitempty"`
// Ticket impact.
Impact TicketImpact `json:"impact,omitempty"`
// Content of the ticket resolution note in plain text
ResolutionNotes string `json:"resolution_notes,omitempty"`
// HTML content of the ticket resolution note
ResolutionNotesHTML string `json:"resolution_notes_html,omitempty"`
// Ticket creation timestamp
CreatedAt Time `json:"created_at,omitempty"`
// Ticket updated timestamp
UpdatedAt Time `json:"updated_at,omitempty"`
}
type TicketActivity ¶
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 ¶
func (ta *TicketActivity) String() string
type TicketCreate ¶
type TicketCreate struct {
// 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"`
// 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"`
// 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"`
// 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"`
// 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 urgency.
Urgency TicketUrgency `json:"urgency,omitempty"`
// Ticket impact.
Impact TicketImpact `json:"impact,omitempty"`
// Content of the ticket resolution note in plain text
ResolutionNotes string `json:"resolution_notes,omitempty"`
// HTML content of the ticket resolution note
ResolutionNotesHTML string `json:"resolution_notes_html,omitempty"`
// Ticket creation timestamp
CreatedAt *Time `json:"created_at,omitempty"`
// Ticket updated timestamp
UpdatedAt *Time `json:"updated_at,omitempty"`
}
func (*TicketCreate) AddAttachment ¶
func (t *TicketCreate) AddAttachment(path string, data ...[]byte)
func (*TicketCreate) Files ¶
func (t *TicketCreate) Files() Files
func (*TicketCreate) String ¶
func (t *TicketCreate) String() string
func (*TicketCreate) Values ¶
func (t *TicketCreate) Values() Values
type TicketField ¶
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 string `json:"label_for_customers,omitempty"`
// Set to true if the field can be updated by customers
CustomersCanEdit bool `json:"customers_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 string `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 ¶
func (tf *TicketField) String() string
type TicketImpact ¶
type TicketImpact int
func ParseTicketImpact ¶
func ParseTicketImpact(s string) TicketImpact
func (TicketImpact) String ¶
func (ti TicketImpact) String() string
type TicketPriority ¶
type TicketPriority int
func ParseTicketPriority ¶
func ParseTicketPriority(s string) TicketPriority
func (TicketPriority) String ¶
func (tp TicketPriority) String() string
type TicketSource ¶
type TicketSource int
func ParseTicketSource ¶
func ParseTicketSource(s string) TicketSource
func (TicketSource) String ¶
func (ts TicketSource) String() string
type TicketStatus ¶
type TicketStatus int
func ParseTicketStatus ¶
func ParseTicketStatus(s string) TicketStatus
func (TicketStatus) String ¶
func (ts TicketStatus) String() string
type TicketUpdate ¶
type TicketUpdate = TicketCreate
type TicketUrgency ¶
type TicketUrgency int
func ParseTicketUrgency ¶
func ParseTicketUrgency(s string) TicketUrgency
func (TicketUrgency) String ¶
func (tu TicketUrgency) String() string
type TimeEntry ¶
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 TimeEntryCreate ¶
type TimeEntryCreate struct {
// 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"`
}
func (*TimeEntryCreate) String ¶
func (te *TimeEntryCreate) String() string
type TimeEntryUpdate ¶
type TimeEntryUpdate = TimeEntryCreate
type TimeSpent ¶
func ParseTimeSpent ¶
type Workspace ¶
type Workspace struct {
ID int64 `json:"id,omitempty"`
// Name of the workspace
Name string `json:"name,omitempty"`
// Description of the workspace
Description string `json:"description,omitempty"`
// Signifies if the workspace is assigned as the primary workspace of the account
Primary bool `json:"primary,omitempty"`
// Signifies if the workspace is marked as restricted
Restricted bool `json:"restricted,omitempty"`
// Status of the workspace. Possible values:
// active: The workspace is in active state
// draft: The workspace is in draft state
State string `json:"state,omitempty"`
// The template from which the workspace was created
TemplateName string `json:"template_name,omitempty"`
CreatedAt Time `json:"created_at,omitempty"`
UpdatedAt Time `json:"updated_at,omitempty"`
}
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
- workspace.go
- workspaces.go