Keys

Please select from the following areas that document the functionality using our web api:

Authorization

You should have been provided an api key from Estates IT. This will identify you whenever a request is made to the api. The api key must be sent in the authorization header for every request that you make. If you do not supply the api key then you will receive a status code for unauthorized.

.NET Example:

using (var httpClient = new HttpClient())
{
    ...
    httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("{{apikey}}");
    ...
}

PHP Example:

$context = stream_context_create(array(
    'http' => array(
        'header' => "Authorization:" , {{apikey}}
    ),
));
Staff List

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/staff?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
LastUpdate DateTime Optional null If supplied will be used to match against the last update date on the record.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": "",                       

    // The content.
    "Content": [{

        // Staff identifer.
        "Id": "Bob",                   

        // Staff name.
        "Name": "Bob Smith"           

        // Staff email.
        "Email": "bob@test.com",

        // Staff mobile.
        "Mobile": "123456789",           

        // Staff position.
        "Position": "manager"
    }, {
        // Staff identifer.
        "Id": "Bill",                   

        // Staff name.
        "Name": "Bill Smith"           

        // Staff email.
        "Email": "bill@test.com",

        // Staff mobile.
        "Mobile": "987654321",           

        // Staff position.
        "Position": "negotiator"
    }]
}
Key List

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/keys?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
LastUpdate DateTime Optional null If supplied will be used to match against the last update date on the record.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": "",                       

    // The content.
    "Content": [{

        // Key identifier.
        "Id": "KEY01",                   

        // Key status.
        "Status": "I",                   

        // Key tag number.
        "Tag": "1000",                   

        // Property identifier.
        "PropertyId": "PROPERTY01",

        // Property address.
        "Address": "10 Test Street, Eltham, London, DA16 3EE."           
    }, {
        // Key identifier.
        "Id": "KEY02",                   

        // Key status.
        "Status": "O",                   

        // Key tag number.
        "Tag": "2000",                   

        // Property identifier.
        "PropertyId": "PROPERTY02",

        // Property address.
        "Address": "20 Test Street, Eltham, London, DA16 3EF."           
    }]
}

Where the key status is one of the following values:

Status Comments
I The key is currently booked in.
O The key is currently booked out.
F The key is currently being fixed.
R The key is currently being replaced.
L The key is currently lost.
B The key is currently broken.
N The key has no booking.
Key Status By Id

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/statusbyid?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
KeyId String Mandatory N/A The key identifier.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": "",                       

    // The result.
    "Content": [{
                    
        // Key identifier.
        "Id": "KEY01",                   

        // Key status.
        "Status": "I"                   
    }
}

NOTE See key list for status codes.

Key Status By Tag

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/statusbytag?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
KeyTag String Mandatory N/A The key tag.
PropertyId String Optional N/A The property identifier.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": "",                       

    // The result.
    "Content": [{
                    
        // Key identifier.
        "Id": "KEY01",                   

        // Key status.
        "Status": "I"                   
    }
}

NOTE See key list for status codes.

Key Book Out By Id

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/bookoutbyid?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
KeyId String Mandatory N/A The key identifier.
StaffId String Mandatory N/A The staff identifier.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": ""
}
Key Book Out By Tag

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/bookoutbytag?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
KeyTag String Mandatory N/A The key tag.
PropertyId String Optional N/A The property identifier.
StaffId String Mandatory N/A The staff identifier.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": ""
}
Key Book In By Id

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/bookinbyid?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
KeyId String Mandatory N/A The key identifier.
StaffId String Mandatory N/A The staff identifier.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": ""
}
Key Book In By Tag

To access this api call use the following url:

[GET]https://pchomes.estatesit.uk/v7.0/api/keys/bookinbytag?{{parameters}}

Parameter Format

The web api accepts the following http encoded query parameter(s):

Name Format Type Default Comments
KeyTag String Mandatory N/A The key tag.
PropertyId String Optional N/A The property identifier.
StaffId String Mandatory N/A The staff identifier.

Return Format

The web api call will return the results using the following JSON format (excluding comments):

{
    // The processing date in ISO8601 format.
    "Date": "2018-06-29T09:44:35Z",

    // The resulting http status code.
    "StatusCode": 200,                  

    // One or more errors.
    "Errors": ""
}
Return Codes

The following return codes can be returned from the api service:

Code Comments
200 The current request was successful.
204 The current request has not found any content matching the search criteria.
401 The authorization key is invalid.
403 The authorization key not supplied, or forbidden.
404 The current request has returned no content.
Examples

The following examples show how to access the web api.

.NET Example:

// Build up the api request string for any search parameters required.
var apiUrl = "https://pchomes.estatesit.uk/v7.0/api/keys/staff?lastUpdateDate=01/01/2015";

// Create http client.
using (var httpClient = new HttpClient())
{
    httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("{{apikey}}");
    var httpResponseMessage = await httpClient.GetAsync(apiUrl);
    Console.WriteLine(httpResponseMessage.StatusCode.ToString());
    var response = await httpResponseMessage.Content.ReadAsStringAsync();
    var xmlDocument = new XmlDocument();
    xmlDocument.LoadXml(response);
    ...
}

PHP Example:

// Build up the api request string for any search parameters required.
$api_url = "https://pchomes.estatesit.uk/v7.0/api/keys/staff?lastUpdateDate=01/01/2015";

// Create context with the authorisation header.
$context = stream_context_create(array(
    'http' => array(
        'header' => "Authorization:" , {{apikey}}
    ),
));
// Get the contents of the url request.
$result = file_get_contents($api_url, false, $context);
Back Programming Example Programming Sandbox

Use of this software must be in accordance with the Estates IT ™ Limited licence agreement and implies acceptance of the terms stated therein.

Warning: This computer program is protected by copyright law and international treaties. Unauthorised reproduction or distribution of this program, or any portion of it, may result in severe civil or criminal penalties, and will be prosecuted.

By using the Web API provided by Estates IT you agree to our full list of terms and conditions.