# Account does not enabled REST APi server-to-server app

**URL:** <https://devforum.zoom.us/t/account-does-not-enabled-rest-api-server-to-server-app/99134>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [November 28, 2023, 7:06am UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api-server-to-server-app/99134 "2023-11-28T07:06:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/marc5/32/54299_2.png) [@marc5](https://devforum.zoom.us/u/marc5)\
**Post date:** [November 28, 2023, 7:06am UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api-server-to-server-app/99134/1 "2023-11-28T07:06:03Z")

</div>

Hello while am working to integrate the new server-to-server app because the JWT is not working anymore i am having a response when am calling the API error code : 200 error code - Account does not enable rest API, I am getting the access token successfully, call the API when we get the user, by that time I am facing this issue, could you please advise if I am missing any parameter  
i have set all key and accound correctly  
public function getToken(){  
$url = ‘[https://zoom.us/oauth/token](https://zoom.us/oauth/token)’;  
$api\_key = ‘’;  
$api\_secret = ‘’;

```
	$data = array(
		'grant_type' => 'client_credentials',
		 'account_id'=>''
	);

	$headers = array(
		'Authorization: Basic ' . base64_encode($api_key . ':' . $api_secret),
	);

	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

	$response = curl_exec($ch);
	curl_close($ch);

	$token_data = json_decode($response, true);
	$token =$token_data['access_token'];
	return $token;
	//print_r($token_data);
	/* $payload = array();
	$secret = 'redacted';
	$payload['iss'] = 'AP7n1CtHRA67f2Vvn2ZApQ';
	$payload['exp'] = strtotime('+1 minute');
	return $token = \Firebase\JWT\JWT::encode($payload, $secret, 'HS256'); */
}

```

function getUser($user){

```
		$token = $this->getToken();

		$body = array();
		$curl = curl_init();
		
		curl_setopt_array($curl, array(
		CURLOPT_URL => "https://api.zoom.us/v2/users/".$user['email'],
		CURLOPT_RETURNTRANSFER => true,
		CURLOPT_ENCODING => "",
		CURLOPT_MAXREDIRS => 10,
		CURLOPT_TIMEOUT => 30,
	    CURLOPT_SSL_VERIFYPEER => 0,
		CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		CURLOPT_CUSTOMREQUEST => "GET",
		CURLOPT_POSTFIELDS => json_encode($body),
		CURLOPT_HTTPHEADER => array("Authorization: Bearer $token"),
		));

	$response = curl_exec($curl);
	//Check for any errors
	$errorMessage = curl_exec($curl);
	//echo $errorMessage;
	curl_close($curl);
	if(!$response){
		return false;
	}
	$arrdata= json_decode($response, true);
	return $arrdata;
}

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [November 28, 2023, 5:04pm UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api-server-to-server-app/99134/2 "2023-11-28T17:04:02Z")

</div>

Hi @marc5 ,

There are several threads on this with tagged solutions. Please use the search feature 🙂

This one may be helpful"

> [@Server2Server OAuth returning {'code': 200, 'message': 'Account does not enabled REST API.'}](https://devforum.zoom.us/t/server2server-oauth-returning-code-200-message-account-does-not-enabled-rest-api/95519/6):
>
> Hello i find the solution with PHP and curl, and Server-to-Server OAuth: I published the code on github $accountID = 'xxxxxxxxxxxx'; $clientId = 'xxxxxxxxxxxxx'; $clientSecret = 'xxxxxxxxxxxxxxx'; $authHeader = base64\_encode($clientId . ':' . $clientSecret); $url = 'https://zoom.us/oauth/token'; $data = ['grant\_type' =\> 'account\_credentials', 'account\_id' =\> $accountID,]; $ch = curl\_init($url); curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, true); curl\_setopt($ch, CURLOPT\_POST, true); …

I also recommend retrieving your access token via Postman and seeing if it allows you to query the API endpoint. If successful, it can help isolate the error in your code.: [Postman](https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/request/22097587-875f65b4-d88f-4082-80af-7605303a5abc)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 30, 2023, 2:42am UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api-server-to-server-app/99134/4 "2023-11-30T02:42:44Z")

</div>

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