Zoom API - Meeting created with the wrong start date

I’m working on an elearning website and I’m trying to integrate Zoom meetings using the API

According to the official documentation, the start_time must be set to the yyyy-MM-ddTH:M:S .

Example : 2020-10-02T18:00:00

Based on that, this is the code I’m using.

class Zoom:
...

    def parse_date(self, date):
        parts = date.strip().split(' ')
        part1 = parts[0]
        part2 = parts[1]
        parts1 = part1.split('/')
        day = parts1[0]
        month = parts1[1]
        year = parts1[2]
        parts2 = part2.split(':')
        h = parts2[0]
        m = parts2[1]
        formatted_date = year + '-' + month + '-' + day + 'T' + h + ':' + m + ':00Z'
        return formatted_date

    def create_meeting(self, topic, start_date, password):
        token = self.get_token()
        conn = http.HTTPSConnection(Zoom.ZOOM_API_URL)      
        headers = {'authorization': "Bearer " + token, 'content-type': "application/json"}
        data = {'topic': topic, 'type': 2, 'start_time': self.parse_date(start_date), 'timezone': 'Africa/Casablanca', 'password': password}
        conn.request("POST", "/v2/users/me/meetings", json.dumps(data), headers)
        response = json.loads(conn.getresponse().read().decode('utf-8'))
        return response

zoom = Zoom('API_KEY', 'API_SECRET')
meeting = zoom.create_meeting(topic='Learning test', start_date='02/10/2020 18:00', password='123456')

The meeting is created but the start date is wrong. In the example below I specified 6PM but it was saved with 7PM

image

It appears your formatted_date entry is in Zulu (GMT) time and your timezone is Casablanca, I wonder if it is just the 1 hour time zone offset???

I guess the same. Is there a way to fix this ? or do I just have to substract one hour ?

Looks like you can just drop the “Z” to get local time.

        formatted_date = year + '-' + month + '-' + day + 'T' + h + ':' + m + ':00Z'

to

        formatted_date = year + '-' + month + '-' + day + 'T' + h + ':' + m + ':00'

Yes that was it. Documentation can be tricky. Thanks :smiley:

Thanks for your help @j.harlow! Glad you got this sorted @amonaldo1996. :100:

Let us know if you still have any questions about this.

Best,
Will

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.