helpscout.apis package¶
Submodules¶
helpscout.apis.conversations module¶
-
class
helpscout.apis.conversations.Conversations[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
ConversationsEndpoint.The following aspects are implemented:
- List Conversations
(
helpscout.apis.conversations.Conversations.list()) - Search Conversations
(
helpscout.apis.conversations.Conversations.search()) - Get Conversation
(
helpscout.apis.conversations.Conversations.get()) - Create Conversation
(
helpscout.apis.conversations.Conversations.create()) - Update Conversation
(
helpscout.apis.conversations.Conversations.update()) - Delete Conversation
(
helpscout.apis.conversations.Conversations.delete()) - Create Thread
(
helpscout.apis.conversations.Conversations.create_thread()) - Update Thread
(
helpscout.apis.conversations.Conversations.update_thread()) - Get Attachment Data
(
helpscout.apis.conversations.Conversations.get_attachment_data()) - Create Attachment
(
helpscout.apis.conversations.Conversations.create_attachment()) - Delete Attachment
(
helpscout.apis.conversations.Conversations.delete_attachment())
-
classmethod
create(session, record, imported=False, auto_reply=False)[source]¶ Create a conversation.
Please note that conversation cannot be created with more than 100 threads, if attempted the API will respond with HTTP 412.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- record (helpscout.models.Conversation) – The conversation to be created.
- imported (bool, optional) – The
importedrequest parameter enables conversations to be created for historical purposes (i.e. if moving from a different platform, you can import your history). Whenimportedis set toTrue, no outgoing emails or notifications will be generated. - auto_reply (bool) – The
auto_replyrequest parameter enables auto replies to be sent when a conversation is created via the API. Whenauto_replyis set toTrue, an auto reply will be sent as long as there is at least onecustomerthread in the conversation.
Returns: Newly created conversation.
Return type:
-
classmethod
create_attachment(session, attachment)[source]¶ Create an attachment.
An attachment must be sent to the API before it can be used in a thread. Use this method to create the attachment, then use the resulting hash when creating a thread.
Note that HelpScout only supports attachments of 10MB or lower.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- attachment (helpscout.models.Attachment) – The attachment to be created.
Returns: - The newly created attachment (hash
property only). Use this hash when associating the attachment with a new thread.
Return type:
-
classmethod
create_thread(session, conversation, thread, imported=False)[source]¶ Create a conversation thread.
Please note that threads cannot be added to conversations with 100 threads (or more), if attempted the API will respond with HTTP 412.
Parameters: - conversation (helpscout.models.Conversation) – The conversation that the thread is being added to.
- session (requests.sessions.Session) – Authenticated session.
- thread (helpscout.models.Thread) – The thread to be created.
- imported (bool, optional) – The
importedrequest parameter enables conversations to be created for historical purposes (i.e. if moving from a different platform, you can import your history). Whenimportedis set toTrue, no outgoing emails or notifications will be generated.
Returns: - Conversation including newly created
thread.
Return type:
-
classmethod
delete_attachment(session, attachment)[source]¶ Delete an attachment.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- attachment (helpscout.models.Attachment) – The attachment to be deleted.
Returns: Nothing.
Return type: NoneType
-
classmethod
find_customer(session, mailbox, customer)[source]¶ Return conversations for a specific customer in a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox to search.
- customer (helpscout.models.Customer) – Customer to search for.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
find_user(session, mailbox, user)[source]¶ Return conversations for a specific user in a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox to search.
- user (helpscout.models.User) – User to search for.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
get_attachment_data(session, attachment_id)[source]¶ Return a specific attachment’s data.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- attachment_id (int) – The ID of the attachment from which to get data.
Returns: - An attachment data singleton, if
existing. Otherwise
None.
Return type:
-
classmethod
list(session, mailbox)[source]¶ Return conversations in a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox to list.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
list_folder(session, mailbox, folder)[source]¶ Return conversations in a specific folder of a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox that folder is in.
- folder (helpscout.models.Folder) – Folder to list.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
search(session, queries)[source]¶ Search for a conversation given a domain.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- queries (helpscout.models.Domain or iter) – The queries for the
domain. If a
Domainobject is provided, it will simply be returned. Otherwise, aDomainobject will be generated from the complex queries. In this case, the queries should conform to the interface inhelpscout.domain.Domain.from_tuple().
Returns: SearchCustomer iterator.
Return type: RequestPaginator(output_type=helpscout.models.SearchCustomer)
-
classmethod
update_thread(session, conversation, thread)[source]¶ Update a thread.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- conversation (helpscout.models.Conversation) – The conversation that the thread belongs to.
- thread (helpscout.models.Thread) – The thread to be updated.
Returns: - Conversation including freshly
updated thread.
Return type:
- List Conversations
(
helpscout.apis.customers module¶
-
class
helpscout.apis.customers.Customers[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
CustomersEndpoint.The following aspects are implemented:
- List Customers
(
helpscout.apis.customers.Customers.list()) - Search Customers
(
helpscout.apis.customers.Customers.search()) - Get Customer
(
helpscout.apis.customers.Customers.get()) - Create Customer
(
helpscout.apis.customers.Customers.create()) - Update Customer
(
helpscout.apis.customers.Customers.update())
-
classmethod
list(session, first_name=None, last_name=None, email=None, modified_since=None)[source]¶ List the customers.
Customers can be filtered on any combination of first name, last name, email, and modifiedSince.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- first_name (str, optional) – First name of customer.
- last_name (str, optional) – Last name of customer.
- email (str, optional) – Email address of customer.
- modified_since (datetime.datetime, optional) – If modified after this date.
Returns: - Customers
iterator.
Return type: RequestPaginator(output_type=helpscout.models.Customer)
-
classmethod
search(session, queries)[source]¶ Search for a customer given a domain.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- queries (helpscout.models.Domain or iter) – The queries for the
domain. If a
Domainobject is provided, it will simply be returned. Otherwise, aDomainobject will be generated from the complex queries. In this case, the queries should conform to the interface inhelpscout.domain.Domain.from_tuple().
Returns: SearchCustomer iterator.
Return type: RequestPaginator(output_type=helpscout.models.SearchCustomer)
- List Customers
(
helpscout.apis.mailboxes module¶
-
class
helpscout.apis.mailboxes.Mailboxes[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
MailboxesEndpoint.The following aspects are implemented:
- List Mailboxes
(
helpscout.apis.mailboxes.Mailboxes.list()) - Get Mailboxes
(
helpscout.apis.mailboxes.Mailboxes.get()) - Get Folders
(
helpscout.apis.mailboxes.Mailboxes.get_folders())
-
classmethod
get_folders(session, mailbox_or_id)[source]¶ List the folders for the mailbox.
Parameters: mailbox_or_id (helpscout.models.Mailbox or int) – Mailbox or the ID of the mailbox to get the folders for. Returns: - Folders
- iterator.
Return type: RequestPaginator(output_type=helpscout.models.Folder)
-
classmethod
list(session)[source]¶ List the mailboxes.
Parameters: session (requests.sessions.Session) – Authenticated session. Returns: - Mailboxes
- iterator.
Return type: RequestPaginator(output_type=helpscout.models.Mailbox)
- List Mailboxes
(
helpscout.apis.tags module¶
Bases:
helpscout.base_api.BaseApiThis represents the
TagsEndpoint.The following aspects are implemented:
- List Tags
(
helpscout.apis.tags.Tags.list())
- List Tags
(
helpscout.apis.teams module¶
-
class
helpscout.apis.teams.Teams[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
TeamsEndpoint.The following aspects are implemented:
- List Teams
(
helpscout.apis.teams.Teams.list()) - Get Teams
(
helpscout.apis.teams.Teams.get()) - Get Team Members
(
helpscout.apis.teams.Teams.get_members())
-
classmethod
get(session, team_id)[source]¶ Return a specific team.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- team_id (int) – The ID of the team to get.
Returns: - A person singleton representing the team,
if existing. Otherwise
None.
Return type:
-
classmethod
get_members(session, team_or_id)[source]¶ List the members for the team.
Parameters: team_or_id (helpscout.models.Person or int) – Team or the ID of the team to get the folders for. Returns: - Users
- iterator.
Return type: RequestPaginator(output_type=helpscout.models.Users)
-
classmethod
list(session)[source]¶ List the teams.
Parameters: session (requests.sessions.Session) – Authenticated session. Returns: - Person
- iterator representing the teams.
Return type: RequestPaginator(output_type=helpscout.models.Person)
- List Teams
(
helpscout.apis.users module¶
-
class
helpscout.apis.users.Users[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
UsersEndpoint.The following aspects are implemented:
- List Users
(
helpscout.apis.users.Users.list()) - Get Users
(
helpscout.apis.users.Users.get()) - Get Current User
(
helpscout.apis.users.Users.get_me()) - List Users By Mailbox
(
helpscout.apis.users.Users.find_in_mailbox())
-
classmethod
find_in_mailbox(session, mailbox_or_id)[source]¶ Get the users that are associated to a Mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox_or_id (MailboxRef or int) – Mailbox of the ID of the mailbox to get the folders for.
Returns: - Users
iterator.
Return type: RequestPaginator(output_type=helpscout.models.User)
-
classmethod
get_me(session)[source]¶ Return the current user.
Parameters: session (requests.sessions.Session) – Authenticated session. Returns: A user singleton Return type: helpscout.models.User
- List Users
(
helpscout.apis.web_hook module¶
-
class
helpscout.apis.web_hook.WebHook[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
WebHookEndpoint.The following aspects are implemented:
-
classmethod
create(session, web_hook)[source]¶ Create a web hook.
Note that creating a new web hook will overwrite the web hook that is already configured for this company. There is also no way to programmatically determine if a web hook already exists for the company. This is a limitation of the HelpScout API and cannot be circumvented.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- web_hook (helpscout.models.WebHook) – The web hook to be created.
Returns: Trueif the creation was a success. Errors otherwise.Return type:
-
classmethod
Module contents¶
-
class
helpscout.apis.Conversations[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
ConversationsEndpoint.The following aspects are implemented:
- List Conversations
(
helpscout.apis.conversations.Conversations.list()) - Search Conversations
(
helpscout.apis.conversations.Conversations.search()) - Get Conversation
(
helpscout.apis.conversations.Conversations.get()) - Create Conversation
(
helpscout.apis.conversations.Conversations.create()) - Update Conversation
(
helpscout.apis.conversations.Conversations.update()) - Delete Conversation
(
helpscout.apis.conversations.Conversations.delete()) - Create Thread
(
helpscout.apis.conversations.Conversations.create_thread()) - Update Thread
(
helpscout.apis.conversations.Conversations.update_thread()) - Get Attachment Data
(
helpscout.apis.conversations.Conversations.get_attachment_data()) - Create Attachment
(
helpscout.apis.conversations.Conversations.create_attachment()) - Delete Attachment
(
helpscout.apis.conversations.Conversations.delete_attachment())
-
classmethod
create(session, record, imported=False, auto_reply=False)[source]¶ Create a conversation.
Please note that conversation cannot be created with more than 100 threads, if attempted the API will respond with HTTP 412.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- record (helpscout.models.Conversation) – The conversation to be created.
- imported (bool, optional) – The
importedrequest parameter enables conversations to be created for historical purposes (i.e. if moving from a different platform, you can import your history). Whenimportedis set toTrue, no outgoing emails or notifications will be generated. - auto_reply (bool) – The
auto_replyrequest parameter enables auto replies to be sent when a conversation is created via the API. Whenauto_replyis set toTrue, an auto reply will be sent as long as there is at least onecustomerthread in the conversation.
Returns: Newly created conversation.
Return type:
-
classmethod
create_attachment(session, attachment)[source]¶ Create an attachment.
An attachment must be sent to the API before it can be used in a thread. Use this method to create the attachment, then use the resulting hash when creating a thread.
Note that HelpScout only supports attachments of 10MB or lower.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- attachment (helpscout.models.Attachment) – The attachment to be created.
Returns: - The newly created attachment (hash
property only). Use this hash when associating the attachment with a new thread.
Return type:
-
classmethod
create_thread(session, conversation, thread, imported=False)[source]¶ Create a conversation thread.
Please note that threads cannot be added to conversations with 100 threads (or more), if attempted the API will respond with HTTP 412.
Parameters: - conversation (helpscout.models.Conversation) – The conversation that the thread is being added to.
- session (requests.sessions.Session) – Authenticated session.
- thread (helpscout.models.Thread) – The thread to be created.
- imported (bool, optional) – The
importedrequest parameter enables conversations to be created for historical purposes (i.e. if moving from a different platform, you can import your history). Whenimportedis set toTrue, no outgoing emails or notifications will be generated.
Returns: - Conversation including newly created
thread.
Return type:
-
classmethod
delete_attachment(session, attachment)[source]¶ Delete an attachment.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- attachment (helpscout.models.Attachment) – The attachment to be deleted.
Returns: Nothing.
Return type: NoneType
-
classmethod
find_customer(session, mailbox, customer)[source]¶ Return conversations for a specific customer in a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox to search.
- customer (helpscout.models.Customer) – Customer to search for.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
find_user(session, mailbox, user)[source]¶ Return conversations for a specific user in a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox to search.
- user (helpscout.models.User) – User to search for.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
get_attachment_data(session, attachment_id)[source]¶ Return a specific attachment’s data.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- attachment_id (int) – The ID of the attachment from which to get data.
Returns: - An attachment data singleton, if
existing. Otherwise
None.
Return type:
-
classmethod
list(session, mailbox)[source]¶ Return conversations in a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox to list.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
list_folder(session, mailbox, folder)[source]¶ Return conversations in a specific folder of a mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox (helpscout.models.Mailbox) – Mailbox that folder is in.
- folder (helpscout.models.Folder) – Folder to list.
Returns: Conversations iterator.
Return type: RequestPaginator(output_type=helpscout.models.Conversation)
-
classmethod
search(session, queries)[source]¶ Search for a conversation given a domain.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- queries (helpscout.models.Domain or iter) – The queries for the
domain. If a
Domainobject is provided, it will simply be returned. Otherwise, aDomainobject will be generated from the complex queries. In this case, the queries should conform to the interface inhelpscout.domain.Domain.from_tuple().
Returns: SearchCustomer iterator.
Return type: RequestPaginator(output_type=helpscout.models.SearchCustomer)
-
classmethod
update_thread(session, conversation, thread)[source]¶ Update a thread.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- conversation (helpscout.models.Conversation) – The conversation that the thread belongs to.
- thread (helpscout.models.Thread) – The thread to be updated.
Returns: - Conversation including freshly
updated thread.
Return type:
- List Conversations
(
-
class
helpscout.apis.Customers[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
CustomersEndpoint.The following aspects are implemented:
- List Customers
(
helpscout.apis.customers.Customers.list()) - Search Customers
(
helpscout.apis.customers.Customers.search()) - Get Customer
(
helpscout.apis.customers.Customers.get()) - Create Customer
(
helpscout.apis.customers.Customers.create()) - Update Customer
(
helpscout.apis.customers.Customers.update())
-
classmethod
list(session, first_name=None, last_name=None, email=None, modified_since=None)[source]¶ List the customers.
Customers can be filtered on any combination of first name, last name, email, and modifiedSince.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- first_name (str, optional) – First name of customer.
- last_name (str, optional) – Last name of customer.
- email (str, optional) – Email address of customer.
- modified_since (datetime.datetime, optional) – If modified after this date.
Returns: - Customers
iterator.
Return type: RequestPaginator(output_type=helpscout.models.Customer)
-
classmethod
search(session, queries)[source]¶ Search for a customer given a domain.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- queries (helpscout.models.Domain or iter) – The queries for the
domain. If a
Domainobject is provided, it will simply be returned. Otherwise, aDomainobject will be generated from the complex queries. In this case, the queries should conform to the interface inhelpscout.domain.Domain.from_tuple().
Returns: SearchCustomer iterator.
Return type: RequestPaginator(output_type=helpscout.models.SearchCustomer)
- List Customers
(
-
class
helpscout.apis.Mailboxes[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
MailboxesEndpoint.The following aspects are implemented:
- List Mailboxes
(
helpscout.apis.mailboxes.Mailboxes.list()) - Get Mailboxes
(
helpscout.apis.mailboxes.Mailboxes.get()) - Get Folders
(
helpscout.apis.mailboxes.Mailboxes.get_folders())
-
classmethod
get_folders(session, mailbox_or_id)[source]¶ List the folders for the mailbox.
Parameters: mailbox_or_id (helpscout.models.Mailbox or int) – Mailbox or the ID of the mailbox to get the folders for. Returns: - Folders
- iterator.
Return type: RequestPaginator(output_type=helpscout.models.Folder)
-
classmethod
list(session)[source]¶ List the mailboxes.
Parameters: session (requests.sessions.Session) – Authenticated session. Returns: - Mailboxes
- iterator.
Return type: RequestPaginator(output_type=helpscout.models.Mailbox)
- List Mailboxes
(
-
class
helpscout.apis.Tags[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
TagsEndpoint.The following aspects are implemented:
- List Tags
(
helpscout.apis.tags.Tags.list())
- List Tags
(
-
class
helpscout.apis.Teams[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
TeamsEndpoint.The following aspects are implemented:
- List Teams
(
helpscout.apis.teams.Teams.list()) - Get Teams
(
helpscout.apis.teams.Teams.get()) - Get Team Members
(
helpscout.apis.teams.Teams.get_members())
-
classmethod
get(session, team_id)[source]¶ Return a specific team.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- team_id (int) – The ID of the team to get.
Returns: - A person singleton representing the team,
if existing. Otherwise
None.
Return type:
-
classmethod
get_members(session, team_or_id)[source]¶ List the members for the team.
Parameters: team_or_id (helpscout.models.Person or int) – Team or the ID of the team to get the folders for. Returns: - Users
- iterator.
Return type: RequestPaginator(output_type=helpscout.models.Users)
-
classmethod
list(session)[source]¶ List the teams.
Parameters: session (requests.sessions.Session) – Authenticated session. Returns: - Person
- iterator representing the teams.
Return type: RequestPaginator(output_type=helpscout.models.Person)
- List Teams
(
-
class
helpscout.apis.Users[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
UsersEndpoint.The following aspects are implemented:
- List Users
(
helpscout.apis.users.Users.list()) - Get Users
(
helpscout.apis.users.Users.get()) - Get Current User
(
helpscout.apis.users.Users.get_me()) - List Users By Mailbox
(
helpscout.apis.users.Users.find_in_mailbox())
-
classmethod
find_in_mailbox(session, mailbox_or_id)[source]¶ Get the users that are associated to a Mailbox.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- mailbox_or_id (MailboxRef or int) – Mailbox of the ID of the mailbox to get the folders for.
Returns: - Users
iterator.
Return type: RequestPaginator(output_type=helpscout.models.User)
-
classmethod
get_me(session)[source]¶ Return the current user.
Parameters: session (requests.sessions.Session) – Authenticated session. Returns: A user singleton Return type: helpscout.models.User
- List Users
(
-
class
helpscout.apis.WebHook[source]¶ Bases:
helpscout.base_api.BaseApiThis represents the
WebHookEndpoint.The following aspects are implemented:
-
classmethod
create(session, web_hook)[source]¶ Create a web hook.
Note that creating a new web hook will overwrite the web hook that is already configured for this company. There is also no way to programmatically determine if a web hook already exists for the company. This is a limitation of the HelpScout API and cannot be circumvented.
Parameters: - session (requests.sessions.Session) – Authenticated session.
- web_hook (helpscout.models.WebHook) – The web hook to be created.
Returns: Trueif the creation was a success. Errors otherwise.Return type:
-
classmethod