Data Types
The type and format properties in the Uber Ads API determine the data type of properties in JSON requests and responses. The type property indicates the JSON data type, while the format property provides additional information about the underlying type.
For example, large integers beyond JavaScript’s safe integer limit (2^53) are represented as strings in JSON to maintain precision. The type property will be “string” while the format property indicates the underlying numeric type.
Note: Client libraries may use language-specific types. For example, a date-time string in JSON becomes a Date object in JavaScript or DateTime in C#.
| Type | Format | Description | Example |
|---|---|---|---|
boolean |
JSON boolean value | true, false |
|
string |
Arbitrary text string | "Summer Campaign" |
|
string |
int64 |
A 64-bit signed integer represented as string | "9223372036854775807" |
string |
date |
RFC 3339 date | "2024-07-20" |
string |
date-time |
RFC 3339 timestamp in UTC | "2024-07-20T14:22:00Z" |
string |
currency-code |
ISO 4217 three-letter currency code | "USD", "EUR" |
string |
country-code |
ISO 3166-1 alpha-2 two-letter country code | "US", "CA" |
integer |
JSON number without fractional part | 100, 1500 |
|
string |
currency-amount |
Monetary amount multiplied by 100,000 | "1500000" (represents $15.00) |
number |
double |
Double-precision 64-bit IEEE 754 floating point | 85.5, 100.0 |
list |
A list of values | ["ITALIAN", "CHINESE"] |
|
object |
JSON object with key-value pairs | {"amount": "1500000", "currency": "USD"} |