planningcenter / developers

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

missing required parameter "status" Background Check API #1201

Closed jemcguire closed 3 months ago

jemcguire commented 3 months ago

I'm using Postman to test the background check API. I have the basic auth configured correctly as the PATCH and GET works fine.
When I use POST to create a new background check I keep getting an error saying the "status" parameter is missing. Here is the raw body

{"data":{"type":"BackgroundCheck","id":"0","attributes":{"note":"new","status":"manual_clear","report_url":null,"expires_on":"2024-07-03","result":"clear","completed_at":"2024-07-01"}}}

The URL I'm using is https://api.planningcenteronline.com/people/v2/people/16721141/background_checks

Thanks in advance. john

seven1m commented 3 months ago

What is the error you are seeing, exactly?

jemcguire commented 3 months ago

I am getting the following response in Postman:

  {

    "errors": [

        {

            "status": "400",

            "title": "A required parameter wasn't supplied",

            "code": "missing_parameter",

            "detail": "param is missing or the value is empty: status",

            "meta": {

                "param": "status"

            }

        }

    ]

}

  My body payload is:

  {"data":{"type":"BackgroundCheck","id":"0","attributes":{"note":"new","status":"manual_clear","report_url":null,"expires_on":"2024-07-03","result":"clear","completed_at":"2024-07-01"}}}

  as raw body.

  john

      From: Tim Morgan @.> Sent: Friday, May 31, 2024 10:02 PM To: planningcenter/developers @.> Cc: John McGuire @.>; Author @.> Subject: Re: [planningcenter/developers] missing required parameter "status" Background Check API (Issue #1201)

  What is the error you are seeing, exactly?

— Reply to this email directly, view it on GitHub https://github.com/planningcenter/developers/issues/1201#issuecomment-2143215505 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAS57BSKNJ34BHMIVCWGITZFETRJAVCNFSM6AAAAABITTWRG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTGIYTKNJQGU . You are receiving this because you authored the thread.Message ID: @. @.> >

seven1m commented 3 months ago

OK, thanks for the additional information. I will look into this tomorrow, but it appears our error message is incorrect. The actual error is two-fold:

...but not both.

Can you try a payload like this:

{
  "data": {
    "type": "BackgroundCheck",
    "attributes": {
      "note": "new",
      "status": "complete_clear",
      "expires_on": "2024-07-03",
      "completed_at": "2024-07-01"
    }
  }
}

I removed the id attribute because you are creating a new record. No ID needed.

Also, you will need to somehow specify you want to use the 2023-03-21 version of the People API. You can either do that on your settings here or by passing a special header:

X-PCO-API-Version: 2023-03-21

You can see the possible values for the status attribute here: https://developer.planning.center/docs/#/apps/people/2023-03-21/vertices/background_check

Please let me know if I can help more.

jemcguire commented 3 months ago

Thanks Tim. 

  I tried your new payload and am still getting the same error:

  {

    "errors": [

        {

            "status": "400",

            "title": "A required parameter wasn't supplied",

            "code": "missing_parameter",

            "detail": "param is missing or the value is empty: status",

            "meta": {

                "param": "status"

            }

        }

    ]

}

  Any other thoughts on this?

  Thanks!! john

      From: Tim Morgan @.> Sent: Sunday, June 2, 2024 7:44 PM To: planningcenter/developers @.> Cc: John McGuire @.>; Author @.> Subject: Re: [planningcenter/developers] missing required parameter "status" Background Check API (Issue #1201)

  OK, thanks for the additional information. I will look into this tomorrow, but it appears our error message is incorrect. The actual error is two-fold:

...but not both.

Can you try a payload like this:

{"data":{"type":"BackgroundCheck","attributes":{"note":"new","status":"complete_clear","expires_on":"2024-07-03","completed_at":"2024-07-01"}}}

I removed the id attribute because you are creating a new record. No ID needed.

Also, you will need to somehow specify you want to use the 2023-03-21 version of the People API. You can either do that on your settings here https://api.planningcenteronline.com/oauth/applications or by passing a special header:

X-PCO-API-Version: 2023-03-21

You can see the possible values for the status attribute here: https://developer.planning.center/docs/#/apps/people/2023-03-21/vertices/background_check https://developer.planning.center/docs/#/apps/people/2023-03-21/vertices/background_check

Please let me know if I can help more.

— Reply to this email directly, view it on GitHub https://github.com/planningcenter/developers/issues/1201#issuecomment-2144062024 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAS57DDUALODOSRIXKPS3LZFOU5PAVCNFSM6AAAAABITTWRG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBUGA3DEMBSGQ . You are receiving this because you authored the thread.Message ID: @. @.> >

shanebonham commented 3 months ago

Hi @jemcguire,

Can you paste in the body payload you POSTed for that most recent failure?

jemcguire commented 3 months ago

The body raw is:

  {"data":{"type":"BackgroundCheck","attributes":{"note":"new","status":"complete_clear","expires_on":"2024-07-03","completed_at":"2024-07-01"}}}

    Thanks!

john

  From: Shane Bonham @.> Sent: Monday, June 3, 2024 10:36 AM To: planningcenter/developers @.> Cc: John McGuire @.>; Mention @.> Subject: Re: [planningcenter/developers] missing required parameter "status" Background Check API (Issue #1201)

  Hi @jemcguire https://github.com/jemcguire ,

Can you paste in the body payload you POSTed for that most recent failure?

— Reply to this email directly, view it on GitHub https://github.com/planningcenter/developers/issues/1201#issuecomment-2145368385 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAS57DQCKIDSP7SBUCWVXDZFR5NZAVCNFSM6AAAAABITTWRG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVGM3DQMZYGU . You are receiving this because you were mentioned.Message ID: @. @.> >

shanebonham commented 3 months ago

Hi @jemcguire,

Can you try the request again, but using the Content-Type: application/json header (if you aren't already). I don't think that's the problem here, but it will allow me to see the full body payload in our logs which will help with troubleshooting.

jemcguire commented 3 months ago

Hi Shane,

  OK.  That worked!  Looks like changing the Content-Type was the key.  Thanks again.

  john

  From: Shane Bonham @.> Sent: Monday, June 3, 2024 10:50 AM To: planningcenter/developers @.> Cc: John McGuire @.>; Mention @.> Subject: Re: [planningcenter/developers] missing required parameter "status" Background Check API (Issue #1201)

  Hi @jemcguire https://github.com/jemcguire ,

Can you try the request again, but using the Content-Type: application/json header (if you aren't already). I don't think that's the problem here, but it will allow me to see the full body payload in our logs which will help with troubleshooting.

— Reply to this email directly, view it on GitHub https://github.com/planningcenter/developers/issues/1201#issuecomment-2145400224 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAS57CLB5OC5BROKR2G423ZFR673AVCNFSM6AAAAABITTWRG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVGQYDAMRSGQ . You are receiving this because you were mentioned.Message ID: @. @.> >

shanebonham commented 3 months ago

Ah, interesting! What was the previous value of the header? At one time we were very accepting of a variety of content types, but that may have changed.

jemcguire commented 3 months ago

I didn’t have that header value set before.  So I think the raw body wasn’t getting parsed as json properly.

  john

  From: Shane Bonham @.> Sent: Monday, June 3, 2024 11:17 AM To: planningcenter/developers @.> Cc: John McGuire @.>; Mention @.> Subject: Re: [planningcenter/developers] missing required parameter "status" Background Check API (Issue #1201)

  Ah, interesting! What was the previous value of the header? At one time we were very accepting of a variety of content types, but that may have changed.

— Reply to this email directly, view it on GitHub https://github.com/planningcenter/developers/issues/1201#issuecomment-2145481452 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAS57BVDN7SOLUYCP63HLTZFSCHHAVCNFSM6AAAAABITTWRG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVGQ4DCNBVGI . You are receiving this because you were mentioned.Message ID: @. @.> >

shanebonham commented 3 months ago

Thanks for working through that with us. I'm going to close this issue, but feel free to comment back here if you have any other questions about making this request.