AddOccupancy
Overview
Adds a single Occupancy to the system. Returns Success/Error code plus primary key of Occupancy added.
Request Information
Method
POST - api/Occupancy/AddOccupancy
URI Parameters
None.
Body Parameters
AddUpdateOccupancyViewModel
| Name | Description | Type | Additional information |
|---|---|---|---|
| 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 | Required: Represents the PK of the global company that the Occupancy is an instance of. | 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. |
JSON
{
"Name": "sample string 1",
"FacilityId": "83424b4d-66c8-4f2f-b837-aa475f83369c",
"CompanyId": "a769ed2a-951f-4e82-8302-d528b62d2aa0",
"StreetAddress1": "sample string 4",
"StreetAddress2": "sample string 5",
"City": "sample string 6",
"RegionId": "22ff0d9b-0edb-4229-bda8-40ebd4709e85",
"CountryId": "2b19d693-1267-4b2d-8776-a8fd78deef40",
"PostalCode": "sample string 9",
"Website": "sample string 10",
"Phone": "sample string 11",
"DefaultBadgeTemplateId": "9b775830-ed2d-4664-8699-aa828099f8ad",
"Deleted": true
}
XML
<AddUpdateOccupancyViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BluSKYWebAPI.Controllers">
<City>sample string 6</City>
<CompanyId>a769ed2a-951f-4e82-8302-d528b62d2aa0</CompanyId>
<CountryId>2b19d693-1267-4b2d-8776-a8fd78deef40</CountryId>
<DefaultBadgeTemplateId>9b775830-ed2d-4664-8699-aa828099f8ad</DefaultBadgeTemplateId>
<Deleted>true</Deleted>
<FacilityId>83424b4d-66c8-4f2f-b837-aa475f83369c</FacilityId>
`<Name>`sample string 1</Name>
<Phone>sample string 11</Phone>
<PostalCode>sample string 9</PostalCode>
<RegionId>22ff0d9b-0edb-4229-bda8-40ebd4709e85</RegionId>
<StreetAddress1>sample string 4</StreetAddress1>
<StreetAddress2>sample string 5</StreetAddress2>
<Website>sample string 10</Website>
</AddUpdateOccupancyViewModel>
```
## Response Information
---
### Resource Description
ResultWithGuid
| Name | Description | Type | Additional information |
| --- | --- | --- | --- |
| ResultCode | Represents the result code | integer | None. |
| Description | Represents a description of the result code | string | None. |
| Value | Represents the PK value that was created as a result of an add | globally unique identifier | None. |
### Response Formats
#### JSON
```json
{
"ResultCode": 1,
"Description": "sample string 2",
"Value": "57613693-034a-45f4-8a1a-b6ecbe149fc3"
}
```
#### XML
```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>`57613693-034a-45f4-8a1a-b6ecbe149fc3</Value>
</ResultWithGuid>