Add a Card Format

Card Formats are what the controller uses to recognize the cards that people carry around. Without them cards will not work. The details need to match the physical cards that are assigned to people.

Keep can hold an unlimited number of Card Formats. A controller can hold a limited amount (depends on the controller type). It is up to you to determine what formats are required on what controller.

For more information on Card Formats and the methods used please look at CardFormatInfo.

Example in C#

var cardFormat = await client.AddCardFormatAsync(currentInstance, new CardFormatInfo
{
    CardNumberLength = 16,
    CardNumberStartingAt = 9,
    CommonName = "Challenger Format",
    EvenParityBitsLength = 13,
    EvenParityBitsStartingAt = 0,
    FacilityCode = 45,
    FacilityCodeLength = 8,
    FacilityCodeStartingAt = 1,
    IssueCodeLength = 0,
    IssueCodeStartingAt = 0,
    MagneticFormat = false,
    NumberOfBits = 26,
    OddParityBitsLength = 13,
    OddParityBitsStartingAt = 13,
    Offset = 0
});

Example in CURL

curl -X POST \
  https://keepapi.feenicshosting.com/api/f/INSTANCE.KEY/cardformats \
  -H 'Authorization:  Bearer TOKEN_GOES_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
        "$type":"Feenics.Keep.WebApi.Model.CardFormatInfo, Feenics.Keep.WebApi.Model",
        "NumberOfBits":26,
        "FacilityCodeStartingAt":1,
        "FacilityCodeLength":8,
        "CardNumberStartingAt":9,
        "CardNumberLength":16,
        "IssueCodeStartingAt":0,
        "IssueCodeLength":0,
        "EvenParityBitsStartingAt":0,
        "EvenParityBitsLength":13,
        "OddParityBitsStartingAt":13,
        "OddParityBitsLength":13,
        "Offset":0,
        "MagneticFormat":false,
        "FacilityCode":45,
        "MinCardNumberDigits":0,
        "ReverseBitStream":false,
        "CardFieldAsLargeEncodedNumber":false,
        "ReverseBytes":false,
        "EnableSpecial37BitParityCheck":false,
        "Key":null,
        "CommonName":"cURL_Example_Format",
        "InFolderHref":null,
        "InFolderKey":null,
        "Links":[],
        "ObjectLinks":null,
        "Metadata":null,
        "Notes":null,
        "Tags":null,
        "Monikers":null,
        "Href":null
     }'

Add a Card Format to a Controller

Example in C#

await client.AddCardFormatToControllerAsync(controller, cardFormat);

Example in CURL

curl -X PUT \
  https://keepapi.feenicshosting.com/api/f/INSTANCE.KEY/controllers/CONTROLLER.KEY/cardformats \
  -H 'Authorization:  Bearer TOKEN_GOES_HERE' \
  -H 'Content-Type: application/json'