Skip to content

Latest commit

 

History

History
89 lines (66 loc) · 1.85 KB

README.md

File metadata and controls

89 lines (66 loc) · 1.85 KB

mod_ginger_tagger

Ginger module for performing actions as a result of scanning RFID tags.

Features:

  • API for outside registering RFIDs and actions performed with RFIDs
  • admin web interface for administering RFIDs

Usage

API

You need to be authenticated with an OAuth2 client access token to perform API calls. See mod_oauth2 on how to obtain such a token.

Get user RFID

Get user that an RFID belongs to:

GET /rfids/{id} HTTP/1.1
Authorization: Bearer {Client OAuth2 token}

Add RFID to user

Attach a RFID to a user. This requires a user access token:

POST /me/rfids HTTP/1.1
Authorization: Bearer {User OAuth2 token}
Content-Type: application/json
Accept: application/json

{
    "rfids": [
        "AB123456",
        "XZ987654"
    ]
}

Report an RFID action

When an RFID tag has been scanned, report that action to the Tagger API. You can attach any file contents either as a base64-encoded string in a JSON body or as a multipart/form element.

As JSON body:

POST /tagger/actions
Authorization: Bearer {Client OAuth2 token}
Content-Type: application/json
Accept: application/json

{
    "rfids": [
        "ABC12345",
        "DEF78901"
    ],
    "attachment": "base64-encoded image contents"
}

You also override the default object by specifying its id or URI:

POST /tagger/actions
Authorization: Bearer {Client OAuth2 token}
Content-Type: application/json
Accept: application/json

{
    "rfids": [
        "ABC12345"
    ],
    "object_id": "http://yoursite.com/
}

Admin interface

All users that have ACL use rights on mod_admin_identity will see an RFID section in the admin’s person sidebar.