# Property Listing

Retrieves the list of Properties created by PMS.

This <mark style="color:blue;">**GET**</mark> method designed to retrieve all the important details of the properties that are present in the database.

### <mark style="color:yellow;">Endpoint</mark> <a href="#propertylisting-endpoint" id="propertylisting-endpoint"></a>

<mark style="color:blue;background-color:blue;">**`GET`**</mark>&#x20;

<div align="left"><figure><img src="https://958347541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM9bn2UcBkeqtqixkl5eF%2Fuploads%2FHpyoT0sTR5VA3RkkSOl8%2FSandbox%20image.png?alt=media&#x26;token=45811e1e-b22d-413a-a355-32135a85258e" alt="" width="56"><figcaption></figcaption></figure></div>

{% code overflow="wrap" %}
```url
https://connect-sandbox.su-api.com/SUAPI/jservice/pmsproperty
```
{% endcode %}

***

### <mark style="color:yellow;">Sample Request</mark>

To get a list of properties that have already been created, the Property Management System (PMS) needs to send a <mark style="color:blue;">**GET**</mark> request. This request must include the Authorization (API) Key.

Here's what you need to do:

1. **Send a GET Request**: The PMS will send a GET request to the specified endpoint.
2. **Include the API Key**: You must include your unique API Authorization Key in the request header. The body of the request should be empty.
3. **Parameters**: The request should have an element named "request" and an attribute named "Authorization" in the header.

***

### <mark style="color:yellow;">Response</mark> <a href="#propertylisting-response" id="propertylisting-response"></a>

#### <mark style="color:green;">Success</mark> <a href="#propertylisting-success" id="propertylisting-success"></a>

If the authorization gets pass successfully, you retrieve the list of properties with all the details such as property id, property name, and the current status of the property. properties object returns all the listed properties.

#### <mark style="color:blue;">properties array</mark>

properties array contains all the listed properties as an object with all the details.

#### <mark style="color:purple;">property object</mark>

`propertyid` <mark style="color:orange;">**string**</mark>

Unique id of the property.

***

`propertyname` <mark style="color:orange;">**string**</mark>

Name of the property.

***

`status` <mark style="color:orange;">**string**</mark>

Current status of the property.

***

`roomcount` <mark style="color:orange;">**string**</mark>

Room count in the property.

#### <mark style="color:green;">**Sample Success Response**</mark>

```json
{
  "properties": [
    {
      "propertyid": "11122010",
      "propertyname": "The Rosehotel Motel",
      "status": "Active",
      "roomcount": "13"
    },
    {
      "propertyid": "11122011",
      "propertyname": "Malin House",
      "status": "Active",
      "roomcount": "20"
    },
    {
      "propertyid": "101010",
      "propertyname": "Fake Hotel",
      "status": "Active",
      "roomcount": "15"
    },
    {
      "propertyid": "P103",
      "propertyname": "The Grand Bhagawati",
      "status": "Active",
      "roomcount": "25"
    }
  ]
}
```

***

#### <mark style="color:red;">Error</mark> <a href="#propertylisting-error" id="propertylisting-error"></a>

You may receive HTTP code 401 Unauthorized Error, if allocated with incorrect API Authorization Key.&#x20;

#### <mark style="color:red;">**Sample Error Response (497)**</mark>

```json
{
  "Status": "Fail",
  "Errors": {
    "Code": "497",
    "ShortText": "Authorization Required"
  }
}
```
