alt tag API Reference

Important: All Cloudant documentation has moved to the IBM Bluemix platform. You can find the new content here, and the API Reference topic in particular here.

Content on this page will no longer be updated (Jan 31st, 2017).

The Cloudant API reference is intended to be a comprehensive and living catalog of Cloudant’s capabilities. Contributions are welcome through Cloudant Labs on GitHub. The API reference content is built with Slate.

For the cURL samples

There are three ways you can supply the username and password data for a request.

  1. The -u $USERNAME parameter on its own causes cURL to ask you to enter your password interactively on the command line before performing the request. This option is used for the cURL examples in the Cloudant API reference.

  2. [Caution: This option is not secure] Entering the combination parameter -u $USERNAME:$PASSWORD as part of your command means that you are not asked to enter your password interactively. However, a plain text copy of your password appears in the terminal log.

    A variation of this method requires you to define a curl control file, containing the following details:
    --user "$USERNAME:$PASSWORD"
    --proto "=https"
    You can then define an ‘alias’ that enables the curl command to apply the control file, for example:
    alias acurl="curl -s --config <full_path_and_name_of_config_file> "
    Remember to exclude the control file from backups, as it contains the password in clear text.

  3. [Caution: This option is not secure] For an https cURL request, you can supply the username and password as part of the URL:
    ... https://$USERNAME:$PASSWORD@$ ...
    However, a plain text copy of your password appears in the terminal log.

An alternative approach is to use a hashed version of your username and password combination and supply that data in your cURL command. The Cloudant Blog article Authorized curl, a.k.a acurl explains how to create a more complexacurl command that makes use of this technique, enabling you to enter commands such as:
acurl https://$