Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion about tab data per person #693

Closed
4 tasks done
bergernetch opened this issue Nov 12, 2019 · 6 comments
Closed
4 tasks done

Confusion about tab data per person #693

bergernetch opened this issue Nov 12, 2019 · 6 comments

Comments

@bergernetch
Copy link

Related Applications
Which application(s) is this question related to?
People

Describe the question
I am trying to get the activated check boxes for a person which are made under a custom tab.

What have you tried that worked?
Well, at least OAuth2 works :-D

What have you tried that didn't work?
I tried many api calls but I am confused.

e.g. This call gives me the activated boxes, but always returns data for the same user, not the one logged in?
https://api.planningcenteronline.com/people/v2/field_data?where[field_definition_id]=324431

According to #282 I guess this is what I am looking for, but I don't know that to insert for AAA (I used peopleid for ZZZ and 324431 for YYY):
https://api.planningcenteronline.com/people/v2/people/ZZZ/field_data/AAA/field_option[ID=**YYY**]

Additional context
Add any other context or screenshots about the feature request here.

I have..

  • Reviewed the documentation found at https://developer.planning.center/docs
  • Searched for previous issues answering this question
  • Removed all private information from this issue (credentials, tokens, emails, phone numbers, etc.)
  • Reviewed my issue for completeness
@shanebonham
Copy link
Contributor

Hi @bergernetch!

What you probably want to do is something like https://api.planningcenteronline.com/people/v2/people/AAA/field_data?where[field_definition_id]=ZZZ where AAA is the person_id and ZZZ is the field_definition_id. That will return FieldDatum resources; typically just one, but for checkboxes, one for each checked option.

I'm going to close this issue, but please respond back if there is more info we can provide.

@bergernetch
Copy link
Author

This works, thanks for clearing up the confusion.

@bergernetch
Copy link
Author

For most users this call https://api.planningcenteronline.com/people/v2/people/AAA/field_data?where[field_definition_id]=ZZZ works and returns the expected data. But for some I get an 403 Forbidden "You do not have access to this resource". What permissions are required to read the data? I only try to read the users own data. I am using this to get "group" memberships for a nextcloud integration, and so far it has worked for about 10 users. Now I have two where this 403 pops up and I am unable find out why.

I am using a modified sociallogin plugin for nextcloud.

The calls that are made are:

The users do all have services access and their login works for services web & app.
How does the permission model work for these api calls?

@shanebonham
Copy link
Contributor

Hi @bergernetch,

Custom field data is only visible to those with whom the parent tab is shared. The shares are maintained in the Planning Center People web interface, at something like https://people.planningcenteronline.com/customize#tab=the_tab_id. The most permissive tab share is with "All Viewers and above", which implies that a user would at least need access to Planning Center People in order to see custom field data, even on their own profile. But the tab might also have more restrictive shares, such as "All Managers" or even just specific people.

Does that help shed light on what you're seeing?

@shanebonham shanebonham reopened this Feb 3, 2020
@bergernetch
Copy link
Author

Hi @shanebonham,

Oh ok. So I understand that if the user does not have "People" module access, he cannot read his own tab data. I cannot give "People" module access to those users.

What other options do I have to get this custom tab data? I need it to create the groups in nextcloud, just after a successful OAuth.

@shanebonham
Copy link
Contributor

Hi @bergernetch,

API requests are made as a specific person, and permissions are enforced as such. If you need to access data on a person record, you will have to make the API request as someone who has permission to read that data.

I'm closing this issue, but let us know if there are any other questions we can answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants