planningcenter / developers

Planning Center API docs and support
https://developer.planning.center/docs/
85 stars 8 forks source link

Querying services people by tag_ids #1141

Closed dapoulin closed 10 months ago

dapoulin commented 11 months ago

Affected Product Services

Describe the bug Actually, in our church, we are deeply using tags to organise our volunteers (for technical department, tag could match a camera or sound operator, or any technical volunteer). My need is to get all people matching one or more tags. When trying to get all the people for that dedicated tags, I get a lot of people that does not match the query.

To Reproduce I am using the endpoint https://api.planningcenteronline.com/services/v2/people?offset=25&tag_ids[]=XXXXX

  1. create a unique tag
  2. get the tag id
  3. try to get all person having that tag.

Expected behavior I was expecting to only have the person having a tag containing that tag

Additional Context: I am for the moment only querying the api using Rapid (or Postman)

I want to use a PAT, because, it will be a batch that will fetch the data and make an extraction that we will be able to use for reporting.

I have..

michaelbenzinger commented 10 months ago

Hi David,

Thanks for reaching out! To query for tag_ids, you'll want to use this syntax: ?where[tag_ids][]=XXXXX. To find people matching tags 123 or 456, chain multiple wheres together, like this: ?where[tag_ids][]=123&where[tag_ids][]=456.

Hope this helps. I will close this issue, but please feel free to ask any additional questions.