When adding a reader to a downstream we use the methods provided for adding a peripheral. Each different reader type has different defaults and a different data structure. Be sure to determine what your reader needs when being created by searching it up in the API. The example is for a Mercury Reader.
For more information on Peripherals in general, Mercury Readers, and the methods used please look at PeripheralInfo and MercuryReaderInfo.
Example in C#
var reader = await client.AddPeripheralToDownStreamAsync(downstream, new MercuryReaderInfo
{
SioIndex = 0, //where on the panel in index
AntiPassbackTimeout = 0, //anti pass back timeout
MercuryAntiPassbackType = Feenics.Keep.WebApi.Model.MercuryAntiPassbackTypes.None,// anti-pass-back type
AssumeDoorUsed = false,
CommonName = "Reader In API How To",
EnableHostCheckBeforeGrant = false,
HostCheckDefaultIsGrant = true,
NormalGrantAccessTime = 6,
ExtendedGrantAccessTime = 30,
StrikeMode = 1, //strike mode... 1- normal?
DoorHeldTime = 30,
MercuryKeypadType = Feenics.Keep.WebApi.Model.MercuryKeypadTypes.None,
OfflineAccessMethod = Feenics.Keep.WebApi.Model.MercuryReaderAccessMethods.FacilityCodeOnly,
MercuryReaderAccessMethod = Feenics.Keep.WebApi.Model.MercuryReaderAccessMethods.Card,
MercuryReaderType = Feenics.Keep.WebApi.Model.MercuryReaderTypes.Wiegand
});
Example in CURL
curl -X POST \
https://keepapi.feenicshosting.com/api/f/INSTANCE.KEY/controllers/CONTROLLER.KEY/downstream/DOWNSTREAM.KEY/peripherals \
-H 'Authorization: Bearer TOKEN_GOES_HERE' \
-H 'Content-Type: application/json' \
-d '{
"$type":"Feenics.Keep.WebApi.Model.MercuryReaderInfo, Feenics.Keep.WebApi.Model",
"MercuryReaderAccessMethod":0,
"OfflineAccessMethod":4,
"MercuryReaderType":0,
"ElevatorType":0,
"MercuryAntiPassbackType":0,
"AntiPassbackTimeout":0,
"MercuryKeypadType":0,
"StrikeMode":1,
"EnableHostCheckBeforeGrant":false,
"HostCheckDefaultIsGrant":true,
"UseStrikeFollower":null,
"StrikeFollowerDelay":null,
"StrikeFollowerPulse":null,
"AssumeDoorUsed":false,
"NumberOfFloors":null,
"LockFunctionMode":null,
"DoorHeldTime":30,
"RexUnlockDoor":false,
"NormalGrantAccessTime":6,
"ExtendedGrantAccessTime":30,
"DoorPreHeldTime":0,
"IsTurnstile":false,
"RecordRexEvents":false,
"TwoCardControl":false,
"ControllerIndex":0,
"SioNumber":0,
"SioIndex":0,
"ControllerKey":null,
"ControllerCommonName":null,
"ControllerHref":null,
"Status":null,
"BacnetReadOnly":null,
"Key":null,
"CommonName":"Reader In API How To",
"InFolderHref":null,
"InFolderKey":null,
"Links":[],
"ObjectLinks":null,
"Metadata":null,
"Notes":null,
"Tags":null,
"Monikers":null,
"Href":null
}'