The app now supports a wide variety of tags and record types. The data field in the POST payload will reflect the content of these records:
Type Format Example
Text sample text
URL https://www.example.com
WIFI WIFI:S:Office_Guest;T:WPA;P:password123;;
vCard BEGIN:VCARD...END:VCARD
Bluetooth BT:00:11:22:33:44:55
Email mailto:info@example.com?subject=Hello
Geo geo:40.7128,-74.0060
Create a JSON file and download it on your phone.
You can use the Machine Reel or Batch Write feature by importing a JSON file with the following structure:
Open the app and select Write Multiple Tags from JSON. Now select Write From Json File. This requires file read permission. Once the permission has been granted, select the required JSON file.
JSON file will be parsed and upon successful read, data will be ready for writing. You can either manually use NFC chips to write data or use a machine reel to write the data.
{
"TAG": [
{
"id": 1,
"type": "text",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "Asset ID: 55291"
},
{
"NdefRecord": "Storage Room B"
}
]
},
{
"id": 2,
"type": "url",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "https://www.example.com"
}
]
},
{
"id": 3,
"type": "email",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "mailto:support@example.com?subject=NFC%20Support&body=Sent%20via%20NFC"
}
]
},
{
"id": 4,
"type": "sms",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "sms:+15551234567?body=Hello%20from%20NFC"
}
]
},
{
"id": 5,
"type": "contact",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nTEL:+123456789\nEMAIL:john@example.com\nEND:VCARD"
}
]
},
{
"id": 6,
"type": "bluetooth_device",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "00:11:22:33:44:55"
}
]
},
{
"id": 7,
"type": "wifi",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "WIFI:S:Guest_WiFi;T:WPA;P:password123;H:false;;"
}
]
},
{
"id": 8,
"type": "location",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "geo:37.7749,-122.4194"
}
]
},
{
"id": 9,
"type": "application",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "com.manjul.utility.nfc"
}
]
},
{
"id": 10,
"type": "bitcoin",
"lock_tag": false,
"NdefMessage": [
{
"NdefRecord": "bitcoin:1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa?amount=0.01"
}
]
}
]
}
id: A unique reference for your records.
type: Either text or url.
lock_tag: Set to true to make the NFC chip Read-Only permanently.
NdefMessage : Wrapper list format object which can hold Strings of NdefRecords. If type is url and there are multiple NdefRecord, only first url will be written.
NdefRecord: The payload to be written to the chip.
Thanks for visiting this page. This page is intended towards developer or users of NFC Reader/Writer - Bar code/QR code reader app who intend to retrieve data being sent on a server. Sent data may be use as inventory management or to provide door access etc.
Welcome to the official developer documentation for the NFC Reader/Writer server integration. This guide helps you set up a custom backend to receive, process, and log scan data (NFC, Barcode, QR) in real-time.
The app allows you to define a custom Server URL. Every time a scan occurs, the app sends a POST request to that URL. This is ideal for:
Inventory Management
Attendance Systems
Access Control
Real-time Logging
The app sends data as a JSON Array string.
Method: POST
Content-Type: text/plain
Headers: Includes Authorization: Bearer <Your_Token> (if configured in settings).
NFC Scan: ["id:044f63f23c2a80", "data:Hello World", "source:NFC", "timeStamp:1579362207294"]
Barcode/QR Scan: ["data:B07KDDKDNN", "source:Camera", "type:CODE_128", "timeStamp:1579362426142"]
Use the following robust PHP script to handle the incoming data. This script handles the raw input stream and parses the key-value pairs correctly.
/**
* Processes the raw POST data from the NFC Reader App.
* * @return array Parsed key-value pairs
*/
function getRealPOST() {
// Read raw data from input stream
$jsonContent = file_get_contents("php://input");
// Decode the JSON array
$dataArray = json_decode($jsonContent, true);
$result = array();
if (is_array($dataArray)) {
foreach ($dataArray as $entry) {
// Split by the first colon only
$parts = explode(":", $entry, 2);
if (count($parts) == 2) {
$key = trim($parts[0]);
$value = trim($parts[1]);
$result[$key] = $value;
}
}
}
return $result;
}
// Example Usage:
$postData = getRealPOST();
// Check for Authorization Header if needed
$headers = apache_request_headers();
$authToken = $headers['Authorization'] ?? '';
if (!empty($postData)) {
$id = $postData['id'] ?? 'N/A';
$content = $postData['data'] ?? 'No data';
// Log data to a file
$logEntry = date('Y-m-d H:i:s') . " | ID: $id | Data: $content\n";
file_put_contents("scans_log.txt", $logEntry, FILE_APPEND);
// Always return "ok_ok" for the app to confirm success
echo "ok_ok";
} else {
echo "No valid data received.";
}
Before deploying your own server, you can use these public endpoints to verify the app is sending data correctly:
PostTestServer: https://posttestserver.dev/
Beeceptor: https://beeceptor.com/
Simply copy the unique URL provided by these services, paste it into the Server URL field in the app settings, and perform a scan!