+ Start a Discussion
Fiona Quick 1Fiona Quick 1 

Campaign Members IsDeleted API Query

The below query is being used by offshore team in Mulesoft to query IsDeleted Campaign Members for specific Campaign ID. When tested in Developer console it seems to work but via API Integration pulling query in Mule (for ExactTarget) they are not returning expected results for specific Campaign (only one deleted/removed campaign member where there should be several over period of time). Need to find out how to trouble shoot or come up with better query.  Objective: To provide ExactTarget updated Campaign Members every 30 minutes (New Campaign Member add query does appear to be working).

select Campaign.ET_Activity_ID__c,CampaignId,Id,ContactId,Contact.Email,Contact.FirstName,Contact.LastName,Campaign_Member_Source__c, IsDeleted,LastModifiedDate,LeadId,Lead.LeadSource,Status from CAMPAIGNMEMBER where IsDeleted=true

Any assistance greatly appreciated.
 
Anup JadhavAnup Jadhav
When you run this query in developer console, do you use the same user as the integration user? Perhaps the integration user profile and role don't allow it to access all of the campaign data. I'd check by using the same credentials as the integration user. 
Fiona Quick 1Fiona Quick 1
Turns out that there were two problems, fiirst was the above query wasn't using Query All, second, it wasn't the correct query for the data trying to be reached. It was querying the contact Is Deleted and not the campaign member Is Removed so that has been remedied to switch to a campaign member history query to ensure that a query of the Campaign Member History will pull all campaign members added or removed from the Campaign rather than pulling all conacts in the recycle bin.   Thanks for the response Anup!