custom
The custom
type is a plain JSON object with user-defined fields and string values. They are returned unmodified on the
appropriate response object, and have no effect on optimization. The custom
field
exists on all top-level request objects, as well as many subobjects, such as route, job, and
geocode_request_address.
{
"user-defined-field-a": "value-a",
"another-custom-field": "a string value",
"externalId": "000784123"
}
Example
For example, sending the following evaluate request to RouteCloud:
{
"custom": {
"save_name": "Evaluate Example 24",
"last_modified": "2017-04-17T08:24:12.19"
},
"routes": [
{
"id": "route0_with_custom_fields",
"depot": {
"id": "depot0_with_custom_fields",
"location": "39.718005, -104.969531",
"custom": {
"backend_id": "D0005",
"last_modified": "2017-04-17T08:20:11.14",
"last_evaluated": "2017-04-17T08:20:11.19"
}
},
"custom": {
"backend_id": "R0024",
"last_modified": "2017-04-17T08:24:14.45",
"last_evaluated": "2017-04-17T08:24:12.18"
},
"jobs": [
{ "id": "job0", "location": "39.635928, -105.049219", custom: { "backend_id": "4563456" } },
{ "id": "job1", "location": "39.725375, -104.791080", custom: { "backend_id": "4563182" } },
{ "id": "job2", "location": "39.708990, -105.026954", custom: { } },
{ "id": "job3", "location": "39.653975, -105.093750" }
]
}
]
}
Yields the following response:
{
"routes": [{
"id": "route0_with_custom_fields", ...
"stops": [{
"id": "depot0_with_custom_fields", "type": "depot", ...
"custom": { "backend_id": "D0005", "last_modified": "2017-04-17T08:20:11.14", "last_evaluated": "2017-04-17T08:20:11.19" }
}, {
"id": "job0", "type": "job", ...
"custom": { "backend_id": "4563456" }
}, {
"id": "job1", "type": "job", ...
"custom": { "backend_id": "4563182" }
},
{
"id": "job2", "type": "job", ...
"custom": {}
},
{
"id": "job3", "type": "job", ...
},
{
"id": "depot0_with_custom_fields", "type": "depot", ...
"custom": { "backend_id": "D0005", "last_modified": "2017-04-17T08:20:11.14", "last_evaluated": "2017-04-17T08:20:11.19" }
}
],
"custom": { "backend_id": "R0024", "last_modified": "2017-04-17T08:24:14.45", "last_evaluated": "2017-04-17T08:24:12.18" }
}
],
"custom": { "save_name": "Evaluate Example 24", "last_modified": "2017-04-17T08:24:12.19" }
}
See Also
- On top level objects, as in the build.custom, evaluate.custom, and sequence.custom.
- On other objects, as in the route.custom, job.custom, and depot.custom fields.