Data Types

1. Instants

FusionAuth stores all time references as the number of milliseconds since January 1st, 1970 UTC, this is more generally referred to as Epoch time.

For example, consider the following date.

10:45 AM MST on July 4th, 2015

In order to send this value to FusionAuth, you would need to convert this date time to the number of milliseconds since epoch and then send the value 1436028300000 as an input parameter. For additional detail on obtaining time in milliseconds in different programming languages see https://currentmillis.com.

2. Locales

FusionAuth accepts and returns Locales on the API using the Java standard format of a ISO 639-1 two letter language code followed by an optional underscore and a ISO 3166-1 alpha-2 country code. Below is a table of common language and country codes and the resulting locale string that can either be sent into an API or be expected on the API response. This is not an exhaustive list but only provided as an example.

Locale Codes

Language Country Locale

Arabic

ar

Danish

da

German

de

English

en

Spanish

es

Spanish

Mexico

es_MX

Finish

fi

French

fr

Italian

it

Japanese

ja

Korean

ko

Dutch

nl

Norwegian

no

Polish

pl

Portuguese

pt

Russian

ru

Swedish

sv

Chinese

Taiwan

zh_TW

Chinese

China

zh_CN

3. UUIDs

Data types specified as UUID are expected to be in a valid string representation of a universally unique identifier (UUID). The API specifically expects the UUID to be provided in its canonical form which is represented by 32 lowercase hexadecimal digits displayed in five groups separated by hyphens.

This representation takes the form of 8-4-4-4-12 for a total of 36 characters, 32 hexadecimal characters and four hyphens. In case you are converting an array of bytes, the break down of bytes for the hexadecimal String is 4-2-2-2-6.

Example of a UUID in the expected canonical string format in a JSON request or response body.

{
  "foo": {
    "id": "965865ef-b17d-4153-b952-d8902e584f7d"
  }
}

Example of a UUID being provided as a URL segment for an API.

/api/user/965865ef-b17d-4153-b952-d8902e584f7d