grnhse / greenhouse-api-docs

Documentation for Greenhouse Software's APIs
https://developers.greenhouse.io
Apache License 2.0
109 stars 74 forks source link

Getting a POST to /v2/scheduled_interviews fails without a helpful error message #468

Open spaugh opened 2 years ago

spaugh commented 2 years ago

I cannot, for the life of me, figure out how to create a scheduled interview.

This is what my request looks like in Python:

requests.post(
    url="https://harvest.greenhouse.io/v2/scheduled_interviews",
    data={
        "application_id": application_id,
        "interview_id": interview_id,
        "interviewers": [
            {"user_id": user_id, "response_status": "accepted"}
        ],
        "start": "2022-12-12T13:15:00Z",
        "end": "2022-12-12T13:55:00Z",
        "external_event_id": "some_external_event_id" ,
    },
    headers = {
        "On-Behalf-Of": str(interviewer["id"]),
        "Content-Type": "application/json",
        "Authorization": "Basic ..."
    }
)

But it fails with Bad Request for url: https://harvest.greenhouse.io/v1/scheduled_interviews, providing no info as to what's wrong with my request.

Dampolo03 commented 1 year ago

Hi @spaugh, currently facing a similar issue. How were you able to resolve this? Thanks.

Dampolo03 commented 1 year ago

Got it now. Nvm. Was supposed to pass the dictionary as body parameters.