POST api/v1/Users/{id}/UserCards
Adds a Card to an existing User. Returns Success/Error code plus primary key of UserCard entry made.
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
id | string |
None. |
Body Parameters
AddUserCardViewModelName | Description | Type | Additional information |
---|---|---|---|
ReassignCardIfAlreadyAssigned |
Optional. If true, deletes current card assignment (if any) for a given card before assigning it to the given User |
boolean |
None. |
UserId |
Required: The PK of the existing User that you want to add the card to. |
globally unique identifier |
None. |
CardId |
Optional: 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 identifier |
None. |
CardType |
Conditional: If CardId is null, this is required. Represents the type of card being added dynamically. Retrieve possible values from /Card/GetAllCardTypes |
integer |
None. |
CardACSystemId |
Conditional: If CardId is null, this is required. Represents the Access Control System of the card being added dynamically. Retrieve possible values from /ACSystem/GetAllSystems |
globally unique identifier |
None. |
InternalCardNumber |
Conditional: If CardId is null, this is required. Represents the internal/encoded number of the card being added dynamically. |
integer |
None. |
ExternalCardNumber |
Conditional: If CardId is null, this is required. Represents the external number printed on the card being added dynamically. |
string |
None. |
CardSerialNumber |
Conditional: If CardType supports it, this is required. Represents the serial number of the smart card being added dynamically. |
integer |
None. |
FacilityCode |
Conditional: If CardType supports it, this is required. Represents the facility code of the smart card being added dynamically. |
integer |
None. |
IssueCode |
Conditional: If CardType supports it, this is required. Represents the issue code of the smart card being added dynamically. |
integer |
None. |
PIN |
Optional: 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. |
string |
None. |
EnforceOccupancySystem |
Optional: Requests to verify if the CardACSystemId matches the system the User's Occupancy belongs to |
boolean |
None. |
CardActivationStartDateTime |
Optional: Date and time of the card activation |
date |
None. |
CardDeactivationStartDateTime |
Optional: Date and time of the card de-activation |
date |
None. |
CardUserFlags |
Card User Flags |
CardUserFlags |
None. |
Request Formats
application/json, text/json
{ "ReassignCardIfAlreadyAssigned": true, "UserId": "a4443e07-fb10-4106-9682-4429ad2507c7", "CardId": "b8993851-b937-4ea1-ac20-1d37b0b5b344", "CardType": 3, "CardACSystemId": "7fd58dbc-d45b-4628-94b3-ad7f0c92c517", "InternalCardNumber": 4, "ExternalCardNumber": "sample string 5", "CardSerialNumber": 1, "FacilityCode": 1, "IssueCode": 1, "PIN": "sample string 6", "EnforceOccupancySystem": true, "CardActivationStartDateTime": "2024-04-23T19:44:31.2137055+00:00", "CardDeactivationStartDateTime": "2024-04-23T19:44:31.2137055+00:00", "CardUserFlags": 1 }
application/xml, text/xml
<AddUserCardViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Controllers"> <CardACSystemId>7fd58dbc-d45b-4628-94b3-ad7f0c92c517</CardACSystemId> <CardActivationStartDateTime>2024-04-23T19:44:31.2137055+00:00</CardActivationStartDateTime> <CardDeactivationStartDateTime>2024-04-23T19:44:31.2137055+00:00</CardDeactivationStartDateTime> <CardId>b8993851-b937-4ea1-ac20-1d37b0b5b344</CardId> <CardSerialNumber>1</CardSerialNumber> <CardType>3</CardType> <CardUserFlags>ActiveCardholderRecord</CardUserFlags> <EnforceOccupancySystem>true</EnforceOccupancySystem> <ExternalCardNumber>sample string 5</ExternalCardNumber> <FacilityCode>1</FacilityCode> <InternalCardNumber>4</InternalCardNumber> <IssueCode>1</IssueCode> <PIN>sample string 6</PIN> <UserId>a4443e07-fb10-4106-9682-4429ad2507c7</UserId> <ReassignCardIfAlreadyAssigned>true</ReassignCardIfAlreadyAssigned> </AddUserCardViewModel>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
ResultWithGuidName | Description | Type | Additional information |
---|---|---|---|
Value |
Represents the PK value that was created as a result of an add |
globally unique identifier |
None. |
ResultCode |
Represents the result code |
integer |
None. |
Description |
Represents a description of the result code |
string |
None. |
Response Formats
application/json, text/json
{ "Value": "203c6da4-1f7b-4909-8a57-61e0b4fd2494", "ResultCode": 2, "Description": "sample string 3" }
application/xml, text/xml
<ResultWithGuid xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Controllers"> <Description>sample string 3</Description> <HttpStatusCode>Continue</HttpStatusCode> <ResultCode>2</ResultCode> <Value>203c6da4-1f7b-4909-8a57-61e0b4fd2494</Value> </ResultWithGuid>