Flags
Flags denote options that should be applied to the entire request.
Both POST and PATCH requests to the Wunderite API support flags.
Available flags are defined for each endpoint.
Specifying flags in a request
To specify a flag in a request, you can either provide a query parameter with the flag name and value, or you can include it in the JSON request body.
Via query parameter:
?flags[flag_name]=flag_value&flags[another_flag]=1
Via JSON request body:
{
"flags": {
"flag_name": "flag_value",
"another_flag": true
},
"data": [...]
}
Example
In this example, we want to fill VIN data in for vehicles as we create them. The POST and PATCH requests to the Vehicles endpoint support the vin_data
flag.
Via query parameter:
curl -X POST https://app.wunderite.com/api/v1/risks/{risk}/data/vehicles?flags[vin_data][fill]=1&flags[vin_data][overwrite]=1&flags[vin_data][only][]=make&flags[vin_data][only][]=model \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d {"data": [...]}
Via JSON request body:
curl -X POST https://app.wunderite.com/api/v1/risks/{risk}/data/vehicles \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"flags": {"vin_data": {"fill": true, "overwrite": true, "only": ["make", "model"]}},
"data": [...]
}'