|Important: All Cloudant documentation has moved to the IBM Bluemix platform.
You can find the new content
and the API Reference topic in particular
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.
-u $ACCOUNTparameter 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.
[Caution: This option is not secure] Entering the combination parameter
-u $ACCOUNT:$PASSWORDas 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:
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.
[Caution: This option is not secure] For an
httpscURL request, you can supply the username and password as part of the URL:
... https://<account>.cloudant.com ...
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 complex
acurl command that makes use of this technique,
enabling you to enter commands such as: