Skip to content

Events

Info

Please find the event definition here.

Get events of a car

GET /cars/{carId}/events

Tip

The returned data can be manipulated using OData.

Warning

The returned data should always be limited using OData, e.g. $skip=10&$top=5.

Request parameters
Name Type Location Description
flinkey-API-Key string header Required. API key which provides access to this API.
Authorization string header Required. The bearer token.
Customer-ID integer header Required. The database ID of the customer.
carId integer path Required. The database ID of a car.
Response
200 OK
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "integer",
        "format": "int32"
      },
      "dateTime": {
        "type": "string",
        "format": "date-time"
      },
      "utcDateTime": {
        "type": "string",
        "format": "date-time"
      },
      "userId": {
        "type": "integer",
        "format": "int32"
      },
      "carId": {
        "type": "integer",
        "format": "int32"
      },
      "type": {
        "type": "string",
        "enum": [
          "CarOpened",
          "CarClosed"
        ]
      },
      "userAgent": {
        "type": "string"
      },
      "latitude": {
        "type": [
          "number",
          "null"
        ],
        "format": "double"
      },
      "longitude": {
        "type": [
          "number",
          "null"
        ],
        "format": "double"
      }
    }
  }
}
Response
401 UNAUTHORIZED

{
  "statusCode": 401,
  "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
{
  "statusCode": 401,
  "message": "Unauthorized. Access token is missing or invalid."
}
Response
404 NOT FOUND
Unable to find a manager for the given OAuth ID claim data.
Response
500 INTERNAL SERVER ERROR
Internal server error.

Get event

GET /events/{eventId}

Tip

The returned data can be manipulated using OData.

Request parameters
Name Type Location Description
flinkey-API-Key string header Required. API key which provides access to this API.
Authorization string header Required. The bearer token.
Customer-ID integer header Required. The database ID of the customer.
eventId integer path Required. The database ID of the event.
Response
200 OK
{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int32"
    },
    "dateTime": {
      "type": "string",
      "format": "date-time"
    },
    "utcDateTime": {
      "type": "string",
      "format": "date-time"
    },
    "userId": {
      "type": "integer",
      "format": "int32"
    },
    "carId": {
      "type": "integer",
      "format": "int32"
    },
    "type": {
      "type": "string",
      "enum": [
        "CarOpened",
        "CarClosed"
      ]
    },
    "userAgent": {
      "type": "string"
    },
    "latitude": {
      "type": [
        "integer",
        "null"
      ],
      "format": "double"
    },
    "longitude": {
      "type": [
        "integer",
        "null"
      ],
      "format": "double"
    }
  }
}
Response
401 UNAUTHORIZED

{
  "statusCode": 401,
  "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
{
  "statusCode": 401,
  "message": "Unauthorized. Access token is missing or invalid."
}
Response
404 NOT FOUND
Unable to find a manager for the given OAuth ID claim data.
Unable to find an event for the given eventId which is assigned to the given customerId.
Response
500 INTERNAL SERVER ERROR
Internal server error.

Create event

PUT /events
Request parameters
Name Type Location Description
flinkey-API-Key string header Required. API key which provides access to this API.
Authorization string header Required. The bearer token.
Customer-ID integer header Required. The database ID of the customer.
Content-Type string header Required. The content type of the request. Value: application/json
Request body
{
  "type": "object",
  "properties": {
    "dateTime": {
      "type": "string",
      "format": "date-time"
    },
    "utcDateTime": {
      "type": "string",
      "format": "date-time"
    },
    "userId": {
      "type": "integer",
      "format": "int32"
    },
    "carId": {
      "type": "integer",
      "format": "int32"
    },
    "type": {
      "type": "string",
      "enum": [
        "CarOpened",
        "CarClosed"
      ],
      "default": "CarOpened"
    },
    "userAgent": {
      "type": "string"
    },
    "latitude": {
      "type": [
        "integer",
        "null"
      ],
      "format": "double"
    },
    "longitude": {
      "type": [
        "integer",
        "null"
      ],
      "format": "double"
    }
  },
  "required": [
    "dateTime",
    "utcDateTime",
    "userId",
    "carId",
    "type",
    "userAgent"
  ]
}
Response
201 CREATED
{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int32"
    }
  }
}
Response
400 BAD REQUEST
Couldn't create event. No valid type provided.
Couldn't create event. No valid dateTime provided.
Couldn't create event. No valid utcDateTime provided.
Couldn't create event. No valid userAgent provided.
Response
401 UNAUTHORIZED

{
  "statusCode": 401,
  "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
{
  "statusCode": 401,
  "message": "Unauthorized. Access token is missing or invalid."
}
Response
404 NOT FOUND
Unable to find a manager for the given OAuth ID claim data.
Couldn't create event. Unable to find a car for the given carId which is assigned to the given customerId.
Couldn't create event. Unable to find an user for the given userId which is assigned to the given customerId.
Response
415 UNSUPPORTED MEDIA TYPE
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.13",
  "title": "Unsupported Media Type",
  "status": "415",
  "traceId": "<traceId>"
}
Response
500 INTERNAL SERVER ERROR
Internal server error.