Skip to main content

RFID authorization

Description#

This endpoint is used to ask to your system if the given RFID card is valid. Depending on the type value the request might be a simple request for authorization (type = "authorize") or a notification that a charge has been started using this RFID as well (type = "start").

But why is that?#

There are two main reason that led us to do so:

  1. When we receive an RFID authorization request from a chargebox, we don't know yet if the chargebox wants to start or stop a charge, so we just check if the RFID is in our database. This is the case when we'll send a type = "authorize" request.
  2. When a chargebox tells us that it has started a charge using the given RFID, we might want to make further considerations (like checking if there is enough budget on the RFID or something else). This is the case when we'll send a type = "start" request. After this request has been accepted we will send you a start charge notification too.
caution

Thor can work in three ways:

  1. Thor check first if the RFID card is in its database, then it'll send an authorization request to your application.
  2. Thor check only if the RFID card is in its database.
  3. Thor check only the authorization from your application.

In the API configurazione panel you can choose the working mode:

  1. You have to configure the RFID API and choose in control panel the double check (Thor & your application)
  2. If you don't insert the datas of API in RFID fields
    1. You have to configure the RFID API and choose in control panel the single check (only your application)

If the RFID card is in Thor's database but it was created by another service provider, Thor will reject the request.

Request format#

Method: POST

Body format: JSON

KeyTypeDescription
msgStringSpecifies that this message is rfid authorization request. For this request it will be always equal to "rfid".
idStringThe RFID identifier.
chargeboxStringThe chargebox identifier.
typeAuthorization typeThe purpose of the authorization request.

Request schema:

{
"$schema": "http://json-schema.org/draft-07/schema",
"id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"msg": "rfid",
"id": "1921398740",
"chargebox": "EaJ7cU9NJ3YkTNgy",
"type": "authorize"
},
{
"msg": "rfid",
"id": "7823091235",
"chargebox": "XPHiIU27EFMViHat",
"type": "start"
}
],
"required": [
"msg",
"id",
"chargebox",
"type"
],
"properties": {
"msg": {
"$id": "http://example.com/properties/msg",
"type": "string",
"enum":[
"rfid"
],
"title": "The msg schema",
"description": "Specifies that this message is a rfid authorization request.",
"default": "",
"examples": [
"rfid"
]
},
"id": {
"id": "http://example.com/properties/id",
"type": "string",
"title": "The id schema",
"description": "The RFID identifier.",
"default": "",
"examples": [
"1921398740",
"7823091235"
]
},
"chargebox": {
"id": "http://example.com/properties/chargebox",
"type": "string",
"title": "The chargebox schema",
"description": "The chargebox identifier.",
"default": "",
"examples": [
"EaJ7cU9NJ3YkTNgy",
"XPHiIU27EFMViHat"
]
},
"type": {
"id": "http://example.com/properties/type",
"type": "string",
"enum": [
"authorize",
"start"
],
"title": "The type schema",
"description": "The purpose of the authorization request.",
"default": "",
"examples": [
"start",
"authorize"
]
}
},
"additionalProperties": true
}

Expected response#

A 200 - OK HTTP status code will be intended as an authorized RFID, any other status code will invalidate the authorization.

Enums#

Authorization type#

Type: String

These are the possible types of the charge type:

  • authorize sent when the chargebox notifies a new RFID card. We don't know yet if the chargebox is going to start a new charge or stop a currently active one.
  • start sent when the chargebox has started a local charge.