Authentication
The Core API uses HTTP Basic Authentication with your name.com API credentials. You can either use cURL’s convenient-u shorthand or provide the explicit Authorization header.
Using
-u username:token is equivalent to sending Authorization: Basic <base64(username:token)>.Quick Example
Understanding Basic Authentication Examples
You may notice some examples show the explicitAuthorization: Basic <encoded-value> header. This is functionally identical to the simpler cURL shorthand:
-u flag tells curl to automatically create and Base64-encode your <username>:<API-token> string.
If you need to manually generate the required Base64 <encoded-value> for use in another tool (or to copy into examples):
- Combine your credentials:
<username>:<API-token>(e.g.,janedoe:tok_12345) - Encode the string using one of the following methods:
| Environment | Command to Generate Encoded Value | |
|---|---|---|
| Linux/macOS (Bash) | `echo -n ‘janedoe:tok_12345’ | base64` |
| Windows (PowerShell) | [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("janedoe:tok_12345")) |
Sandbox vs Production
Use your sandbox credentials for the development environment (https://api.dev.name.com) and production credentials for https://api.name.com.
If your account has 2FA enabled, enable API Access in Account Settings → Security. Always keep tokens secure and never commit them to source control.