public class LeadClientImpl extends RestClient implements LeadClient
Modifier and Type | Field and Description |
---|---|
protected static javax.ws.rs.core.GenericType<MarketoResponse<ActivityTypes>> |
ACTIVITY_TYPES_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<Campaign>> |
CAMPAIGN_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<CreateOrUpdateLead>> |
CREATE_OR_UPDATE_LEAD_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<DailyErrors>> |
DAILY_ERRORS_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<DailyUsage>> |
DAILY_USAGE_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<File>> |
FILE_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<IdOnlyObject>> |
ID_ONLY_OBJECT_RESPONSE_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<LeadActivities>> |
LEAD_ACTIVITIES_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<LeadChanges>> |
LEAD_CHANGES_RESPONSE_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<Lead>> |
LEAD_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<LeadStatus>> |
LEAD_STATUS_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<LeadsList>> |
LEADS_LIST_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<MarketoList>> |
MARKETO_LIST_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<Partition>> |
PARTITION_GENERIC_TYPE |
protected static javax.ws.rs.core.GenericType<MarketoResponse<PartitionResponse>> |
PARTITION_RESPONSE_GENERIC_TYPE |
DATE_FORMAT_TIMEZONE, DATE_FORMAT_Z, DATE_FORMAT_Z_MILLIS, DATE_FORMAT_Z_TIMEZONE, DATE_ONLY_FORMAT, JOINER, RESPONSE_MAP_GENERIC_TYPE, SERVICE_RESPONSE_GENERIC_TYPE, SINGLE_ENTRY_MAP_TO_STRING, VOID_GENERIC_TYPE
Constructor and Description |
---|
LeadClientImpl(RestClientConfigProvider configProvider) |
Modifier and Type | Method and Description |
---|---|
MarketoResponse<LeadsList> |
addLeadsToList(int listId,
List<Integer> ids)
Allows the called to add leads to a list
|
MarketoResponse<Void> |
associateLead(int leadId,
String cookie)
Allows the caller to associate a lead with a cookie value
|
MarketoResponse<CreateOrUpdateLead> |
createLead(List<Map<String,Object>> input,
String lookupField,
LeadsActions action,
boolean asyncProcessing,
String partitionName)
Allows the caller to create new leads within Marketo, or if the lead already exists update it with the submitted values
|
MarketoResponse<CreateOrUpdateLead> |
deleteLead(List<LeadId> input)
Allows the caller to delete leads
|
MarketoResponse<Lead> |
describe()
Allows the user to get all fields and the data type of a lead object
|
MarketoResponse<ActivityTypes> |
getActivityTypes()
Allows the caller to retrieve metadata about activity types
|
MarketoResponse<Campaign> |
getCampaignById(int marketoId)
Allows the caller to retrieve a campaign using a Marketo id
|
MarketoResponse<DailyErrors> |
getDailyErrors()
Allows the caller to retrieve error codes and their count for the day
|
MarketoResponse<DailyUsage> |
getDailyUsage()
Allows the caller to retrieve total and user-level usage count for the day
|
MarketoResponse<Map<String,Object>> |
getDeletedLeads(String nextPageToken,
Integer batchSize)
Allows the caller to retrieve a list of leads that were deleted
|
MarketoResponse<File> |
getImportFailureFile(int batchId)
Allows the caller to return the failure file from Import Lead call in the same format that was used
|
MarketoResponse<LeadStatus> |
getImportLeadStatus(int batchId)
Allows the caller to retrieve the status of lead operation from Import Lead call
|
MarketoResponse<File> |
getImportWarningFile(int batchId)
Allows the caller to return the warning file from Import Lead call in the same format that was used
|
MarketoResponse<DailyErrors> |
getLast7DaysErrors()
Allows the caller to retrieve error codes and their count for the last 7 days
|
MarketoResponse<DailyUsage> |
getLast7DaysUsage()
Allows the caller to retrieve total and user-level usage count for last 7 days
|
MarketoResponse<LeadActivities> |
getLeadActivities(List<Integer> activityTypeIds,
String nextPageToken,
Integer batchSize,
Integer listId,
List<String> leadIds)
Allows the caller to retrieve activities for the requested activity types
|
MarketoResponse<Map<String,Object>> |
getLeadById(int leadId,
List<String> fields)
Allows the caller to retrieve a single lead using the Lead Id
|
MarketoResponse<LeadChanges> |
getLeadChanges(String nextPageToken,
Integer batchSize,
Integer listId,
List<String> fields)
Allows the caller to retrieve a list of changed data value for lead
|
MarketoResponse<Partition> |
getLeadPartitions()
Allows the caller to return a list of lead partitions in a Marketo instance
|
MarketoResponse<MarketoList> |
getListById(int id)
Allows the caller to retrieve a List by their id
|
MarketoResponse<Campaign> |
getMultipleCampaigns(List<Integer> ids,
List<String> names,
List<String> programNames,
List<String> workspaceNames,
Integer batchSize,
String nextPageToken)
Allows the caller to retrieve multiple campaigns
|
MarketoResponse<Map<String,Object>> |
getMultipleLeadsByFilterType(String filterType,
List<String> filterValues,
List<String> fields,
String nextPageToken,
Integer batchSize)
Allows the caller to retrieve multiple leads for a given search criteria
|
MarketoResponse<Map<String,Object>> |
getMultipleLeadsByListId(int listId,
List<String> fields,
String nextPageToken,
Integer batchSize)
Allows the caller to retrieve multiple leads from a given list id
|
MarketoResponse<Map<String,Object>> |
getMultipleLeadsByProgramId(int programId,
List<String> fields,
String nextPageToken,
Integer batchSize)
Allows the caller to retrieve multiple leads from a given list id
|
MarketoResponse<MarketoList> |
getMultipleLists(List<Integer> ids,
List<String> names,
List<String> programNames,
List<String> workspaceNames,
Integer batchSize,
String nextPageToken)
Allows the caller to retrieve multiple lists.
|
MarketoResponse<Void> |
getPagingToken(Calendar sinceDateTime)
Allows the caller to retrieve a token for a given date
|
MarketoResponse<Map<String,Object>> |
importLead(ImportLeadFormats format,
InputStream file,
String lookupField,
Integer listId,
String partitionName)
Allows the caller to sync leads in bulk
|
MarketoResponse<LeadsList> |
memberOfList(int listId,
List<Integer> ids)
Allows the caller to find out if leads are a member of a given list
|
MarketoResponse<Void> |
mergeLead(int leadId,
List<LeadId> losingLeadIds,
boolean mergeInCRM)
Allows the caller to merge a winning lead and a list of losers leads.
|
MarketoResponse<LeadsList> |
removeLeadsFromList(int listId,
List<Integer> ids)
Allows the caller to remove a lead from a list
|
MarketoResponse<IdOnlyObject> |
requestCampaign(int marketoId,
List<Integer> leads,
List<CampaignTokens> tokens)
Allows the user to run an existing Marketo lead in a Marketo Smart Campaign
|
MarketoResponse<IdOnlyObject> |
scheduleCampaign(int marketoId,
Calendar runAt,
String cloneToProgramName,
List<CampaignTokens> tokens)
Allows the caller to schedule a batch Smart Campaign to run either immediately or at a future date
|
MarketoResponse<PartitionResponse> |
updateLeadsPartition(List<UpdateLeadPartition> input)
Allows the caller to updates the partition for one or more leads
|
buildGetInvocation, buildPostInvocation, buildPostInvocation, buildPostInvocation, buildPostInvocation, bulkWebTarget, process, putIfNotNull, queryParamIfNotNull, webTarget
protected static final javax.ws.rs.core.GenericType<MarketoResponse<DailyErrors>> DAILY_ERRORS_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<DailyUsage>> DAILY_USAGE_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<ActivityTypes>> ACTIVITY_TYPES_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<LeadActivities>> LEAD_ACTIVITIES_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<Campaign>> CAMPAIGN_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<MarketoList>> MARKETO_LIST_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<LeadsList>> LEADS_LIST_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<LeadStatus>> LEAD_STATUS_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<File>> FILE_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<Lead>> LEAD_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<CreateOrUpdateLead>> CREATE_OR_UPDATE_LEAD_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<Partition>> PARTITION_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<PartitionResponse>> PARTITION_RESPONSE_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<IdOnlyObject>> ID_ONLY_OBJECT_RESPONSE_GENERIC_TYPE
protected static final javax.ws.rs.core.GenericType<MarketoResponse<LeadChanges>> LEAD_CHANGES_RESPONSE_GENERIC_TYPE
public LeadClientImpl(RestClientConfigProvider configProvider)
public MarketoResponse<Lead> describe()
describe
in interface LeadClient
public MarketoResponse<CreateOrUpdateLead> createLead(@NotNull List<Map<String,Object>> input, @Nullable String lookupField, @Nullable LeadsActions action, boolean asyncProcessing, String partitionName)
createLead
in interface LeadClient
input
- the list of lead records to create or updatelookupField
- if specified, will use this attribute to find the duplicate. Otherwise, email will be used for deduplicationaction
- the action to performasyncProcessing
- this allows you to make call asynchronously. Default is falsepartitionName
- lead partition namepublic MarketoResponse<CreateOrUpdateLead> deleteLead(@NotNull List<LeadId> input)
deleteLead
in interface LeadClient
input
- array of lead ids records to deletepublic MarketoResponse<Map<String,Object>> getLeadById(int leadId, List<String> fields)
getLeadById
in interface LeadClient
leadId
- the id of the leadfields
- the fields to returnpublic MarketoResponse<DailyUsage> getDailyUsage()
getDailyUsage
in interface LeadClient
public MarketoResponse<DailyUsage> getLast7DaysUsage()
getLast7DaysUsage
in interface LeadClient
public MarketoResponse<DailyErrors> getDailyErrors()
getDailyErrors
in interface LeadClient
public MarketoResponse<DailyErrors> getLast7DaysErrors()
getLast7DaysErrors
in interface LeadClient
public MarketoResponse<Void> getPagingToken(@NotNull Calendar sinceDateTime)
getPagingToken
in interface LeadClient
sinceDateTime
- the timeframe for your request to the Get Lead Activities or Get Lead Changes APIs. Supported datetime format: "2014-10-06T13:22:17-08:00"
"2014-10-06T13:22-07:00" "2014-10-06"public MarketoResponse<ActivityTypes> getActivityTypes()
getActivityTypes
in interface LeadClient
public MarketoResponse<Map<String,Object>> getDeletedLeads(@NotNull String nextPageToken, @Nullable Integer batchSize)
getDeletedLeads
in interface LeadClient
nextPageToken
- used to paginate through large result setsbatchSize
- the number of lead activities to be returned in a single call (default and max is 300)public MarketoResponse<LeadChanges> getLeadChanges(@NotNull String nextPageToken, @Nullable Integer batchSize, @Nullable Integer listId, @NotNull List<String> fields)
getLeadChanges
in interface LeadClient
nextPageToken
- used to paginate through large result setsbatchSize
- the number of lead activities to be returned in a single call (default and max is 300)listId
- the activities for leads with in this given listfields
- the fields to returnLeadChanges
with the call responsepublic MarketoResponse<LeadActivities> getLeadActivities(@NotNull List<Integer> activityTypeIds, @NotNull String nextPageToken, @Nullable Integer batchSize, @Nullable Integer listId, @Nullable List<String> leadIds)
getLeadActivities
in interface LeadClient
activityTypeIds
- a list of activity type ids (max 10)nextPageToken
- used to paginate through large result setsbatchSize
- the number of lead activities to be returned in a single call (default and max is 300)listId
- the activities for leads with in this given listleadIds
- a list of lead IDsLeadActivities
with the call responsepublic MarketoResponse<Campaign> getCampaignById(int marketoId)
getCampaignById
in interface LeadClient
marketoId
- the campaign id on valid error from the endpointCampaign
.public MarketoResponse<Campaign> getMultipleCampaigns(@NotNull List<Integer> ids, @NotNull List<String> names, @NotNull List<String> programNames, @NotNull List<String> workspaceNames, @Nullable Integer batchSize, @Nullable String nextPageToken)
getMultipleCampaigns
in interface LeadClient
ids
- the campaigns idsnames
- the campaigns namesprogramNames
- the program namesworkspaceNames
- the workspaces namesbatchSize
- the number of lead campaigns to be returned in a single call (default and max is 300)nextPageToken
- used to paginate through large result setsCampaign
.public MarketoResponse<IdOnlyObject> scheduleCampaign(int marketoId, @Nullable Calendar runAt, @Nullable String cloneToProgramName, @Nullable List<CampaignTokens> tokens)
scheduleCampaign
in interface LeadClient
marketoId
- the Marketo id of the campaignrunAt
- the time to run the scheduled campaign. If not provided, schedule it to be 5 mins later.cloneToProgramName
- when this attribute is present, the campaign’s parent program will be cloned and the newly created campaign will be scheduled.tokens
- the name of the token/s you want to send a new value forIdOnlyObject
.public MarketoResponse<IdOnlyObject> requestCampaign(int marketoId, @NotNull List<Integer> leads, @Nullable List<CampaignTokens> tokens)
requestCampaign
in interface LeadClient
marketoId
- the Marketo id of the campaignleads
- a list of leads idtokens
- the name of the token/s you want to send a new value forIdOnlyObject
.public MarketoResponse<MarketoList> getMultipleLists(@NotNull List<Integer> ids, @NotNull List<String> names, @NotNull List<String> programNames, @NotNull List<String> workspaceNames, @Nullable Integer batchSize, @Nullable String nextPageToken)
getMultipleLists
in interface LeadClient
ids
- the list of idsnames
- the list of namesprogramNames
- the list of program namesworkspaceNames
- the list of workspace namesnextPageToken
- used to paginate through large result setsMarketoList
of leadspublic MarketoResponse<MarketoList> getListById(int id)
getListById
in interface LeadClient
id
- the list idpublic MarketoResponse<LeadsList> addLeadsToList(int listId, @NotNull List<Integer> ids)
addLeadsToList
in interface LeadClient
listId
- the desired list where the leads will be addedids
- the list of lead idspublic MarketoResponse<LeadsList> removeLeadsFromList(int listId, @NotNull List<Integer> ids)
removeLeadsFromList
in interface LeadClient
listId
- the desired list where the leads will be removedids
- the list of lead idspublic MarketoResponse<LeadsList> memberOfList(int listId, @NotNull List<Integer> ids)
memberOfList
in interface LeadClient
listId
- the desired list where the leads will be removedids
- the list of lead idspublic MarketoResponse<Map<String,Object>> importLead(@NotNull ImportLeadFormats format, @NotNull InputStream file, @Nullable String lookupField, @Nullable Integer listId, @Nullable String partitionName)
importLead
in interface LeadClient
format
- the file format: csv, tst or ssvfile
- the leads datalookupField
- the deduplication fieldlistId
- if listId is not specified, this API operation will create temp static list. Workspace for the list is determined whether partitionName is given or not.partitionName
- if specified, this parameter will verify if user has access to the partition. If not specified, this API operation will use primary partition of the list
workspacepublic MarketoResponse<LeadStatus> getImportLeadStatus(int batchId)
getImportLeadStatus
in interface LeadClient
batchId
- the batch id returned from Import Lead callpublic MarketoResponse<File> getImportFailureFile(int batchId) throws MarketoException
getImportFailureFile
in interface LeadClient
batchId
- the batch id returned from Import Lead callMarketoException
public MarketoResponse<File> getImportWarningFile(int batchId) throws MarketoException
getImportWarningFile
in interface LeadClient
batchId
- the batch id returned from Import Lead callMarketoException
public MarketoResponse<Partition> getLeadPartitions()
getLeadPartitions
in interface LeadClient
public MarketoResponse<Void> associateLead(int leadId, @NotNull String cookie)
associateLead
in interface LeadClient
leadId
- the id of the leadcookie
- cookie value of leadpublic MarketoResponse<Void> mergeLead(int leadId, @NotNull List<LeadId> losingLeadIds, boolean mergeInCRM)
mergeLead
in interface LeadClient
leadId
- the winner lead idlosingLeadIds
- a list of losers leads idmergeInCRM
- set to true to merge in CRM. Default is falsepublic MarketoResponse<Map<String,Object>> getMultipleLeadsByListId(int listId, @Nullable List<String> fields, @Nullable String nextPageToken, @Nullable Integer batchSize)
getMultipleLeadsByListId
in interface LeadClient
listId
- the id of the list. To retrieve a list id, see getMultipleListsfields
- the list of fields to returnnextPageToken
- used to paginate through large result setsbatchSize
- the number of lead to be returned in a single call (default and max is 300)public MarketoResponse<Map<String,Object>> getMultipleLeadsByProgramId(int programId, @Nullable List<String> fields, @Nullable String nextPageToken, @Nullable Integer batchSize)
getMultipleLeadsByProgramId
in interface LeadClient
programId
- the id of the program.fields
- the list of fields to returnnextPageToken
- used to paginate through large result setsbatchSize
- the number of lead to be returned in a single call (default and max is 300)public MarketoResponse<Map<String,Object>> getMultipleLeadsByFilterType(@NotNull String filterType, @NotNull List<String> filterValues, @Nullable List<String> fields, @Nullable String nextPageToken, @Nullable Integer batchSize)
getMultipleLeadsByFilterType
in interface LeadClient
filterType
- one of the marketo supported filter typesfilterValues
- list of filter valuesfields
- the list of fields to returnnextPageToken
- used to paginate through large result setsbatchSize
- the number of leads to be returned in a single call (default and max is 300)public MarketoResponse<PartitionResponse> updateLeadsPartition(@NotNull List<UpdateLeadPartition> input)
updateLeadsPartition
in interface LeadClient
input
- Array of input object (id and partitionName)Copyright © 2010–2018. All rights reserved.