Skip to content

Assignments

Info

Entity, represented by an assignment ID, who is considered to give a specific user access to a specific car for a defined time range.

Get assignment

GET /assignments/{assignmentId}

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.
assignmentId integer path Required The database ID of the assignment.

Response

200 OK

{
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "format": "int32"
    },
    "carId": {
      "type": "number",
      "format": "int32"
    },
    "userId": {
      "type": [
        "number",
        "null"
      ],
      "format": "int32"
    },
    "start": {
      "type": "string",
      "format": "date-time"
    },
    "end": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lifetime": {
      "type": [
        "number",
        "null"
      ],
      "format": "int32"
    },
    "renewableAfter": {
      "type": [
        "number",
        "null"
      ],
      "format": "int32"
    } 
  } 
}

Response

401 UNAUTHORIZED

  Access denied due to invalid subscription key. 
  Make sure to provide a valid key for an active subscription.
{
  "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 assignment for the given assignmentId.

Response

500 INTERNAL SERVER ERROR

Internal server error.

Get assignments of car

GET /cars/{carId}/assignments

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.
carId integer path Required The database ID of the car.

Response

200 OK

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "number",
        "format": "int32"
      },
      "userId": {
        "type": [
          "number",
          "null"
        ],
        "format": "int32"
      },
      "start": {
        "type": "string",
        "format": "date-time"
      },
      "end": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time"
      }
    }   
  }
}

Response

404 NOT FOUND

Unable to find a manager for the given OAuth ID claim data.
Unable to find an assignment for the given assignmentId.

Response

500 INTERNAL SERVER ERROR

Internal server error.

Get assignments of user

GET /users/{userId}/assignments

The returned data can be manipulated using OData.

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.
userId integer path Required The database ID of the user.

Response

200 OK

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "number",
        "format": "int32"
      },
      "carId": {
        "type": [
          "number",
          "null"
        ],
        "format": "int32"
      },
      "start": {
        "type": "string",
        "format": "date-time"
      },
      "end": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time"
      }
    }   
  }
}

Response

401 UNAUTHORIZED

Access denied due to invalid subscription key. 
Make sure to provide a valid key for an active subscription.
{
  "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 a user for the given userId which is assigned to the given customerId.

Response

500 INTERNAL SERVER ERROR

Internal server error

Create assignment

PUT /assignments

Info

Assignments are set asynchronously. You will receive the response of the operation via webhook.

Info

The format of start and end is: yyyy-MM-ddTHH:mm:ssZ

Info

The structure of lifetime and renewableAfter is: renewableAfter < lifetime lifetime > 604800 (7 days) lifetime < 2419200 (28 days)

Info

The default values of lifetime is 604800 (7 days) and of renewableAfter is half of lifetime

Info

You could create an unrestricted assignment. If you want to do this set the value of end to null.

Info

This API endpoint supports webhooks. More detailed information could be found here.

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": {
    "carId": {
      "type": "number",
      "format": "int32"
    },
    "userId": {
      "type": "number",
      "format": "int32"
    },
    "start": {
      "type": "string",
      "format": "date-time"
    },
    "end": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
      "lifetime": {
        "type": [
          "number",
          "null"
        ],
        "format": "int32"
      },
      "renewableAfter": {
        "type": [
          "number",
          "null"
        ],
        "format": "int32"
      } 
  }
}

Response

204 NO CONTENT

Response

401 UNAUTHORIZED

Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
{
  "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

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

Update assignment

PATCH /assignments/{assignmentId}

Info

Assignments are updated asynchronously. You will receive the response of the operation via webhook.

Info

The format of start and end is: yyyy-MM-ddTHH:mm:ssZ

Info

The structure of lifetime and renewableAfter is: renewableAfter < lifetime lifetime > 604800 (7 days) lifetime < 2419200 (28 days)

Info

The default values of lifetime is 604800 (7 days) and of renewableAfter is half of lifetime

Info

You could create an unrestricted assignment. If you want to do this set the value of end to null.

Info

This API endpoint supports webhooks. More detailed information could be found here.

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
assignmentId integer path Required The database ID of the assignment.

Request Body

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "op": {   
        "type": "string",
        "enum": [
          "remove",
          "replace"
        ]
      },
      "path": {
        "type": "string",
        "enum": [
          "/carId",
          "/userId",
          "/start",
          "/end",
          "/lifetime",
          "/renewableAfter"
        ]
      },
      "value": {
        "type": [
          "string",
          "null"
        ]
      }
    }
  }
}

Response

204 NO CONTENT

Response

401 UNATHORIZED

Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
{
  "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

Delete assignment

DELETE /assignments/{assignmentId}

Info

Assignments are updated asynchronously. You will receive the response of the operation via webhook.

Info

This API endpoint supports webhooks. More detailed information could be found here.

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.
assignmentId integer path Required The database ID of the assignment.

Response

204 NO CONTENT

Response

401 UNATHORIZED

Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
{
  "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