API

Types

From GoGrid



Contents

The GoGrid API uses the following basic and complex types:

Basic Types

boolean

A boolean can be either true or false.

int

An int is a 32 bit basic integral type. Examples are -100, 0, and 15.

float

A float is a 32 bit basic decimal type. Examples are -1.234 and 765.3.

double

A double is a 64 bit decimal type. Examples are -23423424.54334234 and 7324234123245.334.

long

A long is a 64 bit integral type. Examples are -13243255435420, 0, 6445152343234.

string

A string represents text or a character array. Examples are foo, and This is a string.\n.

datetime

A datetime is a type that represents both date and time. The datetime format is YYYY-MM-DD hh:mm:ss.s TZD where:

  • YYYY = four-digit year
  • MM = two-digit month (01=January, etc.)
  • DD = two-digit day of month (01 through 31)
  • hh = two digits of hour (00 through 23) (am/pm NOT allowed)
  • mm = two digits of minute (00 through 59)
  • ss = two digits of second (00 through 59)
  • s = one or more digits representing a decimal fraction of a second
  • TZD = time zone designator (Z or +hh:mm or -hh:mm)

An example is 2008-03-12 14:34:23.234 +05:00.

datetime inputs

For datetime inputs as API query parameter inputs, GoGrid tries to make sense of your input.

We accept the following date time formats:

  • YYYY-MM-DD hh:mm:ss.s TZD such as 2008-03-12 14:34:23.234 +05:00
  • YYYY-MM-DD such as 2008-03-12. Time is defaulted to 00:00:00.0.
  • MM/DD/YYYY such as 11/30/2008. Time is defaulted to 00:00:00.0.
  • MM/DD/YY such as 11/30/08. Time is defaulted to 00:00:00.0.
  • MM/DD/YY such as 11/30/08. Time is defaulted to 00:00:00.0.

We also accept a long representing the milliseconds since the UNIX Epoch, January 1, 1970 00:00:00 GMT.

Finally, we also accept the string now which represents the system current time.

Complex Types

list

A list is a data structure that is an array/collection of basic or complex types.

map

A map is a data structure that is a an associative array/hashtable of basic or complex types. This data structure is comprised of key/value pairs.

object

Similar to a map, but objects have defined attributes. An object is comprised of key/value pairs that describe it. Every object has a type name which identifies the object. For instance the Server contains the attributes id and name.

To see a list of objects in the system, see Objects.

option

A option is special object that represents an option in the system and is composed of an id, name, and description. For more information see Option.


Personal tools