How to create a proper JSON format input?
Last edited: 2024/11/13
For object data inputs (most cases are within Prebid Adapters), you will need to use JSON (.json) format. This format may differ from what is outlined in the Prebid Documentation, so please ensure that you follow the guidelines in this document when constructing .json inputs.
Note: The Yieldbird Platform has a built-in data format validator, so if your input does not meet JSON file requirements, you will be notified.
Good Practice: If you encounter difficulty converting your data inputs to JSON format, our AI Assistant can help you - click on the bubble in the bottom right corner, provide your snippet and ask to convert it to JSON.
JSON Input Format Standards
- Keys must be enclosed in double quotes.
- String values must use double quotes.
- Array elements must also be in double quotes if they are strings. For Array of integers double quotes are not required.
Examples:
- Object A:
{"key1": "v1", "key2": ["v2","v3"]}
- ✔️ accepted{key1: "v1", key2: ["v2","v3"]}
- ❌ refused; keys are not enclosed in double quotes, which does not conform to JSON standards.- Object B:
{"site": "example.com"}
- ✔️ accepted{site: 'example.com'}
- ❌ refused; keys and string values must use double quotes, not single quotes, to meet JSON standards.- Array of strings:
["IAB1-1", "IAB1-2"]
- ✔️ accepted['IAB1-1', ‘IAB1-2']
- ❌ refused; JSON format requires double quotes for strings inside arrays.- Array of integers:
[1,2,3,4]
- ✔️ accepted