POST api/v1/Occupancies
Adds a single Occupancy to the system. Returns Success/Error code plus primary key of Occupancy added.
Request Information
URI Parameters
None.
Body Parameters
AddUpdateOccupancyViewModelName | Description | Type | Additional information |
---|---|---|---|
OccupancyId |
Represents the PK of the Occupancy |
globally unique identifier |
None. |
Name |
Required: Represents the name of the Occupancy. Max Length = 200 |
string |
None. |
FacilityId |
Required: Represents the PK of the Facility the Occupancy is located in. Retrieve possible values by calling /Facility/GetAllFacilities |
globally unique identifier |
None. |
CompanyId |
Conditional: Represents the PK of the global company that the Occupancy is an instance of, if not passed in POST method, then the company is created on the Fly. |
globally unique identifier |
None. |
StreetAddress1 |
Represents the primary street address of the Occupancy |
string |
None. |
StreetAddress2 |
Represents the secondary street address of the Occupancy |
string |
None. |
City |
Represents the city of the Occupancy |
string |
None. |
RegionId |
Represents the PK of the region (State, Province, County, etc) of the Occupancy. Retrieve possible values by calling /Region/GetAllRegionsByCountryId |
globally unique identifier |
None. |
CountryId |
Represents the PK of the country of the Occupancy. Retrieve possible values by calling /Country/GetAllCountries |
globally unique identifier |
None. |
PostalCode |
Represents the Postal Code/Zip Code of the Occupancy |
string |
None. |
Website |
Represents the URL of the website associated with the Occupancy |
string |
None. |
Phone |
Represents the primary phone number of the Occupancy |
string |
None. |
DefaultBadgeTemplateId |
Represents the PK of the default Badge Template for the Occupancy |
globally unique identifier |
None. |
Deleted |
Represents the deleted status of the Occupancy. Should be false for an Add action, |
boolean |
None. |
Request Formats
application/json, text/json
{ "OccupancyId": "83461dfb-0076-4e01-9997-eebdae4ccfcf", "Name": "sample string 2", "FacilityId": "8a5259e6-6eb6-45ed-b00b-85a238ed99e3", "CompanyId": "96de1879-1d59-4041-a147-332143891441", "StreetAddress1": "sample string 4", "StreetAddress2": "sample string 5", "City": "sample string 6", "RegionId": "cc34181a-eec8-4156-a7bf-7e6d5d1accf8", "CountryId": "4268c1a6-8302-4244-8e20-fc55121ec92d", "PostalCode": "sample string 9", "Website": "sample string 10", "Phone": "sample string 11", "DefaultBadgeTemplateId": "dfac6e21-f3d2-4d65-a845-24e271510daa", "Deleted": true }
application/xml, text/xml
<AddUpdateOccupancyViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Controllers"> <City>sample string 6</City> <CompanyId>96de1879-1d59-4041-a147-332143891441</CompanyId> <CountryId>4268c1a6-8302-4244-8e20-fc55121ec92d</CountryId> <DefaultBadgeTemplateId>dfac6e21-f3d2-4d65-a845-24e271510daa</DefaultBadgeTemplateId> <Deleted>true</Deleted> <FacilityId>8a5259e6-6eb6-45ed-b00b-85a238ed99e3</FacilityId> <Name>sample string 2</Name> <OccupancyId>83461dfb-0076-4e01-9997-eebdae4ccfcf</OccupancyId> <Phone>sample string 11</Phone> <PostalCode>sample string 9</PostalCode> <RegionId>cc34181a-eec8-4156-a7bf-7e6d5d1accf8</RegionId> <StreetAddress1>sample string 4</StreetAddress1> <StreetAddress2>sample string 5</StreetAddress2> <Website>sample string 10</Website> </AddUpdateOccupancyViewModel>
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": "4e090fb6-fc17-47ba-93b4-19cf607ce94f", "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>4e090fb6-fc17-47ba-93b4-19cf607ce94f</Value> </ResultWithGuid>