Vehicle - Group Constraints

The Admin interface handles web service calls from the Admin web gui. The base url for this is at:

/api/vehicle-admin

A JSON file with OpenAPI data about all vehicle-related admin APIs can be downloaded here.

The interface handles constraints on vehicle group for new reservation creation.

Get Group Constraint Definitions

Gets the list of the defined group constraints.

GET /v1/constraints/groups/definitions

Returns the list of all constraint definition

Status Codes

It returns a Json positive response with the list of the defined group constraints:

{
  [
    {
      ID: 1,
      CreatedDate: "2020-01-01T08:00:00Z",          // Date
      LastUpdated: "2020-01-01T08:00:00Z",          // Date
      LastUpdatedBy: "UserName",                    // String (nullable)
      Key: "constraint-key",                        // String
      Type: 0,                                      // Int
      Labels: "{"en":"English label","it":"..."}",  // String
      ValidValues: "[array of valid values]"        // String (nullable)
    },
    ...
  ]
}

The Key field can be one of the value described in Vehicle Group Constraints.

The Type field can be one of the values specified into the AdditionalValueTypes enumeration.

The Labels field is a stringified Json containing pairs “language code”:”localized value”.

The ValidValues fields can assume a different form depending on the ValueType value.

Get Group Constraint Definition Paged List

Gets the list of the defined group constraints (it’s a Paged List APIs, as explained in the introduction):

GET /v1/constraints/groups/definitions/list

Returns the paginated list of all constraint definition

Status Codes

It returns a Json positive response with the list of the defined group constraints:

{
  [
    {
      ID: 1,
      CreatedDate: "2020-01-01T08:00:00Z",          // Date
      LastUpdated: "2020-01-01T08:00:00Z",          // Date
      LastUpdatedBy: "UserName",                    // String (nullable)
      Key: "constraint-key",                        // String
      Type: 0,                                      // Int
      Labels: "{"en":"English label","it":"..."}",  // String
      ValidValues: "[array of valid values]"        // String (nullable)
    },
    ...
  ]
}

The Key field can be one of the value described in Vehicle Group Constraints.

The Type field can be one of the values specified into the AdditionalValueTypes enumeration.

The Labels field is a stringified Json containing pairs “language code”:”localized value”.

The ValidValues fields can assume a different form depending on the ValueType value.

Get One Group Constraint Definition

Get the data about a specified group constraint definition

GET /v1/constraints/groups/definitions/{id}

Returns a specified constraint definition

Parameters
  • id (integer) –

Status Codes

It returns a Json positive response with the constraint definition data:

{
  ID: 1,
  CreatedDate: "2020-01-01T08:00:00Z",          // Date
  LastUpdated: "2020-01-01T08:00:00Z",          // Date
  LastUpdatedBy: "UserName",                    // String (nullable)
  Key: "constraint-key",                        // String
  Type: 0,                                      // Int
  Labels: "{"en":"English label","it":"..."}",  // String
  ValidValues: "[array of valid values]"        // String (nullable)
}

The Key field can be one of the value described in Vehicle Group Constraints.

The Type field can be one of the values specified into the AdditionalValueTypes enumeration.

The Labels field is a stringified Json containing pairs “language code”:”localized value”.

The ValidValues fields can assume a different form depending on the ValueType value.

Edit Existing Group Constraint Definition

Persist edit about an existing group constraint definition

POST /v1/constraints/groups/definition

Persist edit about an existing group constraint definition

Status Codes

The body of the request is:

{
  ID: 1,                                              // Int
  Labels: "{"en":"English name",...}"                 // String
}

The Labels field is must be a stringified Json containing pairs “language code”:”localized value”.

Possible error messages are:

err_InvalidElement

No ID was provided, no filter was found for the provided ID or an empty Labels field was provided

Get Group Constraints

Gets the list of the valorized constraints for a specified group (it’s a Paged List APIs, as explained in the introduction):

GET /v1/constraints/groups/{guid}/list

Return list of group constraints for the given group

Parameters
  • guid (string) – The group Guid

Status Codes
guid: Parent group Guid

It returns a Json positive response with the list of the constraints valorized for the group, and their values:

{
  [
    {
      ID: 1,
      Key: "constraint-key",                        // String
      Type: 0,                                      // Int
      Labels: "{"en":"English label","it":"..."}",  // String
      ValidValues: "[array of valid values]"        // String (nullable)
      Value: "5"                                    // String
    },
    ...
  ]
}

The Key field can be one of the value described in Vehicle Group Constraints.

The Type field can be one of the values specified into the AdditionalValueTypes enumeration.

The Labels field is a stringified Json containing pairs “language code”:”localized value”.

The ValidValues fields can assume a different form depending on the ValueType value.

Add or Edit Existing Group Constraint

Persist the value of a specified constraint for a specified group

POST /v1/constraints/groups/{guid}

Persists edits about a new or existing group constraint

Parameters
  • guid (string) – The group Guid

Status Codes
guid: Parent group Guid

The body of the request is:

{
  ID: 1                              // Int
  Key: "constraint definition key",  // String
  Value: "constraint value"          // String
}

Possible errors are:

err_InvalidElement

No constraint to edit has been found for the specified ID, or no Key has been provided

err_NoConstraintDefinitionFound

No constraint definition has been found for the provided Key

err_NoGroupFound

No group has been found for the provided guid