Users generally interact with your app by installing the app on their mobile devices. What if other external applications want access to the functionality that the app provides? For example, a service might need product shipment information or product inventory levels from an inventory management app in order to perform back-office operations. AppSheet provides several ways to integrate your app with external web services or applications. In this module, we discuss how you can integrate your app with external applications and services using common integration techniques involving APIs and webhooks. One of the ways that AppSheet enables integration with external applications is via the AppSheet REST API. In this lesson, we discuss how you can use this API to integrate with the data sources used by your app. The AppSheet REST API enables an external application to access the data that is used by your lab sheet app. REST stands for Representational State Transfer and is an architectural style used for communication between client applications and web services using APIs. By invoking the AppSheet REST API, the external application can perform the following operations; add a row in a table, find or read a row from a table, update a row in a table, delete a row from a table, invoke a predefined action in the app. To enable the AppSheet REST API navigate to the manage integrations tab in the AppSheet UI. Expand the IN: From Cloud services to your app section. Click "Enable." You use the App ID shown here in the URL to the AppSheet REST API. If a valid application access key does not already exist, click "Create Application Access Key", save your changes to the app. An application access key is an EPA key that must be sent by the external application in every AppSheet API request. AppSheet verifies the key to make sure it is valid and not disabled before processing the API request. If the key passed in the API request does not match any of the valid API keys, the request is rejected and logged to the apps audit history. You can create more than one application access key for the app. This is useful when you want to distribute separate keys to different external applications to control the access to the app individually. After you enable the AppSheet REST API, external entities perform the following steps to invoke the API from the applications, you should also follow the steps to test that the API works as expected for your app. First, you construct a URL. The URL to the AppSheet API must have the following path components: AppId, this is the globally unique ID or GUID of the app. It is available in the manage integrations tab in the AppSheet UI. TableName, this is the table on which the API requests will execute. Next, construct the headers and body of the request that is sent to invoke the API. One of the HTTP headers is the application access key header, whose value is an API key, which you must replace with one of the valid keys that are available in the manage integrations tab in the AppSheet UI. Another header named Content-Type with the value of application/json is also required in the API request. In addition to the HTTP headers we just talked about, the API request also contains a POST request body in JSON format that contains the following attributes. Action is the name of the action to be performed and can be add, find, edit, delete, or the name of a data change action that has been predefined for the table. Properties is an optional JSON object that contains the locale, location, user email address, time zone, and user settings of the user making the request. Rows, contains a list of rows to be added, updated, deleted, or fetched from the table corresponding to the specified action. Each row contains the column name and value of the row being added or updated. Note that for all actions the rows, key, column and value must be included. You can omit the key column and value for the find action when the selector property is used, you can also omit it for the add action if the key column definition uses an initial value function or if other columns that define the key are provided, then send the HTTP POST request to the app sheet API endpoint at API.Appsheet.com. External applications would typically use a client SDK to make API calls to the AppSheet REST API. For testing purposes, you can use any REST Client such as Postman or call. Finally, processor response from the REST API. For a more detailed specification of the API requests, review the documentation on the AppSheet website. Let's now execute the steps to invoke the AppSheet REST API to retrieve information about a product from our sample application. The AppSheet REST API request has the following. The URL that contains the App ID and the name of the table from which data is required. The application access key header, the Content-Type header, the request body that specifies the find action and the table's key column and value corresponding to the row of data to be retrieved. Curl is a popular command line tool to create and test REST API curls. We use curl to invoke the AppSheet REST API. Here is the curl command with the API request and a partial response from the AppSheet REST API that contains the details of the product retrieved from the table. Let's add a new product category to our catalog using the AppSheet REST API. Here is the AppSheet REST API request URL that contains the App ID and the name of the table that will contain the new product category, the application access key and Content Type headers as before, the request body that specifies the add action, the locale and time zone properties, and the row data to be added to the table. Using the curl command as before, with this request generates a response from the AppSheet REST API as shown, the new holiday product category was added to the table via the AppSheet REST API and can now be managed in the app. The AppSheet REST API is a useful tool that makes it easy for you to programmatically manage data entities that are used in your app. For more details on using the API, read the documentation on the AppSheet website.