billdeitrick / pypco

A Python client for the Planning Center Online API.
MIT License
39 stars 13 forks source link

Big thanks and question regarding blockouts and team members #27

Closed JohannesHaag closed 4 years ago

JohannesHaag commented 4 years ago

Hi @billdeitrick. First of all a big thanks to you for working on that project. I am still new to it, but I feel, that I can gain a lot benefit from it.

I have currently two questions where I am not sure, if it is not yet supported by the library or if I just could not find out yet how to get the informations I need: 1) All team members of a specific team (with the team id) 2) Blockout dates of all team members

Can you please give me a feedback if those scenarios are already supported and if yes, can you give me some hints how that can be done?

Thanks in advance, Johannes

pastorhudson commented 4 years ago

@billdeitrick is working on 1.0 which will change everything. You'll most likely have to rewrite code to use it. Should be coming soon. But using the current version you'd do something like this to get the team members.

import pypco
import os

pco = pypco.PCO(os.environ.get('PCO_CLIENT_ID'),
                os.environ.get('PCO_CLIENT_SECRET'))

team = pco.services.teams.get('597990')

for member in team.rel.people.list():
    print(member)
JohannesHaag commented 4 years ago

Hi @pastorhudson. Thanks for your response, maybe I simply have to wait for this update. Even your proposal to get the team members is not working for me. It is not giving an error, but I think, that the list is empty in my case.

pastorhudson commented 4 years ago

Make sure you put the correct team ID in the team = pco.services.teams.get('597990')

pastorhudson commented 4 years ago

I'm going to close this one up. Feel free to reopen if you need to.