planningcenter / developers

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

Services: 404 Not Found on POSTing to plan's team_members #1202

Closed tbhartman closed 2 months ago

tbhartman commented 3 months ago

Affected Product Which product does this bug affect? Services

Describe the bug I can GET team member assignments from my plan at the endpoint /services/v2/service_types/1498323/plans/73362944/team_members. According to the Services API docs, I should be able to post to this endpoint as well. In fact, this seemed to be confirmed to work via past issues such as #182 and #292. However, when trying to post, I get only get a 404 error.

Is this working as intended and the API docs need updated? If so, is there a different suggested practice for adding a person to a team via the API?

To Reproduce

Any POST request I've sent to /services/v2/service_types/$type/plans/$id/team_members causes a 404 error.

Expected behavior A person to be added to that plan's schedule.

Additional Context:

I have..

KatieRiley commented 2 months ago

👋🏼 hey @tbhartman, Im curious, what attributes are you sending in the POST? When I was trying to reproduce this I would also get a 404 if I wasn't passing in person_id, team_id, and team_position_name. Once I passed those it was happy again 😅

edit: I just noticed we don't list team_id as an assignable attribute so docs will need to be updated

tbhartman commented 2 months ago

@KatieRiley, yes, that works now :smile:; I was not specifying team_id. In my very short experience with the API, it seems like I get fairly useful error messages back if I do something wrong (e.g. an invalid attribute). Maybe because I got a 404 I didn't try much more...is it usual to return a different status for a missing attribute?

KatieRiley commented 2 months ago

@tbhartman Im closing out this ticket because this got you unstuck, we will look into changing this to return 422 instead of 404 without making a breaking change as a followup to this

tbhartman commented 2 months ago

Looks good, thanks @KatieRiley