Popular Help ContentNo popular content.
The examples below use cURL.
See Wikipedia for details of basic authentication.
curl -v -u [USERNAME]:[PASSWORD] '[URL]'
Api Key authentication
Your API Keys can be found at https://www.commcarehq.org/account/api_keys/
curl -H "Authorization: ApiKey [USERNAME]:[API_KEY]" '[URL]'
If you have two factor authentication (2FA) set up on your account, then basic authentication is not directly supported for accessing APIs. Instead, you must use Api Key authentication, as described above, or pass in a two factor token generated via SMS or your authenticator application via the "otp" url parameter. For example: https://www.commcarehq.org/a/<domain>/api/v0.5/case/?otp=123456