Creating Networks

Last updated: November 5th, 2019

Introduction

In these guide will see how to link many properties together in order to create an Access Network, and let the customer see all children properties in the same calendar

Required knowledge / points:
  • You MUST have read the start guide carefully.
  • You MUST be confident regarding how to create single properties.
  • You should know how HTTP APIs works
  • It's suggested to be confident with tools like curl

Network

What we're talking about?

Octorate describes an Accommodation by it's relative object. An accommodation could be for instance physical like two different located apartment or logical if the user needs to configure the rooms in different basic settings (i.e. an external service require two access for different rooms)

When the user notify the intention to have a single calendar for many properties, or the portal that we want to use, needs to know who's handling all these properties, we need to create a container for many properties.

This container in Octorate is called "Access Network", from here onwards shorted as "Network".

How Property networks works?

Let's make it work

Take care of schemas

Seeing our swagger documentation , when the API requires in body a JSON encoded text, near every json example, in the request body, you have a small tab voice called "Schema". Click it to see a description of each field

Case One: Create a new Network

Example of a call Try it / See updated schema
curl -X POST "{endpoint}/rest/accommodation/network?accommodation={idproperty}&accommodation={idproperty}" -H "Content-Type: application/json" -d {followingjson} -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}"

You can use this call to create a network of accommodations

Case Two: Add properties to existing network

Successfull Response

{
  "codice": [
    "116735"
  ],
  "status": "created"
}
                                            

The response here could be the new property (status created) or the id of previously created properties

Case of unsuccessful response and way to resolve
400 Like responses

{
  "element": "AccommodationForm",
  "message": "Field Information is required.",
  "nested": [
    {
      "human_name": "Latitude",
      "machine_name": "$.latitude",
      "message": "Field Latitude is required.",
      "type": "RejectRequired"
    },
    {
      "human_name": "Longitude",
      "machine_name": "$.longitude",
      "message": "Field Longitude is required.",
      "type": "RejectRequired"
    }
  ],
  "type": "ApiParamsExemption"
}
                                            

As the type information specify, some params could not be accepted. Prepare your application to process the information inside nested.

Tip: You can try to pass "Accept-Language:{ISO 2 LANG}" to check if a translation to your language is available

403/401 Like responses

{
  "nested": [],
  "type": "ApiKeyInvalid"
}
                                            

As the type information specify, you should check that the Api Key you've provided is invalid or check in headers of your call if the key and secrets are inserted