Java Wrapper for the Help Scout API. More information on our developer site: http://developer.helpscout.net.
Please see the Changelog for details.
- JDE 1.6
- google-gson
import net.helpscout.api;
import java.util.ArrayList;
import java.util.List;
public class TestingAPI {
public static void main(String[] args) throws ApiException {
ApiClient client = ApiClient.getInstance();
client.setKey("your-api-key-here");
List fields = new ArrayList();
fields.add("name");
fields.add("email");
Page mailboxes = client.getMailboxes(fields);
if (mailboxes) {
// do something
}
Mailbox mailbox = client.getMailbox(85);
if (mailbox) {
String mailboxName = mailbox.getName();
List folders = mailbox.getFolders();
}
Customer c = client.getCustomer(customer-id-here);
if (c.hasSocialProfiles()) {
List profiles = c.getSocialProfiles();
// do something
}
}
}
Field selectors are given as a list of Strings. When field selectors are used, the appropriate object is created with the fields provided.
Each method also has a duplicate that allows you to pass in a list of Strings to specify desired fields (see Field Selectors).
- getMailboxes()
- getMailbox(Integer mailboxID)
- getFolders(Integer mailboxID)
- getConversationsForFolder(Integer mailboxID, Integer folderID)
- getConversationsForMailbox(Integer mailboxID)
- getConversationsForCustomerByMailbox(Integer mailboxID, Integer customerID)
- getConversation(Integer conversationID)
- createConversation(Conversation conversation)
- createConversationThread(Long conversationId, ConversationThread thread)
- updateConversation(Conversation conversation)
- deleteConversation(Long id)
- getAttachmentData(Integer attachmentID)
- createAttachment(Attachment attachment)
- deleteAttachment(Long id)
- getCustomers()
- getCustomer(Integer customerID)
- createCustomer(Customer customer)
- updateCustomer(Customer customer)
- getUsers()
- getUsersForMailbox(Integer mailboxID)
- getUser(Integer userID)
Webhook webhook = new Webhook('secret-key-here', httpRequest);
if (webhook.isValid()) {
String event = webhook.getEventType();
if (webhook.isConversationEvent()) {
Conversation convo = webhook.getConversation();
// do something
} else if (webhook.isCustomerEvent()) {
Customer customer = webhook.getCustomer();
// do something
}
}