Sample-app-web-master

Tried to run index.html, and got
errorCode: 1,
errorMessage : “The account don’t enable API.”
method: “join”
result: null,
status: false

The host Open the meeting room already, and the meeting number is correct. please let me know what possible problem did cause the issue. Thanks!

Hi @mastercenter,

Does the account that has the API Key/Secret have has API enabled?

Hi Michael,

Here is API key/secret from My Meeting Settings

key:

Secret:

Here is index.js code. look like client did not catch the key and secret value.

(function(){ console.log(‘checkSystemRequirements’);

console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));

// it’s option if you want to chenge the jssdk dependency link resources.

// ZoomMtg.setZoomJSLib('https://dmogdx0jrul3u.cloudfront.net/1.3.7/lib', '/av'); 

// CDN version default 

// ZoomMtg.setZoomJSLib(‘http://localhost:9999/node_modules/zoomus-jssdk/dist/lib’, ‘/av’);

// Local version default

ZoomMtg.preLoadWasm();

ZoomMtg.prepareJssdk();    

var API_KEY = 'YOUR_API_KEY';

/**

 * NEVER PUT YOUR ACTUAL API SECRET IN CLIENT SIDE CODE, THIS IS JUST FOR QUICK PROTOTYPING

 * The below generateSignature should be done server side as not to expose your api secret in public

 * You can find an eaxmple in here: https:

//marketplace.zoom.us/docs/sdk/native-sdks/Web-Client-SDK/tutorial/generate-signature

 */ 

 var API_SECRET = 'YOUR_API_SECRET';   

 document.getElementById('join_meeting').addEventListener('click', function(e)

	{e.preventDefault();        

		if(!this.form.checkValidity())

			{  alert("Enter Name and Meeting Number");            

			return false; 

			}       

		 var meetConfig = { apiKey: API_KEY,   apiSecret: API_SECRET,	 meetingNumber:ParseInt(document.getElementById('meeting_number').value), userName: document.getElementById('display_name').value, passWord: "", leaveUrl: "https://zoom.us", role: 0 }; 

		 var signature = ZoomMtg.generateSignature(	{meetingNumber: meetConfig.meetingNumber, apiKey: meetConfig.apiKey, apiSecret: meetConfig.apiSecret,	role: meetConfig.role,	success: function(res)	{ console.log(res.result);	} }); 

		 ZoomMtg.init(	{leaveUrl: 'http://www.zoom.us', isSupportAV: true,Success: function () {ZoomMtg.join(   { meetingNumber: meetConfig.meetingNumber,	  userName: meetConfig.userName, signature: signature,	apiKey: meetConfig.apiKey,                      

						userEmail: 'mastercenter@163.com',                       

						 passWord: meetConfig.passWord,                       

				 		success: function(res)	{$('#nav-tool').hide();                           

						 console.log('join meeting success');

						},

                                     		error: function(res) 

                                            		{

console.log(res);

							}



					     });

                                   },

       

                                        error: function(res) 

                                            {

console.log(res);

}

                                  });



         });

})();

Please check it.

Thanks a lot!

Ling

Where can I check if the account that has the API Key/Secret have has API enabled?

Thanks!

You can see your JWT App within your marketplace settings: App Marketplace

-Tommy