Data Types and Response Formats

Data Types and Response Formats

The API has been designed with standards at its core. The following promises are kept throughout all endpoints:

  • With very few exceptions, numbers are numbers, and not strings. The API adheres strictly to the most natural representation of the underlying data, and null is always returned for optional properties which have not yet been assigned a value.
  • Geographic coordinates are formatted as [ longitude, latitude ], as per the GeoJSON standard.
  • Timestamps are consumed and produced in Unix epoch time format, with millisecond precision. You can get a sample timestamp in this format on a *nix machine by running the following command.
$ echo $(($(date +'%s * 1000 + %-N / 1000000')))
1455054888000
  • Most endpoints return the requested target resource, however, there are some exceptions, such as deleting a resource, which will simply respond with a 200 and no body. To the extent possible, the API is both resource-driven and oriented.
  • The API uses 24-character long encoded IDs which may contain URL-safe, non-alphanumeric characters, as in this sample Onfleet resource ID cBrUjKvQQgdRp~s1qvQNLpK*.
  • Phone numbers will always be returned in E.164 format, however, they may be provided in E.164 or a localized format that is valid based on your organization's country configuration. If you wish to provide numbers from countries other than your organization's, you must use E.164 only. We strongly recommend the use of libraries like libphonenumber for managing phone number validation and formatting.
  • All Onfleet traffic uses the same IP address for outbound traffic: 54.84.188.171. Whitelist this address for added security precautions.