@Connector(name="hubspot", schemaVersion="2.7.1", friendlyName="HubSpot", minMuleVersion="3.7") public class HubSpotConnector extends Object
The connector is using the version "v1" of the HubSpot API.
The documentation of the API can be found in this link
The main flow of the connector is "authentication" ---> HubSpot Login Page ----> "authenticationResponse" ----> Any other process of the connector
Modifier and Type | Field and Description |
---|---|
static String |
API_VERSION |
static String |
HUB_SPOT_URL_API |
static String |
HUB_SPOT_URL_AUTH |
Constructor and Description |
---|
HubSpotConnector() |
Modifier and Type | Method and Description |
---|---|
HubSpotListAddContactToListResponse |
addExistingContactInAList(String userId,
String listId,
String contactId)
Add a contact record that has already been created in the system to a contact list.
|
String |
authenticate(String userId,
String callbackUrl,
String clientId,
String hubId,
String scope,
Map<String,Object> headers)
/** This process generates the URL required to authenticate against the service.
|
String |
authenticateResponse(String inputRequest)
This process is the one that handles the response of the authentication process.
|
Contact |
createContact(String userId,
ContactProperties contactProperties)
Create a new contact in HubSpot with a simple HTTP POST to the Contacts API.
|
HubSpotList |
createContactList(String userId,
HubSpotNewList list,
List<HubSpotListFilters> filters)
Create a new list in a given HubSpot portal to populate with contacts.
|
CustomContactProperty |
createCustomProperty(String userId,
CustomContactProperty contactProperty)
Create a new property in HubSpot.
|
CustomContactPropertyGroup |
createCustomPropertyGroup(String userId,
CustomContactPropertyGroup customContactPropertyGroup)
For a given portal, create a new contact proprerty group.
|
ContactDeleted |
deleteContact(String userId,
String contactId)
Archive an existing contact from a particular HubSpot portal.
|
void |
deleteCustomProperty(String userId,
String contactPropertyName)
Delete an existing property in HubSpot.
|
void |
deleteCustomPropertyGroup(String userId,
String groupName)
For a given portal, delete a contact property group based on the name of the group.
|
ContactList |
getAllContacts(String userId,
String count,
String contactOffset)
For a given portal, return all contacts that have been created in the portal.
|
List<Contact> |
getAllContactsUpdatedAfter(String userId,
String count,
Long waterMark)
This operation masks
getRecentContacts recursively filtering all the contacts that were updated after the waterMark |
List<CustomContactProperty> |
getAllCustomProperties(String userId)
Properties in HubSpot are fields that have been created.
|
String |
getCallbackUrl() |
String |
getClientId() |
HubSpotClientsManager |
getClientsManager() |
Contact |
getContactByEmail(String userId,
String contactEmail)
For a given portal, return information about a single contact by its email address.
|
Contact |
getContactById(String userId,
String contactId)
For a given portal, return information about a single contact by its ID.
|
Contact |
getContactByUserToken(String userId,
String contactUserToken)
For a given portal, return information about a single contact by its User Token (hubspotutk)
|
HubSpotList |
getContactListById(String userId,
String listId)
For a given portal, return a contact list by its unique ID.
|
ContactQuery |
getContactsByQuery(String userId,
String query,
String count)
For a given portal, return contacts and some data associated with those contacts by the contact's email address or name.
|
ContactList |
getContactsInAList(String userId,
String listId,
String count,
String property,
String offset)
For a given portal and a given list, identified by its unique ID, return a list of contacts that are in that list.
|
HubSpotListLists |
getContactsLists(String userId,
String count,
String offset)
For a given portal, return a set of contact lists that you specify with the count parameter.
|
ContactStatistics |
getContactStatistics(String userId)
For a given portal, return statistics about that portal's contacts.
|
HubSpotCredentialsManager |
getCredentialsManager() |
CustomContactPropertyGroup |
getCustomPropertyGroup(String userId,
String groupName)
For a given portal, return all contact property groups that have been created in the portal.
|
HubSpotListLists |
getDynamicContactLists(String userId,
String count,
String offset)
For a given portal, return a set of dynamic contact lists that you specify with the count parameter.
|
EmailSubscription |
getEmailSubscriptions(String userId,
String hubId)
For a given portal, return all email subscription types that have been created in the portal.
|
EmailSubscriptionStatus |
getEmailSubscriptionStatus(String userId,
String hubId,
String email)
For a given portal, return all email subscription information for the given email address and portal.
|
String |
getHubId() |
org.mule.api.store.ObjectStore |
getObjectStore() |
ContactList |
getRecentContacts(String userId,
String count,
String timeOffset,
String contactOffset)
For a given portal, return all contacts that have been recently updated or created.
|
Collection<Contact> |
getRecentContactsPaginated(String userId,
String count)
This operation masks
getRecentContacts with an Iterator that handles the pagination. |
String |
getScope() |
boolean |
hasUserAccessToken(String userId)
Check if the User has an Access Token.
|
void |
initialize() |
void |
setCallbackUrl(String callbackUrl) |
void |
setClientId(String clientId) |
void |
setClientsManager(HubSpotClientsManager clientsManager) |
void |
setCredentialsManager(HubSpotCredentialsManager credentialsManager) |
void |
setHubId(String hubId) |
void |
setObjectStore(org.mule.api.store.ObjectStore objectStore) |
void |
setScope(String scope) |
ContactProperties |
updateContact(String userId,
String contactId,
ContactProperties contactProperties)
Update an existing contact in HubSpot.
|
CustomContactProperty |
updateCustomProperty(String userId,
String propertyName,
CustomContactProperty contactProperty)
Update an existing property in HubSpot.
|
CustomContactPropertyGroup |
updateCustomPropertyGroup(String userId,
String groupName,
CustomContactPropertyGroup customContactPropertyGroup)
For a given portal, update a contact property group.
|
EmailSubscriptionStatusResult |
updateEmailSubscriptionStatus(String userId,
String hubId,
String email,
List<EmailSubscriptionStatusStatuses> statuses)
For a given email address and portal, update the email type subscription status.
|
EmailSubscriptionStatusResult |
updateEmailSubscriptionStatusUnsubscribeFromAll(String userId,
String hubId,
String email)
For a given email address and portal, update the email type subscription unsuscribing from all emails NOTE: it is only possible to opt email addresses OUT of subscription
and there is NO UNDO for this operation.
|
public static final String HUB_SPOT_URL_API
public static final String HUB_SPOT_URL_AUTH
public static final String API_VERSION
public HubSpotCredentialsManager getCredentialsManager()
public void setCredentialsManager(HubSpotCredentialsManager credentialsManager)
public HubSpotClientsManager getClientsManager()
public void setClientsManager(HubSpotClientsManager clientsManager)
@PostConstruct public void initialize()
@Processor public String authenticate(String userId, @Optional String callbackUrl, @Optional String clientId, @Optional String hubId, @Optional String scope, @OutboundHeaders Map<String,Object> headers) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException
Important: in order for the full authentication to work, the callbackUrl in the configuration must be pointing to another flow that has the authenticateResponse process to handle the reception of the token
userId
- This user identifier it is the one that will we used from now on to the successive calls to the process of this connector for this usercallbackUrl
- Use this callback instead the one in the configurationclientId
- Use this clientId instead the one in the configurationhubId
- Use this hubId instead the one in the configurationscope
- Use this scope instead the one in the configurationheaders
- This are added implicitly by Studio. The headers of the HTTP inbound, so it can establish a redirect code (302)HubSpotConnectorException
- If occur some error trying to generate the URL or the userId is empty it will throw this exception.HubSpotConnectorNoAccessTokenException
- If there is not an access_token in the response it will throw this exception.@Processor public String authenticateResponse(String inputRequest) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException
inputRequest
- The input parameters that came with the response to the authenticate processHubSpotConnectorException
- If any one of the required parameters is empty it will throw this exception.HubSpotConnectorNoAccessTokenException
- If there is not an access_token in the response it will throw this exception.@Processor public boolean hasUserAccessToken(String userId)
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
process@Processor public ContactList getAllContacts(String userId, @Optional@Default(value="") String count, @Optional@Default(value="") String contactOffset) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API Link: http://developers.hubspot.com/docs/methods/contacts/get_contacts
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcount
- This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The
maximum amount of contacts you can have returned to you via this parameter is 100.contactOffset
- This parameter will offset the contacts returned to you, based on the unique ID of the contacts in a given portal. Contact unique IDs are assigned by the order
that they are created in the system. This means for instance, if you specify a vidOffset offset of 5, and you have 20 contacts in the portal you're working in,
the contacts with IDs 6-20 will be returned to you.ContactList
containing all the contactsHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public ContactList getRecentContacts(String userId, @Optional@Default(value="") String count, @Optional@Default(value="") String timeOffset, @Optional@Default(value="") String contactOffset) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/get_recently_updated_contacts
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcount
- This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The
maximum amount of contacts you can have returned to you via this parameter is 100.timeOffset
- Used in conjunction with the vidOffset paramter to page through the recent contacts. Every call to this endpoint will return a time-offset value. This value is
used in the timeOffset parameter of the next call to get the next page of contacts.contactOffset
- Used in conjunction with the timeOffset paramter to page through the recent contacts. Every call to this endpoint will return a vid-offset value. This value is
used in the vidOffset parameter of the next call to get the next page of contacts.ContactList
containing all the contactsHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public Collection<Contact> getRecentContactsPaginated(String userId, String count) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
getRecentContacts
with an Iterator that handles the pagination.
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcount
- This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The
maximum amount of contacts you can have returned to you via this parameter is 100.Contact
that is Iterable and handles pagination in the backgroundHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public List<Contact> getAllContactsUpdatedAfter(String userId, @Optional@Default(value="") String count, Long waterMark) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
getRecentContacts
recursively filtering all the contacts that were updated after the waterMark
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcount
- This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The
maximum amount of contacts you can have returned to you via this parameter is 100.waterMark
- The waterMark used to filter the Contacts that were updated after that waterMarkContact
that is Iterable and handles pagination in the backgroundHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public Contact getContactById(String userId, String contactId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/get_contact
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactId
- Unique identifier for a particular contact. In HubSpot's contact system, contact ID's are called "vid".Contact
representationHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public Contact getContactByEmail(String userId, String contactEmail) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/get_contact_by_email
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactEmail
- The email address for the contact that you're searching for.Contact
representationHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public Contact getContactByUserToken(String userId, String contactUserToken) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/get_contact_by_utk
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactUserToken
- The user token (HubSpot cookie) for the contact that you're searching for.Contact
representationHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public ContactQuery getContactsByQuery(String userId, String query, @Optional@Default(value="") String count) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/search_contacts
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processquery
- The search term for what you're searching for. You can use all of a word or just parts of a word as well. For example, if you we're searching for contacts with
"hubspot" in their name or email, searching for "hub" would also return contacts with "hubspot" in their email address.count
- This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The
maximum amount of contacts you can have returned to you via this parameter is 100.ContactQuery
with the contactsHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public ContactDeleted deleteContact(String userId, String contactId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/delete_contact
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactId
- You must pass the Contact's ID that you're archiving in the request URL.ContactDeleted
representing the data when the contact is deletedHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public ContactProperties updateContact(String userId, String contactId, ContactProperties contactProperties) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
To update a contact, you should make an HTTP POST call to this endpoint with some JSON in the request payload. This JSON should contain properties from the contact that you want to add to or update. See the sample JSON below for an example of this snippet of JSON.
If you are trying to close a contact into a customer via the API, you should be updating the 'lifecyclestage' property and setting the value of this property to 'customer'.
Remember, if a property doesn't yet exist, you can create a new custom property through the API by using the 'Create Property' method.
API link: http://developers.hubspot.com/docs/methods/contacts/update_contact
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactId
- You must pass the Contact's ID that you're updating in the request URLcontactProperties
- The properties of the Contact that will have the one to be createdContactProperties
that was provided as input paramHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public Contact createContact(String userId, ContactProperties contactProperties) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/create_contact
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactProperties
- The properties that want to modify of an existing contactContact
newly createdHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public ContactStatistics getContactStatistics(String userId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/contacts/get_contact_statistics
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processContactStatistics
representation of the response of statisticsHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public HubSpotListLists getContactsLists(String userId, @Optional@Default(value="") String count, @Optional@Default(value="") String offset) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/lists/get_lists
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcount
- An integer that represents the number of lists that you want returned to your call. By default, this call will return 20 lists to you. If you want more or
different list returned to you, you'll want to use the "offset" parameter.offset
- An integer that represents where to start your list pull from. For instance, if you want to return numbered lists: 50-60, your offset should be "50" and your
count parameter (seen above) should be 10. You should also note that the returned JSON (seen below) includes a "has-more" field, which lets you know if there are
more lists that you can pull. If "has-more" is true, you can use this offset parameter to pull lists that weren't in your initial call.HubSpotListLists
with the listsHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public HubSpotList getContactListById(String userId, String listId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/lists/get_list
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processlistId
- Unique identifier for the list that you're looking for.HubSpotList
with the listHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public HubSpotListLists getDynamicContactLists(String userId, @Optional@Default(value="") String count, @Optional@Default(value="") String offset) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
Dynamic lists are lists that can only be edited by the contacts app - they are meant to update themselves when new contacts are created or are updated, meaning that you can't manually add contacts to dynamic lists.
By default, we will only return 20 lists to you via this API call.
API link: http://developers.hubspot.com/docs/methods/lists/get_dynamic_lists
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcount
- An integer that represents the number of lists that you want returned to your call. By default, this call will return 20 lists to you. If you want more or
different list returned to you, you'll want to use the "offset" parameter.offset
- An integer that represents where to start your list pull from. For instance, if you want to return numbered lists: 50-60, your offset should be "50" and your
count parameter (seen above) should be 10. You should also note that the returned JSON (seen below) includes a "has-more" field, which lets you know if there are
more lists that you can pull. If "has-more" is true, you can use this offset parameter to pull lists that weren't in your initial call.HubSpotListLists
with the listsHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public ContactList getContactsInAList(String userId, String listId, @Optional@Default(value="") String count, @Optional@Default(value="") String property, @Optional@Default(value="") String offset) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/lists/get_list_contacts
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processlistId
- Unique identifier for the list that you're looking for.count
- This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The
maximum amount of contacts you can have returned to you via this parameter is 100.property
- If you include the "property" parameter, then the properties in the "contact" object in the returned data will only include the property or properties that you
request.offset
- This parameter will offset the contacts returned to you, based on the unique ID of the contacts in a given portal. Contact unique IDs are assigned by the order
that they are created in the system. This means for instance, if you specify a vidOffset offset of 5, and you have 20 contacts in the portal you're working in,
the contacts with IDs 6-20 will be returned to you.ContactList
whit the contact listHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public EmailSubscription getEmailSubscriptions(String userId, @Optional String hubId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/email/get_subscriptions
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processhubId
- (portalId) The HubSpot Portal ID for the portal that you're making the call for. If left empty it will use the one stored in the credentials (authenticate
operation)EmailSubscription
with the subscriptions dataHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public EmailSubscriptionStatus getEmailSubscriptionStatus(String userId, @Optional String hubId, String email) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/email/get_status
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processhubId
- (portalId) The HubSpot Portal ID for the portal that you're making the call for. If left empty it will use the one stored in the credentials (authenticate
operation)email
- The email to check the current status subscriptionEmailSubscriptionStatus
with the status subscriptionHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public EmailSubscriptionStatusResult updateEmailSubscriptionStatus(String userId, @Optional String hubId, String email, List<EmailSubscriptionStatusStatuses> statuses) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/email/update_status
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processhubId
- (portalId) The HubSpot Portal ID for the portal that you're making the call for. If left empty it will use the one stored in the credentials (authenticate
operation)email
- The email to update the current status subscriptionstatuses
- A List of EmailSubscriptionStatusStatuses
to be modifiedEmailSubscriptionStatusResult
HubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public EmailSubscriptionStatusResult updateEmailSubscriptionStatusUnsubscribeFromAll(String userId, @Optional String hubId, String email) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/email/update_status
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processhubId
- (portalId) The HubSpot Portal ID for the portal that you're making the call for. If left empty it will use the one stored in the credentials (authenticate
operation)email
- The email to update the current status subscriptionEmailSubscriptionStatusResult
HubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be throwns@Processor public List<CustomContactProperty> getAllCustomProperties(String userId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: https://developers.hubspot.com/docs/methods/contacts/get_properties
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processCustomContactProperty
HubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public CustomContactProperty createCustomProperty(String userId, CustomContactProperty contactProperty) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
This method enables you to create a new property. If you try to create a property whose name already exists in the system, you'll get an HTTP 409 exception thrown from the API.
Currently, there is a 1,000 property limit that you can have in any given portal.
API link: https://developers.hubspot.com/docs/methods/contacts/create_property
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactProperty
- The CustomContactProperty
to be createdCustomContactProperty
createdHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public CustomContactProperty updateCustomProperty(String userId, String propertyName, CustomContactProperty contactProperty) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
To update a contact property, you should make an HTTP POST call to this endpoint with some JSON in the request payload. This JSON should contain property attributes that you want to add to or update. See the sample JSON below for an example of this snippet of JSON.
Remember, if a property doesn't yet exist, you can create a new custom property through the API by using the 'Create Property' method.
API link: https://developers.hubspot.com/docs/methods/contacts/update_property
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processpropertyName
- The name of the Custom Property to be updatedcontactProperty
- The contactProperty
to be createdcontactProperty
recently createdHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public void deleteCustomProperty(String userId, String contactPropertyName) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
To delete a contact property, you should make an HTTP DELETE call to this endpoint with the name of the property you're deleting in the request URL.
API link: https://developers.hubspot.com/docs/methods/contacts/delete_property
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcontactPropertyName
- The name of the custom property to be deletedHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public CustomContactPropertyGroup getCustomPropertyGroup(String userId, String groupName) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
Property groups allow you to more easily manage properties in a given portal. They also let you organize the user interface of the contacts web application in a more flexible way.
There are certain property groups that are in place for each portal by default: 'Contact Information', 'Social Media Information', 'Company Information' and 'Email Inforamtion' are examples.
API link: https://developers.hubspot.com/docs/methods/contacts/get_groups
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processgroupName
- The name of the group to be retrievedCustomContactPropertyGroup
HubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public CustomContactPropertyGroup createCustomPropertyGroup(String userId, CustomContactPropertyGroup customContactPropertyGroup) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
Property groups allow you to more easily manage properties in a given portal. They also let you organize the user interface of the contacts web application in a more flexible way.
There are certain propery groups that are in place for each portal by default: 'Contact Information', 'Social Media Information', 'Company Information' and 'Email Inforamtion' are examples. This method lets you create your own custom property group in a portal.
API link: https://developers.hubspot.com/docs/methods/contacts/create_group
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processcustomContactPropertyGroup
- A CustomContactPropertyGroup
to be createdCustomContactPropertyGroup
recently createdHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public CustomContactPropertyGroup updateCustomPropertyGroup(String userId, String groupName, CustomContactPropertyGroup customContactPropertyGroup) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
Property groups allow you to more easily manage properties in a given portal. They also let you organize the user interface of the contacts web application in a more flexible way.
There are certain property groups that are in place for each portal by default: 'Contact Information', 'Social Media Information', 'Company Information' and 'Email Inforamtion' are examples. This method lets you update your own custom property group in a portal.
API link: https://developers.hubspot.com/docs/methods/contacts/update_group
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processgroupName
- The name of the Custom Contact Property Group to be updatedcustomContactPropertyGroup
- A CustomContactPropertyGroup
to be createdCustomContactPropertyGroup
recently createdHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public void deleteCustomPropertyGroup(String userId, String groupName) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
Property groups allow you to more easily manage properties in a given portal. They also let you organize the user interface of the contacts web application in a more flexible way.
There are certain property groups that are in place for each portal by default: 'Contact Information', 'Social Media Information', 'Company Information' and 'Email Inforamtion' are examples. This method lets you delete your own custom property group in a portal. You can also create new groups, update existing groups, or just get group and the properties in each group.
API link: https://developers.hubspot.com/docs/methods/contacts/delete_group
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processgroupName
- The name of the group to be deletedHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public HubSpotListAddContactToListResponse addExistingContactInAList(String userId, String listId, String contactId) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
Please note that you cannot manually add (via this API call) contacts to dynamic lists - they can only be updated by the contacts app.
API link: http://developers.hubspot.com/docs/methods/lists/add_contact_to_list
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processlistId
- You need to include the ID for the list you're adding the lead to. You can search for lists using the get lists method.contactId
- The contact ID of the contact that you're adding to the list.HubSpotListAddContactToListResponse
In the "updated" attribute, you'll also get the contact ID of the contact that you've just added to the listHubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrown@Processor public HubSpotList createContactList(String userId, HubSpotNewList list, @Optional List<HubSpotListFilters> filters) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException, HubSpotConnectorAccessTokenExpiredException
API link: http://developers.hubspot.com/docs/methods/lists/create_list
userId
- The UserID of the user in the HubSpot service that was obtained from the authenticateResponse
processlist
- the new HubSpotNewList
to be created. Required fields:name, portalId.filters
- the list of HubSpotListFilters
that the list can haveHubSpotList
HubSpotConnectorException
- If the required parameters were not specified or occurs another type of error this exception will be thrownHubSpotConnectorNoAccessTokenException
- If the user does not have an Access Token this exception will be thrownHubSpotConnectorAccessTokenExpiredException
- If the user has his token already expired this exception will be thrownpublic String getClientId()
public void setClientId(String clientId)
public String getHubId()
public void setHubId(String hubId)
public String getScope()
public void setScope(String scope)
public String getCallbackUrl()
public void setCallbackUrl(String callbackUrl)
public org.mule.api.store.ObjectStore getObjectStore()
public void setObjectStore(org.mule.api.store.ObjectStore objectStore)
Copyright © 2010–2016. All rights reserved.