Find the release notes for version 1.4.2 here.
Find the release notes for version 1.4.1 here.
Find the release notes for version 1.4 here.
Introduction to CampTrac web API integration.
Customer = company, government agency, campus, camp site, resort or hotel.
Guest = Employee of a company or government agency, person(s) visiting the facilities of the customer as paying guests.
CampTrac Cloud is a Cloud-based APV system - Access control, Payment system, Visitor Management. CampTrac Cloud offers a wide range of functions including physical access control by the use of virtual keys, RFID card readers and LPR cameras as well as micro payments by the use of the same RFID card readers.
A CampTrac Cloud customer can use the system in three different ways. We categorize the customers in 4 different modes.
These are:
Read more about the different modes here below.
Within each mode the customer can choose to let the guest make payments via the card readers in two different ways;
So before you begin your integration work you need to know what system mode and way of payment the customer would like to use.
A customer (company, government agency, campus, camp site, resort, hotel) CAN NOT mix PAYMENT Online and Offline card readers in the same system. They either use online payment readers or offline payment reader. Access control readers for opening door/gate can be mixed.
Pre-paid means that the guest “loads” his account with money in advanced and that these money will be deducted from the account every time a payment takes place. If offline card readers are used then the money will be loaded onto a sector in the RFID card and deducted by the card reader. If money runs out from the account the guest will need to refill the account in order to reactivate the account and card.
Post-paid means that the guests account begin with 0 and that every payment transaction will be stored on the account as credit. We call this a “resort” solution and can be compared to charging purchases to guestroom. Payment will take place one the guest checks out.
If a customer has chosen a Online solution of CampTrac this means that all communication takes place online in real-time. Communication between server and card reader controllers (also known as terminals) takes place in real-time as does the communication between API and all services. If you wish to integrate the “Pulse” command with in your application so that you can offer the guest to open door and gates via your system or APP, you must use online.
In Online mode the customer can use the system in three ways;
If a customer has chosen an Offline solution from CampTrac this means that the card readers does not communicate with the Cloud based system, but works offline. The intelligence in this mode is based on data is written onto the RFID card and the Offline card readers know where to read and write data back onto the card.
The cards are programmed via the CampTrac Cloud system during the checkin process of the guest. The Offline card readers offers both Access Control functionality as well as Pre-payment functionality. Please note that the Hotel/Cabin locks only offers access control functionality and not payment functionality.
If a customer has chosen an Mixed Mode solution from CampTrac this means that the customer are using a mix of online and offline card readers for access control. For payment it is very import to know that the customer must choose only one type of card reader (online or
offline). They CAN NOT mix different card readers for payment
. For access control they can mix all type of card readers and LPR cameras.
In order to do an integration to CampTrac Cloud the integrator must follow a certain order.
In order to issue a card with access rights and money this order must be followed;
In order to issue a card with access rights and money this order must be followed;
There is no need to add money as the guest make payments as credit (building a credit line on the account).
In order to issue a card with access rights and money this order must be followed;
These methods allow an external application to send commands to the CampTrac system.
Sends an open-door-pulse command.
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Commands/SendPulseToOpenDoor',
data: {customerKey: "123456789", customerId: "1", terminalId: "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 terminalId
The int representing the unique terminal-ID of the terminal in the database.
Sends an open-door-pulse command and getting answer if door was opened or not.
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Commands/SendPulseToOpenDoor',
data: {customerKey: "123456789", customerId: "1", terminalId: "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 terminalId
The int representing the unique terminal-ID of the terminal in the database.
Return value
Type: List<Commands>
A list of commands information.
Retrieves accounts that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Accounts/GetAllAccounts',
data: { customerKey: "123456789", customerId: "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.
Return value
Type: List<Accounts>
A list of accounts information.
Retrieves active accounts that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Accounts/GetAllActiveAccounts',
data: { customerKey: "123456789", customerId: "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.
Return value
Type: List<Accounts>
A list of accounts information.
Retrieves host accounts that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Accounts/GetHostAccounts',
data: { customerKey: "123456789", customerId: "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.
Return value
Type: List<Accounts>
A list of accounts information.
Retrieves an account.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Accounts/GetAccount',
data: {customerKey: "123456789", customerId: "1", Id: "1"},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 Id
The int representing the unique ID of the account in the database.
Return value
Type: List<Accounts>
A list containing one account.
Creates a new account.
Syntax
JSON example
var myCards = [{Name: "Kort 1", Surname: "c1", CardNumber: "222555888", Check_Exp_Date: "true"},
{Name: "Kort 2", Surname: "c2", CardNumber: "222555881", Check_Exp_Date: "false"},
{Name: "Kort 3", Surname: "c3", CardNumber: "222555882", Check_Exp_Date: "true"}
];
var myAccessRights = [{Id: "28"}, {Id: "19"}]
var Account = JSON.stringify({CampTracNumber: "nummer", Name: "TestA", Surname: "SurTestA", Valid_From: "2017-11-27 10:00", Valid_To: "2017-11-29 10:00", Cards: myCards, AccessRights: myAccessRights});
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/CreateAccount',
data: {customerKey: "1234567891", customerId: "1", Account},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Accounts Account
An account object.
Return value
Type: List<Accounts>
A list containing one account.
Updates an existing accounts information. This method does not update the accounts cards. Only the dates and access rights on the existing ones.
Syntax
JSON example
var myCards = [{Name: "Kort 1", Surname: "c1", CardNumber: "222555888", Check_Exp_Date: "true"},
{Name: "Kort 2", Surname: "c2", CardNumber: "222555881", Check_Exp_Date: "false"},
{Name: "Kort 3", Surname: "c3", CardNumber: "222555882", Check_Exp_Date: "true"}
];
var myAccessRights = [{Id: "29"}]
var Account = JSON.stringify({Id: "306", Name: "TestName", Surname: "Best", Valid_From: "2018-11-27 10:00", Valid_To: "2018-11-29 10:00", AccessRights: myAccessRights});
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/UpdateAccount',
data: {customerKey: "123456789", customerId: "1", Account},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Accounts Account
An account object.
Suspends an account.
Syntax
JSON example
$.ajax({
type: 'PUT',
url: 'https://api.camptrac.com/api/Accounts/ SuspendAccount',
data: {customerKey: "123456789", customerId: "1", Id: "1"},
dataType: 'json',
success: function (data) {},
error: function (request, message, error) {}
});
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 id
The int representing the unique ID of the account in the database.
Retrieves account balance.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Accounts/GetAccountBalance',
data: {customerKey: "123456789", customerId: "1", Id: "1"},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 Id
The int representing the unique ID of the account in the database.
Retrieves an account
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Accounts/GetAccountByCampTracNumber',
data: {customerKey: "12346656789", customerId: 1, campTracNumber: 1},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
string campTracNumber
The camptracnumber/booking number that refer to a specific account in the database.
Return value
Type: List<Accounts>
A list containing one account.
Adds money to an account
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/AddMoney',
data: {customerKey: "12346656789", customerId: 1, accountId: 12345, AddAmount: 125},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 accountId
The int representing the unique ID of the account in the database.
decimal AddAmount
The amount to be added to the account.
Removes money from an account
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/RemoveMoney',
data: {customerKey: "12346656789", customerId: 1, accountId: 12345, RemoveAmount: 125},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 accountId
The int representing the unique ID of the account in the database.
decimal RemoveAmount
The amount to be removed from the account.
Creates an SMS key.
Syntax
JSON example
var smsDetails =
{
AccountId: "3899512",
AccessRights: "225,234",
ValidFrom: "2021/07/11",
ValidTo: "2021/09/25",
TimeFrom: "14:50",
TimeTo: "14:50",
Mobile_Phone: "+23466565634344"
};
var smsdetails = JSON.stringify(smsDetails);
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/CreateSmsKey',
data: {customerKey: "12346656789", customerId: 1, SmsDetails: smsdetails},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
SmsDetails SmsDetails
An SmsDetails object.
Return value
Type: Object<SmsKey>
An object of SmsKey information.
Creates an QR key.
Syntax
JSON example
var qrDetails =
{
AccountId: "2919271",
Name: "QrKey_NM",
Surname: "QrKey_SNM",
AccessRights: "295",
ValidFrom: "2021/06/11",
ValidTo: "2021/06/29",
TimeFrom: "14:50",
TimeTo: "14:50",
Mobile_Phone: "+46712345678",
Email: "test@test.com"
};
var qrdetails = JSON.stringify(qrDetails);
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/CreateQrKey',
data: {customerKey: "12346656789", customerId: 1, QrDetails: qrdetails},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
QrDetails QrDetails
An QrDetails object.
Return value
Type: Object<QRKey>
An object of QRKey information.
Creates a CreatePincode.
Syntax
JSON example
var pincodeDetails =
{
AccountId: "38995",
AccessRights: "225,234",
ValidFrom: "2021/03/11",
ValidTo: "2021/06/29",
TimeFrom: "14:50",
TimeTo: "14:50",
Pincode: "7246"
};
var pincodedetails = JSON.stringify(pincodeDetails);
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Accounts/CreatePincode',
data: {customerKey: "12346656789", customerId: 1, PincodeDetails: pincodedetails},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
PincodeDetails PincodeDetails
A PincodeDetails object.
Return value
Type: Object<CreatedPincode>
An object of CreatedPincode information.
Retrieves cards that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Cards/GetAllCards',
data: {customerKey: "123456789", customerId: "1"},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Return value
Type: List<Cards>
A list of cards information.
Retrieves a card.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Cards/GetCard',
data: {customerKey: "123456789", customerId: "1", Id: "1"},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 Id
The int representing the unique ID of the card in the database.
Return value
Type: List<Cards>
A list containing one card.
Creates a card.
Syntax
JSON example
var myAccessRights = [{Id: "28" }, { Id: "19" }]
var Card = JSON.stringify({CardNumber: "951753", Name: "TestName", Surname: "TestSurname", Valid_From: "2017-11-27 10:00", Valid_To: "2017-11-29 10:00", Notes: "my notes", AccessRights: myAccessRights});
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Cards/CreateCard',
data: {customerKey: "123456789", customerId: "1", accountId: "306", Card},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 accountId
The int representing the unique ID of the account in the database.
Cards Card
A card object.
Return value
Type: List<Cards>
A list containing one card.
Updates an existing cards information.
Syntax
JSON example
var myAccessRights = [{Id: "17"}]
var Card = JSON.stringify({Id: "459", Name: "TestName1", Surname: "TestSurname1", Valid_From: "2017-12-27 10:00", Valid_To: "2017-12-29 10:00", Notes: "my notes 1", AccessRights: myAccessRights});
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/Cards/UpdateCard',
data: {customerKey: "123456789", customerId: "1", Card},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Cards Card
A card object.
Deactivates a card.
Syntax
JSON example
$.ajax({
type: 'PUT',
url: 'https://api.camptrac.com/api/Cards/DeactivateCard',
data: {customerKey: "123456789", customerId: "1", Id: "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 Id
The int representing the unique ID of the card in the database.
Retrieves card balance.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Cards/GetCardBalance',
data: {customerKey: "123456789", customerId: "1", Id: "1"},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 Id
The int representing the unique ID of the card in the database.
Retrieves card transactions that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/Cards/GetCardTransactions',
data: {customerKey: "123456789123456789", customerId: "1", Id: "1"},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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 Id
The int representing the unique ID of the card in the database.
Return value
Type: List<Transactions>
A list of transactions information.
Retrieves customer access rights that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/AccessRights/GetAllAccessRights',
data: { customerKey: "123456789", customerId: "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.
Return value
Type: List<AccessRights>
A list of access rights information.
Retrieves customer cardreaders that exists in CampTrac.
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/CardReaders/GetAllCardReaders',
data: {customerKey: "123456789", customerId: "1"},
dataType: "json",
success: function (data) {},
error: function (jqXHR, textStatus, errorThrown) {}
});
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.
Return value
Type: List<CardReaders>
A list of cardreaders information.
A class representing the accounts information.
Syntax
class Accounts
{
int Id
string CampTracNumber
string Name
string Surname
DateTime Valid_From
DateTime Valid_To
int Customer_Id
int User_Id
string Notes
string Email
string Mobile_Phone
bool State
DateTime Deactivate_Date
List<AccessRights> AccessRights
List<Cards> Cards
string Department
string Employee_no
int Host
string AdditionalEmails
decimal Balance
int CurrentState
}
A class representing the cards information.
Syntax
class Cards
{
int Id
string CardNumber
string Name
string Surname
string Pincode
DateTime Valid_From
DateTime Valid_To
bool Check_Exp_Date
int Customer_Id
int Booking_Id
bool Active
int State
string Notes
string Dcn
List<AccessRights> AccessRights
}
A class representing the cardreaders information.
Syntax
class Cardreaders
{
int Id
string Description
string Card_type
string Mid
string Dashboard_Description
int Terminal_Id
bool In_barrier
bool Out_
bool QR_reader
}
A class representing the access rights information.
Syntax
class AccessRights
{
int Id
int Customer_Id
string Name
string Description
int Scheme_Id
int Active
}
A class representing the transactions information.
Syntax
class Transactions
{
int Id
int Booking_Id
string Card_Number
DateTime Valid_To
int Terminal_Id
int Door_Number
int Trn_Type
decimal Price
int Card_id
int IsValid
int Note
}
A class representing the commands information.
Syntax
class Commands
{
int CommandId
string Description
}
A class representing the SmsDetails information.
Syntax
class SmsDetails
{
string AccountId
string AccessRights (Access right id comma separated)
string ValidFrom (Desire valid from date, should not lower than account valid from date)
string ValidTo (Desire valid to date, should not greater than account valid to date)
string TimeFrom (Desire valid to time, should not greater than account valid to time)
string TimeTo
string Mobile_Phone (Mobile number to send the created key)
}
A class representing the QrDetails information.
Syntax
class QrDetails
{
string AccountId
string Name (Optional, should use the account name if its null or empty)
string Surname (Optional, should use the account surname if its null or empty)
string AccessRights (Access right id comma separated)
string ValidFrom (Desire valid from date, should not lower than booking valid from date)
string ValidTo (Desire valid to date, should not greater than booking valid to date)
string TimeFrom (Desire valid from time, should not greater than account valid to time)
string TimeTo (Desire valid to time, should not greater than account valid to time)
string Mobile_Phone (Mobile number to send the created key)
string Email (Email to send the created key)
}
A class representing the PincodeDetails information.
Syntax
class PincodeDetails
{
string AccountId
string AccessRights (Access right id comma separated)
string ValidFrom (Desire valid from date, should not lower than booking valid from date)
string ValidTo (Desire valid to date, should not greater than booking valid to date)
string TimeFrom (Desire valid from time, should not greater than account valid to time)
string TimeTo (Desire valid to time, should not greater than account valid to time)
string Pincode (Optional) (Desire 4 digit pincode, no input meaning generate unique pincode)
string Email (Email to send the created key)
}
A class representing the SmsKey information.
Syntax
class SmsKey
{
string SmsKeyUrl
bool CreationResult
}
A class representing the QRKey information.
Syntax
class QRKey
{
string QRKeyUrl
bool CreationResult
}
A class representing the CreatedPincode information.
Syntax
class CreatedPincode
{
bool CreationResult
string Pincode
string Message
string AccountId
}
These methods allow an external application to send commands to the CampTrac system.
Sends an add money command.
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/OfflineCommands/AddMoney',
data: {customerKey: "123456789", customerId: "1", cardprogrammerId: "1", amount: 50},
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.
int amount
The amount to be added to card.
Sends a remove money command.
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/OfflineCommands/RemoveMoney',
data: {customerKey: "123456789", customerId: "1", cardprogrammerId: "1", amount: 10},
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.
int amount
The amount to be added to card.
Sends a format card command.
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/OfflineCommands/FormatCard',
data: {customerKey: "123456789", customerId: "1", cardprogrammerId: "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.
Sends a reset card command.
Syntax
JSON example
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/OfflineCommands/ResetCard',
data: {customerKey: "123456789", customerId: "1", cardprogrammerId: "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.
Sends an issue card command.
Syntax
JSON example
Note: New parameter [AccessRightsList] added. (v1.4)
Note: New parameter [useCardAccessRights] added. (v1.4.1)
* 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: "TestName", 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.
Retrieves offline card balance
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/OfflineCommands/GetOfflineCardBalance',
data: {customerKey: "12346656789", customerId: 1, cardprogrammerId: 1},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Retrieves offline card information
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/OfflineCommands/GetCardInformation',
data: {customerKey: "12346656789", customerId: 1, cardprogrammerId: 1},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Return value
Type: List<OfflineCard>
A list containing one OfflineCard.
Retrieves offline card transactions
Syntax
JSON example
$.ajax({
type: 'GET',
url: 'https://api.camptrac.com/api/OfflineCommands/GetOfflineTransactions',
data: {customerKey: "12346656789", customerId: 1, cardprogrammerId: 1},
dataType: 'json',
success: function (data) {},
error: function (data) {}
});
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.
Return value
Type: List<OfflineTransactions>
A list of offline transactions information.
Sends an add create door lock command, specific for cabin/hotel locks.
Syntax
JSON example
var DoorLockCard = JSON.stringify({Building: 3, Floor: 2, Door: 88, Valid_From: "2017-12-27 10:00", Valid_To: "2019-11-29 10:00"});
$.ajax({
type: 'POST',
url: 'https://api.camptrac.com/api/DoorLocks/CreateDoorLockCard',
data: {customerKey: "123456789", customerId: 1, cardprogrammerId: 1, DoorLockCard},
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.
DoorLockCard doorlockcard
A DoorLockCard object.
A class representing the Offline card information.
Syntax
class OfflineCard
{
string CardNumber
string Name
DateTime Valid_From
DateTime Valid_To
int AlwaysValid
int Amount
string Room
List<DoorAccess> DoorAccessList
List<AccessRights> AccessRightsList
}
A class representing the door access information.
Syntax
class DoorAccess
{
int Mid
}
A class representing the offline transactions information.
Syntax
class OfflineTransactions
{
DateTime Date
string Mid
string Fid
decimal Price
decimal Price_excl_vat
decimal Vat_quota
}
A class representing the Door lock card information.
Syntax
class DoorLockCard
{
int Building
int Floor
int Door
DateTime Valid_From
DateTime Valid_To
}