Skip to content

Commit 87c843a

Browse files
docs: Add guidance on handling demo redacted values in API responses
- Documented how demo/free-tier keys lead to masked or redacted values in API responses and detailed the replacement behavior for such values. - Added examples of fields with replacement logic and default values: - Boolean fields replaced with `True` or specific defaults. - Integer fields replaced with `0`. - File IDs replaced with placeholder UUIDs for consistency. - Included a logging configuration example for tracking redacted value replacements in Python applications. Assisted-by: Codex
1 parent 90ef0bb commit 87c843a

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/getting-started.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,39 @@ For the official Cloud onboarding flow, see:
6666
interactively and generating starter code samples before integrating them
6767
into your project.
6868

69+
### Demo keys and redacted values
70+
71+
If you are using a demo/free-tier key, some API responses may include redacted
72+
values (for example `fa***`, `tr**`, masked strings, or placeholder IDs).
73+
74+
To keep response models parseable, the SDK replaces certain known demo-redacted
75+
values in a few response fields:
76+
77+
- `PdfRestInfoResponse` boolean fields:
78+
`tagged`, `image_only`, `contains_annotations`, `contains_signature`,
79+
`restrict_permissions_set`, `contains_xfa`, `contains_acroforms`,
80+
`contains_javascript`, `contains_transparency`, `contains_embedded_file`,
81+
`uses_embedded_fonts`, `uses_nonembedded_fonts`, `pdfa`, `pdfua_claim`,
82+
`pdfe_claim`, `pdfx_claim`, `requires_password_to_open`
83+
- `PdfRestInfoResponse.file_size` -> replaced with `0` when redacted
84+
- `PdfRestInfoResponse.all_queries_processed` -> replaced with `True` when redacted
85+
- unzip response file IDs are sanitized before file-info lookup, so
86+
`PdfRestFileBasedResponse.output_file.id` may be the null UUID
87+
`00000000-0000-4000-8000-000000000000` when demo IDs are redacted
88+
89+
When a replacement happens, the SDK logs a warning in this format:
90+
91+
`Demo value <val> detected in <field-name>; replaced with <replacement>`
92+
93+
To see these warnings in your app, configure Python logging (example):
94+
95+
```python
96+
import logging
97+
98+
logging.basicConfig(level=logging.WARNING)
99+
logging.getLogger("pdfrest.models").setLevel(logging.WARNING)
100+
```
101+
69102
## 3. Add a short example program
70103

71104
Create `quickstart.py`:

0 commit comments

Comments
 (0)