How to create a meeting In Zoom Apps API?

Error in creating meetings with Zoom Apps,

API:-

Zoom Apps

Language:-

Python

Framework:-

Django , Django Rest Framework

Code:-

  1. Views.py
request_headers = {
        "Authorization":"Bearer "+access,
        "Content-Type":"application/json"
    }
    target_url = BaseUrl + "/users/me/meetings"
    meetingdetails = {"topic": "SF API TESTING",
                  "type": 2,
                  "start_time": "2022-12-24T10:21:57",
                  "duration": 45,
                  "timezone": "Aisa/Calcutta",
                  "agenda": "test",
                  }
    response = requests.post(url=target_url,data=meetingdetails,headers=request_headers)
    response_data = response
    data = {}
    print(f"Meeting Data: {response_data}")
    data['data'] = response_data
    return render(request,'zoom_user_deatils.html',data)
  1. Urls.py
path('zoom-Authorize/',views.oauthToken,name="zoomAuthorize"),
  1. Variables defined in views.py
 access ---> The access token
 BaseUrl---> "https://api.zoom.us/v2"

Expected Output:-

/zoom-Authorize/ is the redirect uri for the OAuth(not specified in above code as it is working fine).
OAuth part is working absolutely fine.
(checked by getting the meetings list as a success response)

This code should auto create the meeting after the OAuth and return the meeting details to the user (raw response data for test).

Error Output:-

<Response [400]>

After changing the return render(...) to HttpResponse(response_data) I was able to get the status code of 300 which is saying that the body should be a vaild JSON object.

Then I converted meetingdetails to JSON by json.dumps(meetingdetails)
Although it returned a JSON object but,

Dont pass this json object as requests.post(url=...,json=...,headers=...)

This gave me the same error. When I changed the json to data and sent the same JSON object again then I got the sucess.

i.e. requests.post(url=...,data=...,headers=...)

I hope this may find helpful for others.

1 Like

Thanks for sharing your solution here @Anirudh_007!

1 Like

As it is a Bug and I have also posted the temporary solution, So can I expect any incentives for it ?

If not then can you please tell me the criteria of bug finding and reporting

@Anirudh_007 My apologies, my understanding was that you were able to use your requests.post() function call to send the data in a different manner.

Are you able to share the exact JSON object format that had an issue and one that worked?