Skip to content

mdsakalu/helpscout-api-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Help Scout Java Wrapper

Java Wrapper for the Help Scout API. More information on our developer site: http://developer.helpscout.net.

Version 1.3.13 Released

Please see the Changelog for details.

Requirements

Example Usage: API


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

Field selectors are given as a list of Strings. When field selectors are used, the appropriate object is created with the fields provided.

ApiClient Methods

Each method also has a duplicate that allows you to pass in a list of Strings to specify desired fields (see Field Selectors).

Mailboxes

  • getMailboxes()
  • getMailbox(Integer mailboxID)

Folders

  • getFolders(Integer mailboxID)

Conversations

  • 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)

Attachments

  • getAttachmentData(Integer attachmentID)
  • createAttachment(Attachment attachment)
  • deleteAttachment(Long id)

Customers

  • getCustomers()
  • getCustomer(Integer customerID)
  • createCustomer(Customer customer)
  • updateCustomer(Customer customer)

Users

  • getUsers()
  • getUsersForMailbox(Integer mailboxID)
  • getUser(Integer userID)

Example Usage: Webhooks


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
   }
}

About

Java wrapper for the Help Scout API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%