New Release (1.4.2)

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.

CampTrac | API Documentation Current version 1.4.2

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.

System modes

A CampTrac Cloud customer can use the system in three different ways. We categorize the customers in 4 different modes.

These are:

  • Online (Only Online card readers are used for Access Control and Payment)
  • Offline (Only Offline card readers are used for Access Control and Payment)
  • Mixed mode – Offline Pay. (Both Online and Offline readers are used for Access control, but only Offline card readers are used for payment)

Read more about the different modes here below.

Payment types

Within each mode the customer can choose to let the guest make payments via the card readers in two different ways;

  • Pre-paid (the most common)
  • Post-paid

So before you begin your integration work you need to know what system mode and way of payment the customer would like to use.

IMPORTANT!

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

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

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.

Online

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;

  1. Online Access only. If Access only is used this means that the system is only used for giving access to doors, gate and other facilities via card readers and LPR cameras. No payments takes place.
  2. Online Access and Pre-paid. With Online Access and Pre-paid mode it means that the account must be loaded with money before any payments via card readers can take place.
  3. Online Access and Post-paid. With Online Access and Post-paid mode it means only cards need to be registered to an account before payments via card readers can take place. The guest will build a credit inside the CampTrac system and pay his bill when check-out takes place.

Offline

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.

  1. Offline Access only. If Access only is used this means that the system is only used for giving access to doors, gate and other facilities via offline card readers. In order to give access to a card reader, data need to be written onto the RFID card. No payments takes place this mode.
  2. Offline Access and Pre-paid. With Offline Access and Pre-paid mode it means that cards belonging to an account must be loaded with money and access rights before any payments (or access) via card readers can take place.

Mixed Mode

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.

  1. Mixed mode Access only. If Access only is used this means that the system is only used for giving access to doors, gate and other facilities via online and offline card readers. In order to give access to a card reader, data need to be written onto the RFID card as well as into the database for online card readers. No payments takes place this mode.
  2. Mixed mode – Access with Online/Offline card readers and Pre-paid with offline readers. Many customers want to use online card readers for access control and offline card readers for payment. The benefit of this solution is that a card or car license plate can be cancelled/black listed in real-time rather than creating a black list card that needs to be manually shown to each offline card reader. This is possible by using the Mixed mode with Online access control readers and Offline card readers for payment.
  3. Mixed mode – Access control with Online and Offline reader for and Pre-pay function with online readers. In this mode the Online readers are used for Pre-pay functionality and Online card readers are used for access control.
  4. Mixed mode – Access control with Online and Offline reader for and Post-pay function with online readers. In this mode the online readers are used for payment Post-pay functionality and Offline card readers are used for access control.

How to integrate

In order to do an integration to CampTrac Cloud the integrator must follow a certain order.

Online Pre-paid

In order to issue a card with access rights and money this order must be followed;

  1. Create an Account. (One account per booking/family/group).
              a. Add Access rights. (Doors that the account will have access to).
              b. Add Cards. (Access cards)
  2. Add Money. (Prepaid Money stored on the account or on the card – this depends on what solution the customer has chosen. Online payment or offline payment.

Online Post-paid

In order to issue a card with access rights and money this order must be followed;

  1. Create an Account. (One account per booking/family/group).
              a. Add Access rights. (Doors that the account will have access to).
              b. Add Cards. (Access cards).

There is no need to add money as the guest make payments as credit (building a credit line on the account).

Offline Pre-paid

In order to issue a card with access rights and money this order must be followed;

  1. Create an Account. (One account per booking/family/group).
              a. Add Access rights. (Doors that the account will have access to).
              b. Issue Cards. This is different from adding cards in Online as this is a command that writes information to the sectors of the RFID card.

Commands

These methods allow an external application to send commands to the CampTrac system.

SendPulseToOpenDoor

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.


 

new SendPulseToOpenDoorWithAnswer    New in 1.4

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.



Accounts


GetAllAccounts

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.


 

new GetAllActiveAccounts    New in 1.4

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.


 

new GetHostAccounts    New in 1.4

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.


 

GetAccount

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.


 

CreateAccount

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.


 

UpdateAccount

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.


SuspendAccount

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.


GetAccountBalance

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.


GetAccountByCampTracNumber

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.


 

new AddMoney    New in 1.4

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.


 

new RemoveMoney    New in 1.4

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.



 

new CreateSmsKey    New in 1.4.2

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.


 

new CreateQRKey    New in 1.4.2

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.


 

new CreatePincode    New in 1.4.2

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.



Cards


GetAllCards

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.


GetCard

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.


CreateCard

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.


UpdateCard

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.


DeactivateCard

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.


GetCardBalance

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.


GetCardTransactions

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.



Access Rights


GetAllAccessRights

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.



Cardreaders


GetAllCardReaders

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.



Accounts

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
}


Cards

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 
} 


CardReaders

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
}

AccessRights

A class representing the access rights information.

Syntax


class AccessRights
{
    int Id
    int Customer_Id
    string Name
    string Description
    int Scheme_Id
    int Active
}

Transactions

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
}

Commands

A class representing the commands information.

Syntax


class Commands
{
    int CommandId
    string Description
}

SmsDetails

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)
}

QrDetails

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)
}

PincodeDetails

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)
}

SmsKey

A class representing the SmsKey information.

Syntax


class SmsKey
{
    string SmsKeyUrl
    bool CreationResult
}

QRKey

A class representing the QRKey information.

Syntax


class QRKey
{
    string QRKeyUrl
    bool CreationResult
}

CreatedPincode

A class representing the CreatedPincode information.

Syntax


class CreatedPincode
{
    bool CreationResult
    string Pincode
    string Message
    string AccountId
}

Offline commands

These methods allow an external application to send commands to the CampTrac system.


AddMoney

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.


RemoveMoney

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.


FormatCard

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.


ResetCard

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.


IssueCard

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.


GetOfflineCardBalance

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.


GetCardInformation

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.


GetOfflineTransactions

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.



Cabin/Hotel Locks


CreateDoorLockCard

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.


OfflineCard

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
}


DoorAccess

A class representing the door access information.

Syntax


class DoorAccess
{
    int Mid
}

OfflineTransactions

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
}

DoorLockCard

A class representing the Door lock card information.

Syntax


class DoorLockCard
{
    int Building
    int Floor
    int Door
    DateTime Valid_From
    DateTime Valid_To
}