Skip to main content

AddUserCard

Overview

Adds a Card to an existing User. Returns Success/Error code plus primary key of UserCard entry made.

Request Information


Method

POST - api/Person/AddUserCard

URI Parameters

None.

Body Parameters

AddUserCardViewModel

NameDescriptionTypeAdditional information
UserIdRequired: The PK of the existing User that you want to add the card to.globally unique identifierNone.
CardIdOptional: The PK of an existing card that you want to assign to the User. Retrieve possible values from /Card/GetAllCards. If null, CardType, CardACSystem, InternalCardNumber, ExternalCardNumber and Facility code are required.globally unique identifierNone.
CardTypeConditional: If CardId is null, this is required. Represents the type of card being added dynamically. Retrieve possible values from /Card/GetAllCardTypesintegerNone.
CardACSystemIdConditional: If CardId is null, this is required. Represents the Access Control System of the card being added dynamically. Retrieve possible values from /ACSystem/GetAllSystemsglobally unique identifierNone.
InternalCardNumberConditional: If CardId is null, this is required. Represents the internal/encoded number of the card being added dynamically.integerNone.
ExternalCardNumberConditional: If CardId is null, this is required. Represents the external number printed on the card being added dynamically.stringNone.
CardSerialNumberConditional: If CardType supports it, this is required. Represents the serial number of the smart card being added dynamically.integerNone.
FacilityCodeConditional: If CardType supports it, this is required. Represents the facility code of the smart card being added dynamically.integerNone.
IssueCodeConditional: If CardType supports it, this is required. Represents the issue code of the smart card being added dynamically.integerNone.
PINOptional: The PIN that the User may use in conjunction with this Card for Card + PIN mode or for when Readers are in PIN mode only.stringNone.

JSON

{
"UserId": "be1a76eb-3d2b-4ed8-a976-a4870d89aeaf",
"CardId": "1541616c-d1f9-484b-be2c-e5789c7fe9a5",
"CardType": 2,
"CardACSystemId": "bc226c45-2950-49eb-a976-92e11921e897",
"InternalCardNumber": 3,
"ExternalCardNumber": "sample string 4",
"CardSerialNumber": 1,
"FacilityCode": 1,
"IssueCode": 1,
"PIN": "sample string 5"
}

XML

<AddUserCardViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BluSKYWebAPI.Controllers">
<CardACSystemId>bc226c45-2950-49eb-a976-92e11921e897</CardACSystemId>
<CardId>1541616c-d1f9-484b-be2c-e5789c7fe9a5</CardId>
<CardSerialNumber>1</CardSerialNumber>
<CardType>2</CardType>
<ExternalCardNumber>sample string 4</ExternalCardNumber>
<FacilityCode>1</FacilityCode>
<InternalCardNumber>3</InternalCardNumber>
<IssueCode>1</IssueCode>
<PIN>sample string 5</PIN>
<UserId>be1a76eb-3d2b-4ed8-a976-a4870d89aeaf</UserId>
</AddUserCardViewModel>

Response Information


Resource Description

ResultWithGuid

NameDescriptionTypeAdditional information
ResultCodeRepresents the result codeintegerNone.
DescriptionRepresents a description of the result codestringNone.
ValueRepresents the PK value that was created as a result of an addglobally unique identifierNone.

Response Formats

JSON

{
"ResultCode": 1,
"Description": "sample string 2",
"Value": "78e754c7-50c3-4e99-ad51-0b38dcd99ebf"
}

XML

<ResultWithGuid xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BluSKYWebAPI.Controllers">
`````<Description>``````sample string 2</Description>
`<ResultCode>`1</ResultCode>
`<Value>`78e754c7-50c3-4e99-ad51-0b38dcd99ebf</Value>
</ResultWithGuid>