Description
the create meeting POST route returns fine in CURL, however, in guzzle it redirects to the GET request.
Error
None showed, as redirected.
Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT
Which Endpoint/s?
How To Reproduce (If applicable)
Steps to reproduce the behavior:
//TODO: Cannot get the Guzzle Version to work with POST requests.
// try {
// $url = 'users/' . request()->route()->parameter('userId') . '/meetings';
// $response = $this->client->request('POST', $url, [
// 'headers' => $this->headers,
// 'body' => json_encode([
// 'topic' => 'Hello',
// 'type' => 2,
// 'schedule_for' => 'QTk1g81ES_-8FMCOV9Q7bg',
// 'start_time' => '2020-05-31T12:00:00Z',
// 'duration' => 30
// ]),
// ]);
// }
// catch (\GuzzleHttp\Exception\ClientException $e) {
// $response = $e->getResponse();
// }
// return $response;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.zoom.us/v2/users/". request()->route()->parameter('userId') . "/meetings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{"topic": "hello my darling", "type": 2, "start_time": "2020-05-31T12:00:00Z", "duration": 30}',
CURLOPT_HTTPHEADER => array(
"authorization: Bearer " . $this->jwt,
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return $err;
} else {
return $response;
}
Screenshots (If applicable)
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.