Java Wrapper for the Help Scout API. More information can be found on our developer site.
Please see the Changelog for details.
- Java 1.7 or higher
- Commons Codec
- Commons Lang
- Commons IO
- GSON
- SLF4J
- Joda Time
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<String> fields = new ArrayList<String>();
fields.add("name");
fields.add("email");
Page mailboxes = client.getMailboxes(fields);
if (mailboxes != null) {
// do something
}
Long mailboxId = 123456L;
Mailbox mailbox = client.getMailbox(mailboxId);
if (mailbox != null) {
String mailboxName = mailbox.getName();
Page folders = client.getFolders(mailbox.getId());
}
Long customerId = 123456L;
Customer c = client.getCustomer(customerId);
if (c.hasSocialProfiles()) {
List<SocialProfileEntry> 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(Long mailboxID)
- getFolders(Long mailboxID)
- getConversationsForFolder(Long mailboxID, Long folderID)
- getConversationsForMailbox(Long mailboxID)
- getConversationsForCustomerByMailbox(Long mailboxID, Long customerID)
- getConversation(Long conversationID)
- createConversation(Conversation conversation)
- createConversationThread(Long conversationId, ConversationThread thread)
- updateConversation(Conversation conversation)
- deleteConversation(Long id)
- getAttachmentData(Long attachmentID)
- createAttachment(Attachment attachment)
- deleteAttachment(Long id)
- getCustomers()
- getCustomer(Long customerID)
- createCustomer(Customer customer)
- updateCustomer(Customer customer)
- getUsers()
- getUsersForMailbox(Long mailboxID)
- getUser(Long userID)
- getTeams()
- getTeam()
- getTeamMembers()
String secretKey = "secret-key-here";
Webhook webhook = new Webhook(secretKey, 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
}
}
All contributions are welcomed and reviewed. Please submit all pull requests against the develop branch.