NAV Navigation
Shell HTTP JavaScript Node.JS Ruby Python Java Go

Ochno Operated Portal API - Full reference v0.1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Ochno Operated Portal

Base URLs:

Authentication

Accounts

Log in

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/auth/local \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST https://operated.ochno.com/auth/local HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

$.ajax({
  url: 'https://operated.ochno.com/auth/local',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "email": "string",
  "password": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

fetch('https://operated.ochno.com/auth/local',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://operated.ochno.com/auth/local',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://operated.ochno.com/auth/local', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/auth/local");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/auth/local", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /auth/local

Log in to the portal using an email and password.

Body parameter

{
  "email": "string",
  "password": "string"
}

Parameters

Name In Type Required Description
body body authBody true none

Example responses

200 Response

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Responses

Status Meaning Description Schema
200 OK Login was successful. User
400 Bad Request Login was unsuccessful. None
500 Internal Server Error Server failure. None

Log out

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/auth/logout \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/auth/logout HTTP/1.1
Host: operated.ochno.com

var headers = {
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/auth/logout',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/auth/logout',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/auth/logout',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/auth/logout', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/auth/logout");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/auth/logout", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /auth/logout

Log out of the portal no matter how the user is logged in.

Responses

Status Meaning Description Schema
200 OK The user is logged out. None

Retrieve JWT

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/auth/jwt \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST https://operated.ochno.com/auth/jwt HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

$.ajax({
  url: 'https://operated.ochno.com/auth/jwt',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "email": "string",
  "password": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

fetch('https://operated.ochno.com/auth/jwt',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://operated.ochno.com/auth/jwt',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://operated.ochno.com/auth/jwt', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/auth/jwt");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/auth/jwt", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /auth/jwt

Returns a json web token for the given user.

Body parameter

{
  "email": "string",
  "password": "string"
}

Parameters

Name In Type Required Description
body body authBody true none

Example responses

200 Response

{
  "token": "string"
}

Responses

Status Meaning Description Schema
200 OK Login was successful. Send the token in an "Authorization:'JWT %token%'" header in subsequent requests. Inline
400 Bad Request Login was unsuccessful. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» token string false none none

Retrieve user account

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/auth/user/data \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/auth/user/data HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/auth/user/data',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/auth/user/data',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/auth/user/data',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/auth/user/data', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/auth/user/data");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/auth/user/data", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /auth/user/data

Returns the user object of the currently logged in user account.

Example responses

200 Response

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Responses

Status Meaning Description Schema
200 OK User data of the logged in user. User
400 Bad Request Nu user was logged in. None

Companies

List all companies

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/companies \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/companies HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/companies',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/companies',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/companies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/companies', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/companies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/companies

Returns a list of your companies.

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "name": "string",
    "type": "Utility",
    "logotype": "string",
    "website": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of companies that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
» anonymous NewCompany false none none
»» name string true none The name of the company.
»» type string true none What type of company it is.
»» logotype string false none The URL to an image file.
»» website string false none The URL to a company webpage.

Enumerated Values

Property Value
type Utility
type Building Tenant
type OEM
type Building Owner
type Other

Retrieve company

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/companies/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/companies/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/companies/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/companies/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/companies/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/companies/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/companies/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/companies/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/companies/{id}

Retrieves the details of a company with the supplied id.

Parameters

Name In Type Required Description
id path string true The company Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}

Responses

Status Meaning Description Schema
200 OK The company object. Company
400 Bad Request No such company. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace company

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/companies/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/companies/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/companies/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/companies/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/companies/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/companies/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/companies/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/companies/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/companies/{id}

Replaces the specific company with the supplied values. Role required Company Admin

Body parameter

{
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}

Parameters

Name In Type Required Description
id path string true The company Id.
body body NewCompany true none

Example responses

200 Response

{
  "id": "string",
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated company object. Company
400 Bad Request No such company. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Retrieve iot access token for company

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/companies/{id}/iotAccess \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/companies/{id}/iotAccess HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/companies/{id}/iotAccess',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/companies/{id}/iotAccess',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/companies/{id}/iotAccess',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/companies/{id}/iotAccess', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/companies/{id}/iotAccess");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/companies/{id}/iotAccess", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/companies/{id}/iotAccess

Retrieves an iot access token for a company with the supplied id.

Parameters

Name In Type Required Description
id path string true The company Id.

Example responses

200 Response

{
  "accessKeyId": "string",
  "secretKey": "string",
  "sessionToken": "string",
  "expiration": "string",
  "region": "string",
  "host": "string"
}

Responses

Status Meaning Description Schema
200 OK Access tokens for iot. iotAccess
400 Bad Request No such company. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace company logotype

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/companies/{id}/logotype \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/companies/{id}/logotype HTTP/1.1
Host: operated.ochno.com
Content-Type: multipart/form-data
Accept: application/json

var headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/companies/{id}/logotype',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = 'string';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/companies/{id}/logotype',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/companies/{id}/logotype',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/companies/{id}/logotype', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/companies/{id}/logotype");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/companies/{id}/logotype", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/companies/{id}/logotype

Replaces the specific company's logotype with the uploaded image. Role required Company Admin

Body parameter

string

Parameters

Name In Type Required Description
id path string true The company Id.
body body string(binary) true The logotype file. Maximum file size 10MB.

Example responses

200 Response

{
  "id": "string",
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated company object. Company
400 Bad Request No such company. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

FloorPlans

List all floor plans

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/floorplans \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/floorplans HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/floorplans',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/floorplans',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/floorplans',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/floorplans', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/floorplans");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/floorplans", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/floorplans

Returns a list of your floor plans.

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "locationId": "string",
    "name": "string",
    "image": "string",
    "ports": {
      "portId": "string",
      "point": [
        0,
        0
      ],
      "layer": "ceiling"
    },
    "sections": {
      "_id": "string",
      "name": "string",
      "points": [
        [
          0,
          0
        ],
        [
          0,
          0
        ],
        [
          0,
          0
        ]
      ],
      "tenantIds": "string"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK An array of floor plans that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
» anonymous NewFloorPlan false none none
»» locationId string true none The id of the location that this floor plan belongs to.
»» name string true none The name of the floor plan.
»» image string false none The image of the floor plan, the origo, [0,0], is the center of the image.
»» ports object false none The ports belonging to the floor plan, along with their map properties.
»»» portId string false none The id of the port.
»»» point [number] false none The [x,y] point of the port on the floor plan image. Note that the origo, [0,0], is the center of the image.
»»» layer string false none What layer the port is in.
»» sections object false none The sections belonging to the floor plan.
»»» _id string false none none
»»» name string false none The name of the section.
»»» points [array] false none An array of the [x,y] points of the section's anchors on the floor plan image. Must be at least 3 points.
»»» tenantIds string false none Tenants, or rather other companies, that have access to this section, but this section alone.

Enumerated Values

Property Value
layer ceiling
layer wall
layer floor
layer furniture

Create floor plan

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/floorplans \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/floorplans HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/floorplans',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/floorplans',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/floorplans',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/floorplans', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/floorplans");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/floorplans", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/floorplans

Create a new floor plan object. Role required Company Admin or Company User

Body parameter

{
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Parameters

Name In Type Required Description
body body NewFloorPlan true none

Example responses

200 Response

{
  "id": "string",
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK A floor plan was successfully created and the new floor plan object is returned. FloorPlan
400 Bad Request No location to add floor plan to. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access the location supplied. None
500 Internal Server Error Server failure. None

Retrieve floor plan

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/floorplans/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/floorplans/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/floorplans/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/floorplans/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/floorplans/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/floorplans/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/floorplans/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/floorplans/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/floorplans/{id}

Retrieves the details of a floor plan with the supplied id.

Parameters

Name In Type Required Description
id path string true The floor plan Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK The floor plan object. FloorPlan
400 Bad Request No such floor plan. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace floor plan

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/floorplans/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/floorplans/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/floorplans/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/floorplans/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/floorplans/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/floorplans/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/floorplans/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/floorplans/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/floorplans/{id}

Replaces the specific floor plan with the supplied values. Role required Company Admin or Company User

Body parameter

{
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Parameters

Name In Type Required Description
id path string true The floor plan Id.
body body NewFloorPlan true none

Example responses

200 Response

{
  "id": "string",
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK The updated floor plan object. FloorPlan
400 Bad Request No such floor plan. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Delete floor plan

Code samples

# You can also use wget
curl -X DELETE https://operated.ochno.com/api/floorplans/{id} \
  -H 'Authorization: JWT {access-token}'

DELETE https://operated.ochno.com/api/floorplans/{id} HTTP/1.1
Host: operated.ochno.com

var headers = {
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/floorplans/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/floorplans/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.delete 'https://operated.ochno.com/api/floorplans/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'JWT {access-token}'
}

r = requests.delete('https://operated.ochno.com/api/floorplans/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/floorplans/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://operated.ochno.com/api/floorplans/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /api/floorplans/{id}

Delete a specific floor plan and all of its hubs, ports and rules. Role required Company Admin or Company User

Parameters

Name In Type Required Description
id path string true The floor plan Id.

Responses

Status Meaning Description Schema
200 OK Deleted successfully. None
400 Bad Request No such floor plan. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace floor plan image

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/floorplans/{id}/image \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/floorplans/{id}/image HTTP/1.1
Host: operated.ochno.com
Content-Type: multipart/form-data
Accept: application/json

var headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/floorplans/{id}/image',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = 'string';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/floorplans/{id}/image',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/floorplans/{id}/image',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/floorplans/{id}/image', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/floorplans/{id}/image");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/floorplans/{id}/image", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/floorplans/{id}/image

Replaces the specific floor plan's image with the uploaded image. Role required Company Admin or Company User

Body parameter

string

Parameters

Name In Type Required Description
id path string true The floor plan Id.
body body string(binary) true The image file. Maximum file size 10MB.

Example responses

200 Response

{
  "id": "string",
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK The updated floor plan object. FloorPlan
400 Bad Request No such floor plan. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Hubs

List all hubs

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/hubs \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/hubs HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/hubs',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/hubs',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/hubs',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/hubs', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/hubs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/hubs", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/hubs

Returns a list of your hubs.

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "data": {},
    "hwId": "string",
    "floorPlanId": "string",
    "name": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of hubs that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.
»» data object false none Data supplied by the hardware hub.

and

Name Type Required Restrictions Description
» anonymous NewHub false none none
»» hwId string true none The id on the physical hub hardware.
»» floorPlanId string true none The id of the floor plan that this hub belongs to.
»» name string false none The name of the hub.

Create hub

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/hubs \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/hubs HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/hubs',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/hubs',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/hubs',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/hubs', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/hubs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/hubs", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/hubs

Create a new hub object. Role required Company Admin or Company User

Body parameter

{
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Parameters

Name In Type Required Description
body body NewHub true none

Example responses

200 Response

{
  "id": "string",
  "data": {},
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK A hub was successfully created and the new hub object is returned. Hub
400 Bad Request No floor plan to add hub to. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access the floor plan supplied. None
500 Internal Server Error Server failure. None

Retrieve hub

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/hubs/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/hubs/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/hubs/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/hubs/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/hubs/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/hubs/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/hubs/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/hubs/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/hubs/{id}

Retrieves the details of a hub with the supplied id.

Parameters

Name In Type Required Description
id path string true The hub Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "data": {},
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK The hub object. Hub
400 Bad Request No such hub. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace hub

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/hubs/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/hubs/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/hubs/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/hubs/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/hubs/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/hubs/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/hubs/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/hubs/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/hubs/{id}

Replaces the specific hub with the supplied values. This does not change the data values. Role required Company Admin or Company User

Body parameter

{
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Parameters

Name In Type Required Description
id path string true The hub Id.
body body NewHub true none

Example responses

200 Response

{
  "id": "string",
  "data": {},
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated hub object. Hub
400 Bad Request No such hub. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Delete hub

Code samples

# You can also use wget
curl -X DELETE https://operated.ochno.com/api/hubs/{id} \
  -H 'Authorization: JWT {access-token}'

DELETE https://operated.ochno.com/api/hubs/{id} HTTP/1.1
Host: operated.ochno.com

var headers = {
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/hubs/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/hubs/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.delete 'https://operated.ochno.com/api/hubs/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'JWT {access-token}'
}

r = requests.delete('https://operated.ochno.com/api/hubs/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/hubs/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://operated.ochno.com/api/hubs/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /api/hubs/{id}

Delete a specific hub and all of its ports. Role required Company Admin or Company User

Parameters

Name In Type Required Description
id path string true The hub Id.

Responses

Status Meaning Description Schema
200 OK Deleted successfully. None
400 Bad Request No such hub. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Retrieve hub by hw id

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/hubs/hwId/{hwId} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/hubs/hwId/{hwId} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/hubs/hwId/{hwId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/hubs/hwId/{hwId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/hubs/hwId/{hwId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/hubs/hwId/{hwId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/hubs/hwId/{hwId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/hubs/hwId/{hwId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/hubs/hwId/{hwId}

Retrieves the details of a hub that has the suppleid physical hub hardware id.

Parameters

Name In Type Required Description
hwId path string true The id on the physical hub hardware.

Example responses

200 Response

{
  "id": "string",
  "data": {},
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK The hub object. Hub
400 Bad Request No such hub. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Locations

List all locations

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/locations \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/locations HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/locations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/locations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/locations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/locations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/locations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/locations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/locations

Returns a list of your locations.

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "companyId": "string",
    "name": "string",
    "address": "string",
    "tags": [
      "string"
    ],
    "photo": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of locations that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
» anonymous NewLocation false none none
»» companyId string true none The id of the company that this location belongs to.
»» name string true none The name of the location.
»» address string false none The address of the location.
»» tags [string] false none Tags related to the location.
»» photo string(url) false none The URL to an image file.

Create location

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/locations \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/locations HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/locations',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/locations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/locations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/locations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/locations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/locations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/locations

Create a new location object. Role required Company Admin

Body parameter

{
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Parameters

Name In Type Required Description
body body NewLocation true none

Example responses

200 Response

{
  "id": "string",
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Responses

Status Meaning Description Schema
200 OK A location was successfully created and the new location object is returned. Location
400 Bad Request No such company to add location to. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access the company supplied. None
500 Internal Server Error Server failure. None

Retrieve location

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/locations/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/locations/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/locations/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/locations/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/locations/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/locations/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/locations/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/locations/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/locations/{id}

Retrieves the details of a location with the supplied id.

Parameters

Name In Type Required Description
id path string true The location Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Responses

Status Meaning Description Schema
200 OK The location object. Location
400 Bad Request No such location. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace location

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/locations/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/locations/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/locations/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/locations/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/locations/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/locations/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/locations/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/locations/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/locations/{id}

Replaces the specific location with the supplied values. Role required Company Admin

Body parameter

{
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Parameters

Name In Type Required Description
id path string true The location Id.
body body NewLocation true none

Example responses

200 Response

{
  "id": "string",
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated location object. Location
400 Bad Request No such location. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Delete location

Code samples

# You can also use wget
curl -X DELETE https://operated.ochno.com/api/locations/{id} \
  -H 'Authorization: JWT {access-token}'

DELETE https://operated.ochno.com/api/locations/{id} HTTP/1.1
Host: operated.ochno.com

var headers = {
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/locations/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/locations/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.delete 'https://operated.ochno.com/api/locations/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'JWT {access-token}'
}

r = requests.delete('https://operated.ochno.com/api/locations/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/locations/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://operated.ochno.com/api/locations/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /api/locations/{id}

Delete a specific location and all of its floor plans, hubs, ports and rules. Role required Company Admin

Parameters

Name In Type Required Description
id path string true The location Id.

Responses

Status Meaning Description Schema
200 OK Deleted successfully. None
400 Bad Request No such location. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace location photo

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/locations/{id}/photo \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/locations/{id}/photo HTTP/1.1
Host: operated.ochno.com
Content-Type: multipart/form-data
Accept: application/json

var headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/locations/{id}/photo',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = 'string';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/locations/{id}/photo',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/locations/{id}/photo',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/locations/{id}/photo', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/locations/{id}/photo");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/locations/{id}/photo", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/locations/{id}/photo

Replaces the specific location's photo with the uploaded image. Role required Company Admin

Body parameter

string

Parameters

Name In Type Required Description
id path string true The location Id.
body body string(binary) true The photo file. Maximum file size 10MB.

Example responses

200 Response

{
  "id": "string",
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated location object. Location
400 Bad Request No such location. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Metrics

List all measurements

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/metrics \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/metrics HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/metrics',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/metrics',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/metrics',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/metrics', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/metrics");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/metrics", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/metrics

Returns a list of the measurements that exist in the metrics.

Example responses

200 Response

[
  "string"
]

Responses

Status Meaning Description Schema
200 OK All measurements available to extract metrics from. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Retrieve metrics

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/metrics/{measurement} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/metrics/{measurement} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/metrics/{measurement}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/metrics/{measurement}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/metrics/{measurement}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/metrics/{measurement}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/metrics/{measurement}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/metrics/{measurement}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/metrics/{measurement}

Returns metrics from the supplied measurement.

Parameters

Name In Type Required Description
measurement path string true The measurement table to look in.
fields query string false The fields that should be returned by the query. Example fields=companyId. Note that time is always returned. Multiple fields can be picked by using multiple fields. Example fields=companyId&fields=power. Fields can be renamed by supplying values separated by ','. Example fields=power,W. It is also possible to use a function in the place of the field. Example fields=MEAN(power) Available functions are listed here https://docs.influxdata.com/influxdb/v1.6/query_language/functions/
where query string false An sql-like "where" expression. Do not use ids for company or port, etc, in this parameter. Example where=time >= 1539248074602ms. You can specify multiple expressions using AND or OR in the expression. Multiple where is the same as using AND. Example where=time >= 1539248074602ms AND power > 1000.
companyId query string false Filter expression based on companyId. Use this query parameter instead of including companyId in your where parameter! Example companyId=5b7fd210cfc0306901694195.
locationId query string false Filter expression based on locationId. Use this query parameter instead of including locationId in your where parameter! Example locationId=5b7fd210cfc0306901694195.
floorPlanId query string false Filter expression based on floorPlanId. Use this query parameter instead of including floorPlanId in your where parameter! Example floorPlanId=5b7fd210cfc0306901694195.
portId query string false Filter expression based on portId. Use this query parameter instead of including portId in your where parameter! Example portId=5b7fd210cfc0306901694195.
group query string false Group the results by the values of a certain field. Works well with aggregation functions. Example group=locationId.
sort query string false Metrics can only be sorted on time. Example sort=-time.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "time": "2019-04-26T11:07:01Z",
    "field*": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of metrics that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [metric] false none none
» time string(date-time) false none Timestamp for the metric data.
» field* any false none Fields related to the port. There can be multiple fields and they vary depending on the measurement you choose. To find out the fields of a measurement you can request /api/metrics/powerSense?limit=1

oneOf

Name Type Required Restrictions Description
»» anonymous string false none none

xor

Name Type Required Restrictions Description
»» anonymous number false none none

Ports

List all ports

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/ports \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/ports HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/ports',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/ports',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/ports',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/ports', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/ports");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/ports", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/ports

Returns a list of your ports.

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "data": {},
    "hubId": "string",
    "position": "string",
    "name": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of ports that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.
»» data object false none Data supplied by the hardware port.

and

Name Type Required Restrictions Description
» anonymous NewPort false none none
»» hubId string true none The id of the hub that this port belongs to.
»» position string false none none
»» name string false none The name of the port.

Retrieve port

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/ports/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/ports/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/ports/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/ports/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/ports/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/ports/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/ports/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/ports/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/ports/{id}

Retrieves the details of a port with the supplied id.

Parameters

Name In Type Required Description
id path string true The port Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "data": {},
  "hubId": "string",
  "position": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK The port object. Port
400 Bad Request No such port. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace port

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/ports/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/ports/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/ports/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "hubId": "string",
  "position": "string",
  "name": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/ports/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/ports/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/ports/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/ports/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/ports/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/ports/{id}

Replaces the specific port with the supplied values. This does not change the data values. Role required Company Admin or Company User

Body parameter

{
  "hubId": "string",
  "position": "string",
  "name": "string"
}

Parameters

Name In Type Required Description
id path string true The port Id.
body body NewPort true none

Example responses

200 Response

{
  "id": "string",
  "data": {},
  "hubId": "string",
  "position": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated port object. Port
400 Bad Request No such port. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Rules

List all rules

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/rules \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/rules HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/rules',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/rules',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/rules',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/rules', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/rules");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/rules", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/rules

Returns a list of your rules.

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "floorPlanId": "string",
    "name": "string",
    "sections": [
      "string"
    ],
    "layers": [
      "ceiling"
    ],
    "ports": [
      "string"
    ],
    "autoAdd": true,
    "data": {}
  }
]

Responses

Status Meaning Description Schema
200 OK An array of rules that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
» anonymous NewRule false none none
»» floorPlanId string true none The id of the floor plan that this hub belongs to.
»» name string false none The name of the rule.v
»» sections [string] false none If autoAdd is enabled, new ports added to these sections and layers are automatically added to the rule, removed ports are automatically removed.
»» layers [string] false none If autoAdd is enabled, new ports added to these layers and sections are automatically added to the rule, removed ports are automatically removed.
»» ports [string] false none The ids of the ports that this rule controls.
»» autoAdd boolean false none If enabled, new ports in the floor plan will automatically be added, if they are in the sections and layers specified in the rule.
»» data object false none Rule configuration.

Create rule

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/rules \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/rules HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/rules',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/rules',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/rules',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/rules', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/rules");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/rules", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/rules

Create a new rule object. Role required Company Admin or Company User

Body parameter

{
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Parameters

Name In Type Required Description
body body NewRule true none

Example responses

200 Response

{
  "id": "string",
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK A rule was successfully created and the new rule object is returned. Rule
400 Bad Request No floor plan to add rule to. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access the floor plan supplied. None
500 Internal Server Error Server failure. None

Retrieve rule

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/rules/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/rules/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/rules/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/rules/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/rules/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/rules/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/rules/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/rules/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/rules/{id}

Retrieves the details of a rule with the supplied id.

Parameters

Name In Type Required Description
id path string true The rule Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK The rule object. Rule
400 Bad Request No such rule. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Replace rule

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/rules/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/rules/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/rules/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/rules/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/rules/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/rules/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/rules/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/rules/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/rules/{id}

Replaces the specific rule with the supplied values. Role required Company Admin or Company User

Body parameter

{
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Parameters

Name In Type Required Description
id path string true The rule Id.
body body NewRule true none

Example responses

200 Response

{
  "id": "string",
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK The updated rule object. Rule
400 Bad Request No such rule. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Delete rule

Code samples

# You can also use wget
curl -X DELETE https://operated.ochno.com/api/rules/{id} \
  -H 'Authorization: JWT {access-token}'

DELETE https://operated.ochno.com/api/rules/{id} HTTP/1.1
Host: operated.ochno.com

var headers = {
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/rules/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/rules/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.delete 'https://operated.ochno.com/api/rules/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'JWT {access-token}'
}

r = requests.delete('https://operated.ochno.com/api/rules/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/rules/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://operated.ochno.com/api/rules/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /api/rules/{id}

Delete a specific rule. Role required Company Admin or Company User

Parameters

Name In Type Required Description
id path string true The rule Id.

Responses

Status Meaning Description Schema
200 OK Deleted successfully. None
400 Bad Request No such rule. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have the proper permission to access this resource. None
500 Internal Server Error Server failure. None

Users

List all users

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/users \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/users HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/users',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/users',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/users',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/users', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/users", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/users

Returns a list of the users that are in the same companies as you..

Parameters

Name In Type Required Description
$property name$ query string false Filter a query based on property values and return only those that match. Example could be position=Kontoret. For multiple values position=Kontoret&position=Receptionen.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.
sort query string false Return a query sorted by the value. Multiple fields can be picked by separating them with a space. Example sort=name -position.
limit query integer false Limit the numbers of items to return. Example limit=50.
offset query integer false The number of items to skip before starting to collect the result set. Works well in combination with the limit query. Example skip=50.

Example responses

200 Response

[
  {
    "id": "string",
    "provider": "local",
    "email": "user@example.com",
    "password": "pa$$word",
    "type": "admin",
    "roles": {
      "companyAdmin": [
        "string"
      ],
      "companyUser": [
        "string"
      ],
      "companyGuest": [
        "string"
      ]
    },
    "profile": {
      "fullName": "string",
      "picture": "string",
      "locale": "en"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK An array of users that corresponds to your given parameters. Inline
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [allOf] false none none

allOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
» anonymous NewUser false none none
»» provider string false none The authorization provider.
»» email string(email) true none The email of the user. Must be unique.
»» password string(password) true none The user's password.
»» type string false none What type of user it is.
»» roles object false none The permission roles the user has. It is in three different company categories.
»»» companyAdmin [string] false none Company ids.
»»» companyUser [string] false none Company ids.
»»» companyGuest [string] false none Company ids.
»» profile object false none none
»»» fullName string false none none
»»» picture string(url) false none url to an image file.
»»» locale string false none The language the user prefers.

Create user

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/users \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/users HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/users',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/users',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/users',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/users', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/users", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/users

Create a new user object. Role required Company Admin

Body parameter

{
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Parameters

Name In Type Required Description
body body NewUser true none

Example responses

200 Response

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Responses

Status Meaning Description Schema
200 OK A user was successfully created and the new user object is returned. User
400 Bad Request The supplied user data is malformed. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have permission to do this. None
500 Internal Server Error Server failure. None

Retrieve user

Code samples

# You can also use wget
curl -X GET https://operated.ochno.com/api/users/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

GET https://operated.ochno.com/api/users/{id} HTTP/1.1
Host: operated.ochno.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/users/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/users/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.get 'https://operated.ochno.com/api/users/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.get('https://operated.ochno.com/api/users/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/users/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://operated.ochno.com/api/users/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/users/{id}

Retrieves the details of a user with the supplied id.

Parameters

Name In Type Required Description
id path string true The user Id.
fields query string false The fields returned by the query. Note that id is always returned. Multiple fields can be picked by separating them with a space. Example fields=name position.

Example responses

200 Response

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Responses

Status Meaning Description Schema
200 OK The user object. User
400 Bad Request No such user or the user cannot access it. None
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Replace user

Code samples

# You can also use wget
curl -X PUT https://operated.ochno.com/api/users/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

PUT https://operated.ochno.com/api/users/{id} HTTP/1.1
Host: operated.ochno.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/users/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/users/{id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.put 'https://operated.ochno.com/api/users/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.put('https://operated.ochno.com/api/users/{id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/users/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://operated.ochno.com/api/users/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /api/users/{id}

Replaces the specific user with the supplied values. All users can update their own properties, Company Admin can update other's as well.

Body parameter

{
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Parameters

Name In Type Required Description
id path string true The user Id.
body body NewUser true none

Example responses

200 Response

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Responses

Status Meaning Description Schema
200 OK The updated user object. User
400 Bad Request The supplied user data is malformed or there is no such user or the user cannot access it. None
401 Unauthorized No user logged in. None
403 Forbidden User does not have permission to do this. None
500 Internal Server Error Server failure. None

Replace user picture

Code samples

# You can also use wget
curl -X POST https://operated.ochno.com/api/users/{id}/picture \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT {access-token}'

POST https://operated.ochno.com/api/users/{id}/picture HTTP/1.1
Host: operated.ochno.com
Content-Type: multipart/form-data
Accept: application/json

var headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

$.ajax({
  url: 'https://operated.ochno.com/api/users/{id}/picture',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = 'string';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'JWT {access-token}'

};

fetch('https://operated.ochno.com/api/users/{id}/picture',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'Authorization' => 'JWT {access-token}'
}

result = RestClient.post 'https://operated.ochno.com/api/users/{id}/picture',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'JWT {access-token}'
}

r = requests.post('https://operated.ochno.com/api/users/{id}/picture', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://operated.ochno.com/api/users/{id}/picture");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"JWT {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://operated.ochno.com/api/users/{id}/picture", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/users/{id}/picture

Replaces the specific user's picture with the uploaded image. All users can update their own picture, Company Admin can update other's as well.

Body parameter

string

Parameters

Name In Type Required Description
id path string true The user Id.
body body string(binary) true The picture file. Maximum file size 10MB.

Example responses

200 Response

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Responses

Status Meaning Description Schema
200 OK The updated user object. User
400 Bad Request No such user or the user cannot access it. None
401 Unauthorized No user logged in. None
500 Internal Server Error Server failure. None

Schemas

Company

{
  "id": "string",
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
anonymous NewCompany false none none

NewCompany

{
  "name": "string",
  "type": "Utility",
  "logotype": "string",
  "website": "string"
}

Properties

Name Type Required Restrictions Description
name string true none The name of the company.
type string true none What type of company it is.
logotype string false none The URL to an image file.
website string false none The URL to a company webpage.

Enumerated Values

Property Value
type Utility
type Building Tenant
type OEM
type Building Owner
type Other

FloorPlan

{
  "id": "string",
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
anonymous NewFloorPlan false none none

NewFloorPlan

{
  "locationId": "string",
  "name": "string",
  "image": "string",
  "ports": {
    "portId": "string",
    "point": [
      0,
      0
    ],
    "layer": "ceiling"
  },
  "sections": {
    "_id": "string",
    "name": "string",
    "points": [
      [
        0,
        0
      ],
      [
        0,
        0
      ],
      [
        0,
        0
      ]
    ],
    "tenantIds": "string"
  }
}

Properties

Name Type Required Restrictions Description
locationId string true none The id of the location that this floor plan belongs to.
name string true none The name of the floor plan.
image string false none The image of the floor plan, the origo, [0,0], is the center of the image.
ports object false none The ports belonging to the floor plan, along with their map properties.
» portId string false none The id of the port.
» point [number] false none The [x,y] point of the port on the floor plan image. Note that the origo, [0,0], is the center of the image.
» layer string false none What layer the port is in.
sections object false none The sections belonging to the floor plan.
» _id string false none none
» name string false none The name of the section.
» points [array] false none An array of the [x,y] points of the section's anchors on the floor plan image. Must be at least 3 points.
» tenantIds string false none Tenants, or rather other companies, that have access to this section, but this section alone.

Enumerated Values

Property Value
layer ceiling
layer wall
layer floor
layer furniture

Hub

{
  "id": "string",
  "data": {},
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.
» data object false none Data supplied by the hardware hub.

and

Name Type Required Restrictions Description
anonymous NewHub false none none

NewHub

{
  "hwId": "string",
  "floorPlanId": "string",
  "name": "string"
}

Properties

Name Type Required Restrictions Description
hwId string true none The id on the physical hub hardware.
floorPlanId string true none The id of the floor plan that this hub belongs to.
name string false none The name of the hub.

Location

{
  "id": "string",
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
anonymous NewLocation false none none

NewLocation

{
  "companyId": "string",
  "name": "string",
  "address": "string",
  "tags": [
    "string"
  ],
  "photo": "string"
}

Properties

Name Type Required Restrictions Description
companyId string true none The id of the company that this location belongs to.
name string true none The name of the location.
address string false none The address of the location.
tags [string] false none Tags related to the location.
photo string(url) false none The URL to an image file.

Port

{
  "id": "string",
  "data": {},
  "hubId": "string",
  "position": "string",
  "name": "string"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.
» data object false none Data supplied by the hardware port.

and

Name Type Required Restrictions Description
anonymous NewPort false none none

NewPort

{
  "hubId": "string",
  "position": "string",
  "name": "string"
}

Properties

Name Type Required Restrictions Description
hubId string true none The id of the hub that this port belongs to.
position string false none none
name string false none The name of the port.

Rule

{
  "id": "string",
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
anonymous NewRule false none none

NewRule

{
  "floorPlanId": "string",
  "name": "string",
  "sections": [
    "string"
  ],
  "layers": [
    "ceiling"
  ],
  "ports": [
    "string"
  ],
  "autoAdd": true,
  "data": {}
}

Properties

Name Type Required Restrictions Description
floorPlanId string true none The id of the floor plan that this hub belongs to.
name string false none The name of the rule.v
sections [string] false none If autoAdd is enabled, new ports added to these sections and layers are automatically added to the rule, removed ports are automatically removed.
layers [string] false none If autoAdd is enabled, new ports added to these layers and sections are automatically added to the rule, removed ports are automatically removed.
ports [string] false none The ids of the ports that this rule controls.
autoAdd boolean false none If enabled, new ports in the floor plan will automatically be added, if they are in the sections and layers specified in the rule.
data object false none Rule configuration.

User

{
  "id": "string",
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» id string true none Unique identifier for the object.

and

Name Type Required Restrictions Description
anonymous NewUser false none none

NewUser

{
  "provider": "local",
  "email": "user@example.com",
  "password": "pa$$word",
  "type": "admin",
  "roles": {
    "companyAdmin": [
      "string"
    ],
    "companyUser": [
      "string"
    ],
    "companyGuest": [
      "string"
    ]
  },
  "profile": {
    "fullName": "string",
    "picture": "string",
    "locale": "en"
  }
}

Properties

Name Type Required Restrictions Description
provider string false none The authorization provider.
email string(email) true none The email of the user. Must be unique.
password string(password) true none The user's password.
type string false none What type of user it is.
roles object false none The permission roles the user has. It is in three different company categories.
» companyAdmin [string] false none Company ids.
» companyUser [string] false none Company ids.
» companyGuest [string] false none Company ids.
profile object false none none
» fullName string false none none
» picture string(url) false none url to an image file.
» locale string false none The language the user prefers.

authBody

{
  "email": "string",
  "password": "string"
}

Properties

Name Type Required Restrictions Description
email string true none none
password string true none none

iotAccess

{
  "accessKeyId": "string",
  "secretKey": "string",
  "sessionToken": "string",
  "expiration": "string",
  "region": "string",
  "host": "string"
}

Properties

Name Type Required Restrictions Description
accessKeyId string false none none
secretKey string false none none
sessionToken string false none none
expiration string false none none
region string false none none
host string false none none

metric

{
  "time": "2019-04-26T11:07:01Z",
  "field*": "string"
}

Properties

Name Type Required Restrictions Description
time string(date-time) false none Timestamp for the metric data.
field* any false none Fields related to the port. There can be multiple fields and they vary depending on the measurement you choose. To find out the fields of a measurement you can request /api/metrics/powerSense?limit=1

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous number false none none