So far, we have learned how to write client-side JavaScript controllers and helpers. In this section, we will learn how to wire client-side calls to the server-side Apex. Apex is an object-oriented programming language similar to Java. Apex allows you to write database logic and queries such as stored procedures. This section assumes that the reader is familiar with Salesforce Apex programming.
In your Salesforce org, whitelist Google APIs via Remote Site Settings for the following application so that your org can reach out to the YouTube API. The navigation path is Setup| Security | Remote Site Settings.Â
The following screenshot shows the Remote Site Settings:
The code to search YouTube results from the YouTube REST API follows here. The instructions for registering the API key can be obtained here:Â ...