DataService query Campaign Table not working

I am using Ruby on Rails with the Legacy XML-RPC API, and I am unable to get a list of all my campaigns via the DataService query. It works fine when querying other tables, but not Campaign, it will just return nil.

I also tested this out on the io-docs, with the same result.

My Ruby code:

   `campaign_query = {"Id" => "%"}

    selected_fields = %w(Id Name)
    campaigns = Infusionsoft.data_query("Campaign", 1000, 0 , campaign_query, selected_fields)`

Raw XML request:

<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>DataService.query</methodName><params><param><value><string>[REMOVED AUTH TOKEN]</string></value></param><param><value><string>Campaign</string></value></param><param><value><int>1000</int></value></param><param><value><int>0</int></value></param><param><value><struct><member><name>Name</name><value><string>%</string></value></member></struct></value></param><param><value><array><data><value><string>Name</string></value></data></array></value></param><param><value><string>Name</string></value></param><param><value><boolean>0</boolean></value></param></params></methodCall>

Hi @zach_stradling, the Campaign table that is available via XML-RPC actually refers to the Legacy Follow-Up Sequence feature in Infusionsoft. You can access campaigns created using the Campaign Builder with this REST endpoint.!/Campaign/getAllCampaignsUsingGET

1 Like

is there a way to get info about Contacts (campaignees) for each Campaign? I was thinking querying Campaignee table will give me results I need, but it returns an empty array

Hi @and_dev, the Campaignee table is also part of the Legacy Follow-Up Sequence feature and will not show you contacts that are inside Campaigns. Sorry for the confusion.

We don’t currently expose the data but you can it by using the XML-RPC method SearchService.getSavedSearchResults to get the results of the Campaign Contacts report found under Marketing > Reports in the Infusionsoft application.

1 Like