[Music] Hello! Welcome to Getting Started with IBM Cloudant. After watching this video, you will be able to: Locate Cloudant sample starter applications. Locate your Cloudant database in the IBM Cloud dashboard. Access your database credentials. Describe how to use REST APIs to interact with Cloudant database. Describe how to locate database permissions. Run a Cloudant query, and interpret HTTP codes. The IBM Cloud Git Repository provides the following Cloudant sample starter applications: ​ ASP.NET Core Cloudant sample at https://github.com/IBM-Cloud/aspnet-core-cloudant​ Java Cloudant sample at https://github.com/IBM-Cloud/java-cloudant ​ and Node.js Cloudant sample at https://github.com/IBM-Cloud/nodejs-Cloudant​ To locate your Cloudant database, log into the IBM Cloud dashboard, view the Resource list, View all and locate your Cloudant instance. Select Launch Dashboard to view your databases. If you don't have Cloudant, you can quickly create a Cloudant database from the IBM Cloud catalog. When you create an application in IBM Cloud that uses the Cloudant database, or when you add the Cloudant service to an application, you’ll find your Cloudant database credentials such as the URL, host, port number, username, and Cloudant database password within the VCAP_SERVICES environment variable. You can parse this information into your application and extract the information that you need for a connection. Cloudant provides web-based HTTP RESTful API access to Cloudant data, which includes wrappers for various languages, such as Java and JavaScript. Every document in the database is accessible as JSON by using a URL. HTTP request methods include:​ GET: Request a specific JSON document ​ PUT: Create databases and documents ​ POST: Set values, and create documents ​ DELETE: Removes a specific document. To create a document, send a POST request to the URL visible onscreen with the document's JSON content in the request body. To update (or to create) a document, send a PUT request to the URL visible onscreen with the updated JSON content, including the latest _rev value in the request body. To delete a document, send a DELETE request to the URL visible onscreen where $REV is the document's latest _rev. You can perform all of these operations on the database, including Create, Update and Delete, using POST and PUT methods, with different parameters. The Cloudant sample database that is created by the boilerplate is named my_sample_db: https://$USERNAME.cloudant.com/my_sample_db/ You can get more information about the database by calling this REST API which is visible onscreen. Here, $USERNAME is the username of the Cloudant database that you saw in the IBM Cloud VCAP_SERVICES environment variables. The displayed image indicates all database permissions are enabled for the database creator. Before you get started, here’s an important tip about documents! All documents have the following unique mandatory fields, Unique _id and _rev. In addition to these two mandatory fields, documents can contain any other content that is expressed in the JSON format. Cloudant includes an index that is named _all_docs with which you can build a URL to list all the documents in the database. You can pass an optional parameter named include_docs to the index to return the contents of the documents, not only the _id and _rev. To change this parameter from the Cloudant Dashboard, click Options on the top toolbar then, select Include Docs. You can click the link in the Cloudant Dashboard to view the generated REST API for the page. From your application, you can access the document through REST APIs. To access a document with the Cloudant RESTful API, append the document ID to the URL of the database. This URL is accessed with a GET HTTP REST request. The _id is a unique key that is used when reading a document in the Cloudant database. You must have sufficient permissions to access the DB for your GET HTTP REST request to be successful. The sample document shown in this Cloudant Dashboard includes three fields: name, value, and _attachments. These three fields are in addition to the mandatory fields _id and _rev. Before you query for a specific field, issue a post request and selector to optimize query performance. Cloudant uses HTTP status codes that are returned in HTTP response headers. More information might also be included in the response body area for the message. The following examples adhere to the widely accepted HTTP status codes: 200 - OK 201 - Created 400 - Bad request 401 - Unauthorized 404 - Not Found The language-specific libraries often include error handling for these various cases. If you select a link to retrieve a document that does not exist in the database, Cloudant responds with status code 404 in the header. Additional information about the error is returned in the response as JSON. The language-specific libraries often include error handling for these statuses. In this video, you learned that: The IBM Cloud Git repository provides ASP.NET Core, Java, and Node.js Cloudant starter sample applications. The VCAP_SERVICES environment variable contains your Cloudant database credentials including the URL, host, port number, username, and database password Cloudant enables web-based HTTP REST API data access, which includes wrappers for various languages, such as Java and JavaScript and every database document is accessible as JSON by using a URL.