Create a Badge Type

If your set-up requires a badge to be read before a person can be granted access then you will need to set up a Badge Type to be able to assign to the people that need a card assignment (badge). Badge Types are assigned to Persons and are linked to Access Levels.

A properly created badge type should have an unique Common Name, an Absolute Expiry Date or a Sliding Expiry Span.

You can add a link to the appropriate Access Levels here as well if they are already set up but an Access Level is not required for creation, just for badge use. To add an Access Level check out BaseInfo.

For more information on Badge Types and the methods used please look at BadgeTypeInfo.

Example in C#

//Create BadgeType
var badgeType = await client.AddBadgeTypeAsync(currentInstance, new BadgeTypeInfo
{
    CommonName = "StandardBadgeType",
    AbsoluteExpiryDate = new DateTime(2019,8,13), //This will default to the current day/null
});
//Assign Access Level to BadgeType
await client.AssignConnectedObjectAsync(badgeType, accessLevel, "AccessLevel", false);  //An Access level can be on many badges

Example in CURL

#Create BadgeType
curl -X POST \
  https://keepapi.feenicshosting.com/api/f/INSTANCE.KEY/badgetypes \
    -H 'Authorization: Bearer TOKEN_GOES_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
        "$type":"Feenics.Keep.WebApi.Model.BadgeTypeInfo, Feenics.Keep.WebApi.Model",
        "AbsoluteExpiryDate":"2019-08-13T00:00:00",
        "SlidingExpirySpan":null,
        "BackgroundColor":null,
        "BackBackgroundColor":null,
        "FrontOrientation":0,
        "BackOrientation":0,
        "FrontBorderThickness":0.0,
        "FrontBorderBrush":null,
        "BackBorderThickness":0.0,
        "BackBorderBrush":null,
        "Width":0.0,
        "Height":0.0,
        "Key":null,
        "CommonName":"StandardBadgeType",
        "InFolderHref":null,
        "InFolderKey":null,
        "Links":[],
        "ObjectLinks":null,
        "Metadata":null,
        "Notes":null,
        "Tags":null,
        "Monikers":null,
        "Href":null
    }'
#Assign Access Level to BadgeType
curl -X PUT \
  'https://keepapi.feenicshosting.com/api/f/INSTANCE.KEY/badgetypes/BADGETYPE.KEY/connections/AccessLevel?isOneToOne=False&relatedKey=ACCESSLEVEL.KEY' \
  -H 'Authorization: Bearer TOKEN_GOES_HERE'