# Trouble integrating REST API

**URL:** <https://devforum.zoom.us/t/trouble-integrating-rest-api/214>\
**Category:** API and Webhooks\
**Created:** [April 30, 2017, 10:02pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214 "2017-04-30T22:02:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh\_Gopalan](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mahesh\_Gopalan](https://devforum.zoom.us/u/Mahesh_Gopalan)\
**Post date:** [April 30, 2017, 10:02pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/1 "2017-04-30T22:02:41Z")

</div>

Hi there,

I am getting some issues while integrating the rest api, like how to call the sendRequest function from the button that is there in the html form…

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 1, 2017, 5:16pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/2 "2017-05-01T17:16:52Z")

</div>

Hi Mahesh,

please take a look at Zoom’s document @&nbsp;[https://zoom.us/developer/overview/getting-started-with-rest-api](https://zoom.us/developer/overview/getting-started-with-rest-api).

You can also try to call REST API using postman.

Best

---

<div class="post-metadata">

**Author:** ![Mahesh\_Gopalan](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mahesh\_Gopalan](https://devforum.zoom.us/u/Mahesh_Gopalan)\
**Post date:** [May 2, 2017, 9:39pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/3 "2017-05-02T21:39:38Z")

</div>

Hi Wei,

Well I had tried to do the same with the POSTMAN also but the response is coming as the error:300, The screenshots are attached below. And while implementing the REST API in PHP, I am not getting any response from the server. I want to get the output by using the PHP only, I don’t need any other vendor to get the response.

Thanks.

 ![](https://support.zoom.us/hc/user_images/_FCE6upvXfTXKolnqfbjig.png) ![](https://support.zoom.us/hc/user_images/HuvnavZzHxshfW4mRhxJ6A.png)

---

<div class="post-metadata">

**Author:** ![Zoom\_Developer](https://avatars.discourse-cdn.com/v4/letter/z/eb8c5e/32.png) [@Zoom\_Developer](https://devforum.zoom.us/u/Zoom_Developer)\
**Post date:** [May 2, 2017, 10:03pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/4 "2017-05-02T22:03:23Z")

</div>

Hi Mahesh, see the discussion on the same topic here -&nbsp;

[https://support.zoom.us/hc/en-us/community/posts/115017694543-Post-request-keeps-asking-me-Api-Key-and-secret-are-required-](https://devforum.zoom.us/hc/en-us/community/posts/115017694543-Post-request-keeps-asking-me-Api-Key-and-secret-are-required-)

can you check if you are including all&nbsp;parameters in the URL ? this quick php example might be helpful&nbsp;

[https://github.com/zoomvideo/PHP/blob/master/ZoomRESTAPIPHP.php](https://github.com/zoomvideo/PHP/blob/master/ZoomRESTAPIPHP.php)

Regards, Wei @ Zoom

---

<div class="post-metadata">

**Author:** ![Mahesh\_Gopalan](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mahesh\_Gopalan](https://devforum.zoom.us/u/Mahesh_Gopalan)\
**Post date:** [May 2, 2017, 10:19pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/5 "2017-05-02T22:19:52Z")

</div>

Hey Wei,

Thanks for your suggestion about the POSTMAN and I’ll definitely look at this, but the main issue is with the PHP Api call. I am sending you my code that i had implemented just to create a meeting but the issue is that how the createAMeeting() function which is defined under the class is to be called by using the HTML button which is there in another file. Let me send you the code of the PHP file and HTML file.

&nbsp;

New.php:

\<?php

p1 = \_POST[‘host’];  
p2 = \_POST[‘topic’];  
p3 = \_POST[‘type’];  
/\*echo $p1;  
echo $p2;  
echo $p3;  
\*/  
class Zoom{

private $API\_KEY = ‘xxxxxxxxx’;  
private $Secret\_KEY = ‘xxxxxxxxxx’;  
private $url = ‘[https://api.zoom.us/v1/](https://api.zoom.us/v1/)’;

//function to redirect the page to Zoom  
function sendReq($calledFunction, $data){

//url that will create the endpoint i.e create meeting  
$request\_url = $this-\>$url.$calledFunction;

$data[‘api\_key’] = $this-\>$API\_KEY;  
$data[‘api\_secret’] = $this-\>$Secret\_KEY;  
$data[‘data\_type’] = ‘JSON’;

$postFields = http\_build\_query($data);  
echo $postFields;

$ch = curl\_init();  
curl\_setopt($ch, CURLOPT\_RETURNTRANSFER,1);  
curl\_setopt($ch, CURLOPT\_URL, $request\_url);  
curl\_setopt($ch, CURLOPT\_POST, 1);  
curl\_setopt($ch, CURLOPT\_POSTFIELDS, $postFields);  
curl\_setopt($ch, CURLOPT\_SSL\_VERIFYPEER, false);  
$response = curl\_exec($ch);

$errorMessage = curl\_exec($ch);  
echo $errorMessage;  
curl\_close($ch);

echo $request\_url;  
var\_dump($data);  
var\_dump($response);  
if(!$response){  
return false;  
}

return json\_encode($response);

}

function createAMeeting(){  
$createAMeetingArray = array();  
$createAMeetingArray[‘host\_id’] = $p1;  
$createAMeetingArray[‘topic’] = $p2;  
$createAMeetingArray[‘type’] = $p3;  
return $this-\>sendRequest(‘meeting/create’, $createAMeetingArray);  
}  
}  
?\>

&nbsp;

&nbsp;

index.html

&nbsp;

\<html\>  
\<head\>  
\<title\>\</title\>

\</head\>  
\<body\>

\<form action=“new.php” method=“POST”\>  
\<input type=“text” id=“topic” placeholder=“enter the host id” name=“host”\>  
\<br/\>\<input type=“text” placeholder=“enter the topic” name=“topic”\>\<br/\>  
\<input type=“text” placeholder="enter the type " name=“type”\>\<br/\>  
\<input type=“submit” value=“Create the meeting” name=“createMeeting”\>

\</form\>

\</body\>

\</html\>

---

<div class="post-metadata">

**Author:** ![Mahesh\_Gopalan](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mahesh\_Gopalan](https://devforum.zoom.us/u/Mahesh_Gopalan)\
**Post date:** [May 2, 2017, 10:21pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/6 "2017-05-02T22:21:14Z")

</div>

These two files are there and I had understood the functionality that is happening in the PHP file but the issues comes for the method call using the button in the HTML.

&nbsp;

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 2, 2017, 11:31pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/7 "2017-05-02T23:31:03Z")

</div>

Hi Mahesh,

Based on my understanding, this is a general question not related to Zoom REST API functionality. Please do some search. Feel free to contact us if any Zoom REST API functionality is not working.

Best

Wei&nbsp;

---

<div class="post-metadata">

**Author:** ![Mahesh\_Gopalan](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mahesh\_Gopalan](https://devforum.zoom.us/u/Mahesh_Gopalan)\
**Post date:** [May 3, 2017, 12:30pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/8 "2017-05-03T12:30:15Z")

</div>

Hi Wei,

Well I had fixed the above issues but when i am trying to create the meeting using the createAMeeting() the error comes for the User not exist. The screenshot is attached below.

 ![](https://support.zoom.us/hc/user_images/y85nOWJ76J5rl65LQYhA4Q.png)

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 3, 2017, 6:49pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/9 "2017-05-03T18:49:02Z")

</div>

Hi Mahesh,

could you check the host ID you passed? You could get it from API function: user/getbyemail.

Best

Wei

---

<div class="post-metadata">

**Author:** ![Mahesh\_Gopalan](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mahesh\_Gopalan](https://devforum.zoom.us/u/Mahesh_Gopalan)\
**Post date:** [May 4, 2017, 9:18pm UTC](https://devforum.zoom.us/t/trouble-integrating-rest-api/214/10 "2017-05-04T21:18:15Z")

</div>

Hi Wei,

I am done with the REST API, It is working fine. Thanks for your support and if i get any issues again then I’ll get back to you.

Thanks

&nbsp;
