Skip to main content

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

NameDescriptionTypeAdditional information
NameRequired: Represents the name of the Occupancy. Max Length = 200stringNone.
FacilityIdRequired: Represents the PK of the Facility the Occupancy is located in. Retrieve possible values by calling /Facility/GetAllFacilitiesglobally unique identifierNone.
CompanyIdRequired: Represents the PK of the global company that the Occupancy is an instance of.globally unique identifierNone.
StreetAddress1Represents the primary street address of the OccupancystringNone.
StreetAddress2Represents the secondary street address of the OccupancystringNone.
CityRepresents the city of the OccupancystringNone.
RegionIdRepresents the PK of the region (State, Province, County, etc) of the Occupancy. Retrieve possible values by calling /Region/GetAllRegionsByCountryIdglobally unique identifierNone.
CountryIdRepresents the PK of the country of the Occupancy. Retrieve possible values by calling /Country/GetAllCountriesglobally unique identifierNone.
PostalCodeRepresents the Postal Code/Zip Code of the OccupancystringNone.
WebsiteRepresents the URL of the website associated with the OccupancystringNone.
PhoneRepresents the primary phone number of the OccupancystringNone.
DefaultBadgeTemplateIdRepresents the PK of the default Badge Template for the Occupancyglobally unique identifierNone.
DeletedRepresents the deleted status of the Occupancy. Should be false for an Add action,booleanNone.

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>