Back to documentation

Release notes version1.4.1 version1.4.1

Commands


new parameter IssueCard    New in 1.4.1

Sends an issue card command.

Syntax
JSON example

Note: New parameter [useCardAccessRights] added.


    * Green text optional
    var cardprogrammerId = 1;
    //Up to 16 MIDs
    var myDoorAccessList = [{ Mid: "100" }, { Mid: "101" }, { Mid: "102" }];
    var myAccessRightsList = [{ Name: "2 Offline & STuglås" }];
    var OfflineCard = JSON.stringify({Name: "Christer", Valid_From: "2018-03-20 10:00", Valid_To: "2018-03-27 10:00", Amount: 20, AlwaysValid: 0, DoorAccessList: myDoorAccessList, AccessRightsList: myAccessRightsList});
    $.ajax({
    type: 'POST',
    url: 'https://api.camptrac.com/api/OfflineCommands/IssueCard',
    data: {customerKey: "123456789", customerId: "1", cardprogrammerId: cardprogrammerId, OfflineCard, accountId: "717", useCardAccessRights: "1"},
    dataType: 'json',
    success: function (data) {},
    error: function (request, message, error) {}
    });


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

int cardprogrammerId
The int representing the card-programmer-ID of the card-programmer in the database.

OfflineCard OfflineCard
An OfflineCard object.

int accountId
The int representing the account id the card will be added to.
In case accountId is not sended, then an account is created automatically for the card.

int useCardAccessRights
0 or 1. In case you send with 1, then the card will get the AccessRights sended, in other case the card will get it's account AccessRights.