Code Monkey home page Code Monkey logo

Comments (3)

jdennes avatar jdennes commented on July 19, 2024

How can I get all Subscriber with the custom fields for the same Campaign

This is a two step process, because of how the Campaign Monitor API works. You need to get the campaign recipients, and then look up the corresponding subscriber for each recipient.

Using this library, you can do that as follows:

from createsend import *

auth = {'api_key': 'your api key'}
campaign_id = 'your campaign id'

campaign = Campaign(auth, campaign_id)
recipients = campaign.recipients().Results

for r in recipients:
  subscriber = Subscriber(auth).get(r.ListID, r.EmailAddress)
  print subscriber.EmailAddress
  # Here you can access subscriber.CustomFields

how can I download Campaign report files

I suggest that you take a look at the Campaigns API Docs to figure out which reporting data you want. This library implements everything which is covered there.

Future questions about the API itself are best asked in the Campaign Monitor API Developers forum.

/cc @tobio to ensure that I'm not mistaken.

from createsend-python.

bpatyi avatar bpatyi commented on July 19, 2024

Thanks for your answer. @jdennes

I do the same, but if I have 2500 recipients, than it means 2500 queries which is very slowly and takes a long time. Do you know any other method which can help me?

from createsend-python.

jdennes avatar jdennes commented on July 19, 2024

2500 recipients, than it means 2500 queries which is very slowly and takes a long time. Do you know any other method which can help me?

I recommend hitting up the API Developers forum with more information about exactly what you're trying to build.

from createsend-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.