Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/Zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ public function getLoginUrl($state = '')

throw new ZoomException("Error: getLoginUrl()");
}

public function createUserMeeting($id, $topic = 'New Meeting', $type = '1', $password = 'MTGPASS', $agenda = 'Start Meeting')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should be defaulting to these values.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i'll remove default values. think i'll add the other params too.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps passing an array of meeting params, or creating a ZoomMeeting class or something like that, may reduce the number of params you need to pass. Also, this would solve the typical order-of-parameters dilemma.

With the array solution, you could then (in the future, if needed) add default parameters with array_merge.

{
return $this->_makeCall('users/' . $id . '/meetings', compact('topic', 'type', 'password','agenda'), 'POST');
}

public function getUserInfo($id)
{
return $this->_makeCall('users/' . $id);
}

public function getUserMeetings($id, $type = 'live', $page_size = 30, $page_number = 1)
{
Expand Down Expand Up @@ -122,6 +132,15 @@ protected function _makeCall($function, $params = null, $method = 'GET')
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, true);

if ($method === 'POST') {
array_push($headerData, 'Content-Type:application/json');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the tab spacing here

$data_string = json_encode($params);

curl_setopt($ch, CURLOPT_POST, count($params));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerData);
}

$jsonData = curl_exec($ch);

Expand Down