API Placeholders
When users learn how to use our API, they might copy the code and try to use it as given.
In the API examples you provide, use variables for usernames, passwords, email addresses, API keys, and so on.
Format the placeholder variables as
camelCase
and enclose them in curly braces ({ }
).API requests: Enclose in a language-appropriate
code-block
directive. Use.. code-block:: console
directive forcurl
examples.API responses: Enclose in a
.. code-block:: json
directive.Add the
:linenos:
option to the.. code-block::
directive if the example is longer than 10 lines.Add the
:copyable: false
option the.. code-block:: json
directive in the response. The user shouldn't try to copy the response.
Best Practices for Placeholders
Information | Use | Don't use |
---|---|---|
Username |
| robb4554 |
Password |
| J$12345* |
Public API Key |
| gzungyzc |
Private API key |
| ac930128-c6dd-ae41-fe44-d985d008e703 |
Project |
| 0e18fec1d223b72f626d23f1 |
Organization |
| 6c2c15110ceb948cf4b8f38c |
Best Practices for Simulated Placeholder Values
In example API operation requests and responses, in which we want users to see actual values from the system, use "real-looking" but imaginary values, use the following formats:
Parameter | Value Format | Value Template | Example |
---|---|---|---|
Public API Key | 8 lowercase ASCII-alphabetic characters | XXXXXXXX | gzungyzc |
Private API key | 16 lowercase hexdecimal digits formatted as 4-2-2-6 (32 characters) | a1a1a1a1-a1a1-a1a1-a1a1-a1a1a1a1a1a1 | ac930128-c6dd-ae41-fe44-d985d008e703 |
Project | 12 lowercase hexdecimal digits (24 characters) | a1a1a1a1a1a1a1a1a1a1a1a1 | 0e18fec1d223b72f626d23f1 |
Organization | 12 lowercase hexdecimal digits (24 characters) | a1a1a1a1a1a1a1a1a1a1a1a1 | 6c2c15110ceb948cf4b8f38c |
Tip
Use a random number generator to create the placeholders. One example would be the Generate Random Hex tool.
Warning
Never include or show actual writer or user account credentials in code examples or screenshots.