NAV
shell ruby python php java javascript

Introduction

Welcome to the Raixer API, a HTTP-based RESTful API that uses HTTP Basic Auth for authorization and has all request and response bodies formatted in JSON. You can use our API to interact with our entire platform and, specially, to interact with our awesome Raixer devices.

We have several language bindings! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

This documentation was created with Slate.

Authentication

Example request:

curl "api_endpoint_here" \
  -H "Authorization: Basic your_encoded_base64_string"
require 'net/http'
require 'uri'

headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("api_endpoint_here")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("api_endpoint_here", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "api_endpoint_here");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet req = new HttpGet("api_endpoint_here");

req.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(req);
const https = require("https")

let req = https.get("api_endpoint_here", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Make sure to replace your_encoded_base64_string with your encoded base 64 string including your API username and password.

We use HTTP Basic Auth to allow access to our API. Please, contact us at hello@raixer.com to get one. While you get your credentials from us, please, register on our great App and configure your devices, so you can use them.

We expect your private API username and password to be included as an Authorization Header in all of the requests you make. In, more or less words, this is:

  1. Make a string of this form: your_api_username:your_api_password
  2. Encode the obtained string in base 64
  3. Put the encoded string in an HTTP Header called Authorization with the value Basic your_encoded_base64_string

Authorized Phones

Example authorized phone:

// Unlimited openings
{
  "_id": "edcba54321",
  "deviceId": "abcde12345",
  "doorId": "12345abcde",
  "phoneNumber": 34111223344,
  "owner": "fghjkl67890",
  "created": "2018-09-17T14:36:10.446Z",
  "updated": "2018-09-17T14:36:10.446Z",
  "authorized": true,
  "deleteOnEnd": false,
  "deleteOnCall": false,
  "deleteOnCallAfter": 1,
  "alias": "Test"
}

// Openings only between a start and end date and time
{
  "_id": "edcba54321",
  "deviceId": "abcde12345",
  "doorId": "12345abcde",
  "phoneNumber": 34111223344,
  "owner": "fghjkl67890",
  "created": "2018-09-17T14:36:10.446Z",
  "updated": "2018-09-17T14:36:10.446Z",
  "authorized": true,
  "deleteOnEnd": false,
  "deleteOnCall": false,
  "deleteOnCallAfter": 1,
  "alias": "Test",
  "authorizedFrom": 1617872400000,
  "authorizedTo": 1617894000000,
  "repeatDaysOfWeek": null,
  "repeatEndHour": null,
  "repeatStartHour": null,
  "repeatTimezone": null
}

// Openings on days of the week between a start and end hour
{
  "_id": "edcba54321",
  "deviceId": "abcde12345",
  "doorId": "12345abcde",
  "phoneNumber": 34111223344,
  "owner": "fghjkl67890",
  "created": "2018-09-17T14:36:10.446Z",
  "updated": "2018-09-17T14:36:10.446Z",
  "authorized": true,
  "deleteOnEnd": false,
  "deleteOnCall": false,
  "deleteOnCallAfter": 1,
  "alias": "Test",
  "authorizedFrom": null,
  "authorizedTo": null,
  "repeatDaysOfWeek": "1,2,3,4,5",
  "repeatEndHour": "19:00",
  "repeatStartHour": "9:00",
  "repeatTimezone": "Europe/Madrid"
}

To allow a specific phone number, from all around the world, access to a device, you create an authorized phone. The API allows you to create, update or delete an authorized phone. You can retrieve an individual phone as well as list all of them associated to a device. Authorized phones are identified by a unique, random ID.

Create an Authorized Phone

Example request:

curl "https://api.raixer.com/authorized-phones/v2" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"deviceId": "abcde12345", "doorId": "12345abcde", "phoneNumber": 123456789, "authorized": true}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/authorized-phones/v2")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "deviceId": "abcde12345",
  "doorId": "12345abcde",
  "phoneNumber": 123456789,
  "authorized": true
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"deviceId": "abcde12345", "doorId": "12345abcde", "phoneNumber": 123456789, "authorized": true}
req = requests.post("https://api.raixer.com/authorized-phones/v2", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "deviceId" => "abcde12345",
  "doorId" => "12345abcde",
  "phoneNumber" => 123456789,
  "authorized" => true
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/authorized-phones/v2");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("deviceId", "abcde12345");
body.put("doorId", "12345abcde");
body.put("phoneNumber", 123456789);
body.put("authorized", true);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/authorized-phones/v2");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {"deviceId": "abcde12345", "doorId": "12345abcde", "phoneNumber": 123456789, "authorized": true}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "authorized-phones/v2",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "insertedId": "edcba54321",
  "result": {
      "n": 1,
      "ok": 1
  }
}

Creates a new authorized phone.

HTTP Request

POST https://api.raixer.com/authorized-phones/v2

Body Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the device associated to the phone
doorId Yes N/A A string that specifies the door associated to the phone
phoneNumber Yes N/A A number that specifies the phone number that will access the device, including the country extension
authorized No true A boolean that specifies if the phone is authorized or not to access the device.
deleteOnEnd No false A boolean that specifies if the phone should be deleted when its' active period has ended (only possible when using authorizedFrom and authorizedTo)
deleteOnCall No false A boolean that specifies if the phone should be deleted when its' maximum number of calls has reached (only possible when using deleteOnCallAfter)
deleteOnCallAfter No 1 A number that indicates the maximum number of successful calls the phone can make before automatically deleting it (only possible when deleteOnCall is true)
alias No N/A String to identify the number
authorizedFrom No N/A A number that represents the starting date and time, as an UNIX UTC timestamp in milliseconds, of the active period when the phone can call and open the door
authorizedTo No N/A A number that represents the ending date and time, as an UNIX UTC timestamp in milliseconds, of the active period when the phone can call and open the door
repeatDaysOfWeek No N/A A string of numbers separated by commas. Each number represents a day of the week, where Monday is 1 and Sunday is 7. Example: for a phone to be active Monday through Friday, the string should be 1,2,3,4,5
repeatStartHour No N/A A string representing the starting hour, in a 24 hour format, for the period in which the phone is active
repeatEndHour No N/A A string representing the ending hour, in a 24 hour format, for the period in which the phone is active
repeatTimezone No N/A A string that represents the timezone for the hours of the active period of the phone.

Important notes

Update an Authorized Phone

Example request:

curl "https://api.raixer.com/authorized-phones/v2/edcba54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X PUT
  -d '{"deviceId": "abcde12345", "doorId": "12345abcde", "phoneNumber": 123456789, "authorized": true}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/authorized-phones/v2/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.request_uri, headers)

body = {
  "deviceId": "abcde12345",
  "doorId": "12345abcde",
  "phoneNumber": 123456789,
  "authorized": true
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"deviceId": "abcde12345", "doorId": "12345abcde", "phoneNumber": 123456789, "authorized": true}
req = requests.put("https://api.raixer.com/authorized-phones/v2/edcba54321", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "deviceId" => "abcde12345",
  "doorId" => "12345abcde",
  "phoneNumber" => 123456789,
  "authorized" => true
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/authorized-phones/v2/edcba54321");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("deviceId", "abcde12345");
body.put("doorId", "12345abcde");
body.put("phoneNumber", 123456789);
body.put("authorized", true);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPut("https://api.raixer.com/authorized-phones/v2/edcba54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {"deviceId": "abcde12345", "doorId": "12345abcde", "phoneNumber": 123456789, "authorized": true}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "authorized-phones/v2/edcba54321",
  "method": "PUT",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "n": 1,
  "nModified": 1,
  "ok": 1
}

Updates an authorized phone.

HTTP Request

PUT https://api.raixer.com/authorized-phones/v2/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the authorized phone to update

Body Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the device associated to the phone
doorId Yes N/A A string that specifies the door associated to the phone
phoneNumber Yes N/A A number that specifies the phone number that will access the device, including the country extension
authorized No true A boolean that specifies if the phone is authorized or not to access the device.
deleteOnEnd No false A boolean that specifies if the phone should be deleted when its' active period has ended (only possible when using authorizedFrom and authorizedTo)
deleteOnCall No false A boolean that specifies if the phone should be deleted when its' maximum number of calls has reached (only possible when using deleteOnCallAfter)
deleteOnCallAfter No 1 A number that indicates the maximum number of successful calls the phone can make before automatically deleting it (only possible when deleteOnCall is true)
alias No N/A String to identify the number
authorizedFrom No N/A A number that represents the starting date and time, as an UNIX UTC timestamp in milliseconds, of the active period when the phone can call and open the door
authorizedTo No N/A A number that represents the ending date and time, as an UNIX UTC timestamp in milliseconds, of the active period when the phone can call and open the door
repeatDaysOfWeek No N/A A string of numbers separated by commas. Each number represents a day of the week, where Monday is 1 and Sunday is 7. Example: for a phone to be active Monday through Friday, the string should be 1,2,3,4,5
repeatStartHour No N/A A string representing the starting hour, in a 24 hour format, for the period in which the phone is active
repeatEndHour No N/A A string representing the ending hour, in a 24 hour format, for the period in which the phone is active
repeatTimezone No N/A A string that represents the timezone for the hours of the active period of the phone. For example: Europe/Madrid

Important notes

Delete an Authorized Phone

Example request:

curl "https://api.raixer.com/authorized-phones/v2/edcba54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -X DELETE
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/authorized-phones/v2/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.delete("https://api.raixer.com/authorized-phones/v2/edcba54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/authorized-phones/v2/edcba54321");
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpDelete("https://api.raixer.com/authorized-phones/v2/edcba54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "authorized-phones/v2/edcba54321",
  "method": "DELETE",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

{
  "n": 1,
  "ok": 1
}

Deletes an authorized phone.

HTTP Request

DELETE https://api.raixer.com/authorized-phones/v2/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the authorized phone to delete

Get an Authorized Phone

Example request:

curl "https://api.raixer.com/authorized-phones/edcba54321"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/authorized-phones/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/authorized-phones/edcba54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/authorized-phones/edcba54321");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/authorized-phones/edcba54321");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/authorized-phones/edcba54321", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "_id": "edcba54321",
  "deviceId": "abcde12345",
  "phoneNumber": 123456789,
  "owner": "fghjkl67890",
  "created": "2018-09-17T14:36:10.446Z",
  "updated": "2018-09-17T14:36:10.446Z"
}

Retrieves the details of an authorized phone that has previously been created.

HTTP Request

GET https://api.raixer.com/authorized-phones/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the authorized phone to retrieve

Get all Authorized Phones of a Device

Example request:

curl "https://api.raixer.com/authorized-phones/device/abcde12345"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/authorized-phones/device/abcde12345")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/authorized-phones/device/abcde12345", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/authorized-phones/device/abcde12345");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/authorized-phones/device/abcde12345");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/authorized-phones/device/abcde12345", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Example response:

[
  {
    "_id": "edcba54321",
    "deviceId": "abcde12345",
    "phoneNumber": 123456789,
    "owner": "fghjkl67890",
    "created": "2018-09-17T14:36:10.446Z",
    "updated": "2018-09-17T14:36:10.446Z"
  },
  {
    "_id": "edcba12345",
    "deviceId": "abcde12345",
    "phoneNumber": 987654321,
    "owner": "fghjkl67890",
    "created": "2018-09-17T14:36:10.446Z",
    "updated": "2018-09-17T14:36:10.446Z"
  }
]

Retrieves the numbers of all of the authorized phones associated to one device.

HTTP Request

GET https://api.raixer.com/authorized-phones/device/:deviceId

Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the ID of the device associated to the authorized phones to retrieve

Connections

Example connection:

{
    "_id" : "edcba54321",
    "owner" : "fghjkl67890",
    "deviceId" : "abcde12345",
    "profile" : "user",
    "disabled" : false,
    "created" : "2018-08-17T08:19:35.462Z",
    "updated" : "2018-08-17T08:25:33.785Z",
    "name" : "Lorem ipsum"
}

To control a specific device, no matter where it is, you must have a connection to it. The API allows you to update or delete a connection in multiple ways. You can retrieve an individual connection as well as list all of them associated to a user. Connections are identified by a unique, random ID and are always associated to an user and a device.

Get a Connection

Example request:

curl "https://api.raixer.com/connections/edcba54321"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/connections/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/connections/edcba54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/connections/edcba54321");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/connections/edcba54321");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/connections/edcba54321", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "_id": "edcba54321",
  "owner": "fghjkl67890",
  "deviceId": "abcde12345",
  "profile": "admin",
  "created": "2018-09-18T08:01:10.614Z",
  "updated": "2018-09-18T09:51:25.002Z",
  "disabled": false,
  "name": "Lorem ipsum",
  "schedules": [
    ...
  ],
  "device": {
    ...
  }
}

Retrieves the details of a connection that has previously been created.

HTTP Request

GET https://api.raixer.com/connections/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the connection to retrieve

List Connections

Example request:

curl "https://api.raixer.com/connections"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/connections")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/connections", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/connections");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/connections");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/connections", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Example response:

// List of unordered connections of the user
[
  {
    "_id": "edcba54321",
    "owner": "fghjkl67890",
    "deviceId": "abcde12345",
    "profile": "admin",
    "created": "2018-09-18T08:01:10.614Z",
    "updated": "2018-09-18T08:01:10.614Z",
    "device": {
      ...
      "doors": [
        {
          ...
        }
      ],
      "inUseComplete": [
        ...
      ],
      "openingsComplete": [
        ...
      ],
      "campaign": {
        ...
      },
      ...
    }
  },
  {
    "_id": "edcba54322",
    "deviceId": "abcde54321",
    "owner": "fghjkl67890",
    "name": "Lorem ipsum",
    "created": "2018-06-15T07:30:38.200Z",
    "updated": "2018-06-15T07:30:38.200Z",
    "profile": "user",
    "disabled": false,
    "device": {
      ...
    }
  },
  ...
]

Retrieves all the connections of the user.

HTTP Request

GET https://api.raixer.com/connections

Get the History of a Connection

Example request:

curl "https://api.raixer.com/connections/edcba54321/history?page=1"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/connections/edcba54321/history?page=1")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/connections/edcba54321/history?page=1", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/connections/edcba54321/history?page=1");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/connections/edcba54321/history?page=1");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/connections/edcba54321/history?page=1", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

[
  {
    "_id": "1",
    "deviceId": "abcde12345",
    "action": "connections.detail.history.action.openDoor2",
    "error": false,
    "details": "Jon Doe",
    "created": "2018-08-29T15:21:13.245Z",
    "updated": "2018-08-29T15:21:13.245Z"
  },
  {
    "_id": "2",
    "deviceId": "abcde12345",
    "action": "connections.detail.history.action.doorOpened",
    "error": false,
    "created": "2018-08-29T15:21:11.645Z",
    "updated": "2018-08-29T15:21:11.645Z"
  },
  {
    "_id": "3",
    "deviceId": "abcde12345",
    "action": "connections.detail.history.action.openDoor",
    "error": false,
    "details": "Jon Doe",
    "created": "2018-08-29T15:20:57.997Z",
    "updated": "2018-08-29T15:20:57.997Z"
  },
  ...
]

Retrieves the history of actions made with or by the device of a connection. The results are paginated in pages of 10.

HTTP Request

GET https://api.raixer.com/connections/:id/history?page=1

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the connection to retrieve the history of

Query Parameters

Parameter Required Default Description
page No 0 A number that specifies the history page to retrieve (the first one is 0)

Create a Connection

To create a Connection between an User and a Device you must be registered on our APP and have a previously working connection to the device you want to add the new User. Then, you should go to the Users tab of your device and tap on Add user, this will generate a QR you can share with the new User, so they can scan it with our APP and have access to your device.

Important notes

Update a Connection

Example request:

curl "https://api.raixer.com/connections/edcba54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X PUT
  -d '{"name": "Lorem ipsum", "profile": "user", "disabled": false}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/connections/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.request_uri, headers)

body = {
  "name": "Lorem ipsum",
  "profile": "user",
  "disabled": false
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"name": "Lorem ipsum", "profile": "user", "disabled": false}
req = requests.put("https://api.raixer.com/connections/edcba54321", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "name" => "Lorem ipsum", 
  "profile" => "user", 
  "disabled" => false
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/connections/edcba54321");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("name", "Lorem ipsum");
body.put("profile", "user");
body.put("disabled", false);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPut("https://api.raixer.com/connections/edcba54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {"name": "Lorem ipsum", "profile": "user", "disabled": false}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "connections/edcba54321",
  "method": "PUT",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "n": 1,
  "nModified": 1,
  "ok": 1
}

Updates a connection.

HTTP Request

PUT https://api.raixer.com/connections/user/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the connection to update

Body Parameters

Parameter Required Default Description
profile Yes N/A A string that specifies the level of control given to the owner (user) of the connection for the associated device. Must be one of the following: 'user', 'admin', 'installer'.
disabled No N/A A boolean that specifies if the connection is disabled or not. If disabled is true, enabledForUse is ignored
enabledForUse No true A boolean that specifies if the connection is enabled for use of the device
deleteOnEnd No false A boolean that specifies if the connection should be deleted when its' active period has ended (only possible when using authorizedFrom and authorizedTo)
authorizedFrom No N/A A number that represents the starting date and time, as an UNIX UTC timestamp in milliseconds, of the active period when the connection user can use the device
authorizedTo No N/A A number that represents the ending date and time, as an UNIX UTC timestamp in milliseconds, of the active period when the connection user can use the device
repeatDaysOfWeek No N/A A string of numbers separated by commas. Each number represents a day of the week, where Monday is 1 and Sunday is 7. Example: for a connection to be active Monday through Friday, the string should be 1,2,3,4,5
repeatStartHour No N/A A string representing the starting hour, in a 24 hour format, for the period in which the connection is active
repeatEndHour No N/A A string representing the ending hour, in a 24 hour format, for the period in which the connection is active
repeatTimezone No N/A A string that represents the timezone for the hours of the active period of the connection. For example: Europe/Madrid

Devices

Example device:

{
  "_id": "edcba54321",
  "owner": "fghjkl67890",
  "name": "lorem_ipsum",
  "online": true,
  "type": "intercom",
  "version": "v2",
  "campaignId": "abcde12345",
  "created": "2018-08-17T08:19:35.457Z",
  "updated": "2018-09-18T08:01:15.668Z"
}

The section you must be most excited to read and to play with: our awesome Raixer Devices :). Let's be honest, our devices are the reason you know us and use Raixer in the first place. Here, you will learn to use our API to manage, configure and interact with all your devices without interacting throughout our APP, in most cases. Devices are identified by a unique ID that comes directly configured from the factory and into their firmware.

It is very important that you are either the owner or an authorized user (have a connection to the device) of the device you want to interact with, because, for very important security reasons, we don't allow unauthorized use of the devices.

IMPORTANT NOTE:

If you want to see the addresses or all of the properties your devices are controlling, you must follow the [Connections](#connections) section of our API, after you identify the device controlling a certain property, you can then follow this section to do whatever you want with your device.

Create a Device

To create a new device you must use our APP and configure it through the ADD button on the Main Screen, afterwards, follow the instructions of the Configure new device process. This will guide you through the WiFi or Mobile connection configuration for the device, so it can have internet and be interacted with. If you want, you can also make the configuration and calibration of the sensors, if applies.

We highly recommend that all of this process is made by an installer, so you can be sure that your device is configured correctly and will function accordingly.

Get a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices/edcba54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices/edcba54321");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices/edcba54321", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "_id": "edcba54321",
  "owner": "fghjkl67890",
  "name": "lorem_ipsum",
  "online": true,
  "type": "intercom",
  "version": "v2",
  "campaignId": "abcde12345",
  "created": "2018-08-17T08:19:35.457Z",
  "updated": "2018-09-18T08:01:15.668Z"
}

Retrieves the details of a device that has previously been created.

HTTP Request

GET https://api.raixer.com/devices/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to retrieve

Get all Devices

Example request:

curl "https://api.raixer.com/devices"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Example response:

[
  {
    "_id": "edcba54321",
    "owner": "fghjkl67890",
    "name": "lorem_ipsum",
    "online": true,
    "type": "intercom",
    "version": "v2",
    "campaignId": "abcde12345",
    "created": "2018-08-17T08:19:35.457Z",
    "updated": "2018-09-18T08:01:15.668Z"
  },
  {
    "_id": "edcba54322",
    "owner": "fghjkl67890",
    "name": "sit_amet",
    "online": true,
    "type": "intercom",
    "version": "v1",
    "campaignId": "lkjhg12345",
    "created": "2018-08-17T08:19:35.457Z",
    "updated": "2018-09-18T08:01:15.668Z"
  },
  ...
]

Retrieves all the devices owned by your user.

HTTP Request

GET https://api.raixer.com/devices

Important notes

Get all Device Doors

Example request:

curl "https://api.raixer.com/devices/edcba54321/doors"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/doors")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices/edcba54321/doors", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/doors");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices/edcba54321/doors");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices/edcba54321/doors", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Example response:

[
  {
    "_id": "abcde54321",
    "openingValue": 7500,
    "tolerance": 6000,
    "maxOpenings": 7,
    "waitTimeFirst": 2000,
    "twoOpenings": true,
    "mustCallBellFirst": true,
    "remainingOpenings": 100,
    "remainingTestOpenings": 25,
    "remainingPhoneCalls": 100,
    "remainingRaixerPhoneCalls": 25,
    "sensorMode": "bell",
    "name": "Street",
    "port": "left",
    "use": "street",
    "deviceId": "edcba54321",
    "created": "2018-08-02T10:10:41.294Z",
    "updated": "2018-08-16T19:06:33.628Z",
    "intercomCallFirst": true,
    "intercomEnableAutoAccess": true,
    "phoneNumber": 1234567890,
    "callingEnabled": true,
    "anyCallerEnabled": false
  },
  ...
]

Retrieves all the doors (sensors associated to doors, for example: an intercom sensor or an open/closed sensor) configured in a device. A Raixer Device should always have at least 1 door configured.

HTTP Request

GET https://api.raixer.com/devices/:id/doors

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device associated to the doors.

Create (Add) a Door to a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321/doors" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"deviceId": "edcba54321", "openingValue": 6500, "tolerance": 1000, "maxOpenings": 4, "waitTimeFirst": 1500, "twoOpenings": true, "mustCallBellFirst": true, "remainingOpenings": 100, "remainingTestOpenings": 25, "remainingPhoneCalls": 100, "remainingRaixerPhoneCalls": 25, "sensorMode": "bell", "name": "Lorem", "port": "right", "use": "street", "openingsDuration": 3000}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/doors")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "deviceId": "edcba54321",
  "openingValue": 6500,
  "tolerance": 1000,
  "maxOpenings": 4,
  "waitTimeFirst": 1500,
  "twoOpenings": true,
  "mustCallBellFirst": true,
  "remainingOpenings": 100,
  "remainingTestOpenings": 25,
  "remainingPhoneCalls": 100,
  "remainingRaixerPhoneCalls": 25,
  "sensorMode": "bell",
  "name": "Lorem",
  "port": "right",
  "use": "street",
  "openingsDuration": 3000
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"deviceId": "edcba54321", "openingValue": 6500, "tolerance": 1000, "maxOpenings": 4, "waitTimeFirst": 1500, "twoOpenings": true, "mustCallBellFirst": true, "remainingOpenings": 100, "remainingTestOpenings": 25, "remainingPhoneCalls": 100, "remainingRaixerPhoneCalls": 25, "sensorMode": "bell", "name": "Lorem", "port": "right", "use": "street", "openingsDuration": 3000}
req = requests.post("https://api.raixer.com/devices/edcba54321/doors", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "deviceId" => "edcba54321",
  "openingValue" => 6500,
  "tolerance" => 1000,
  "maxOpenings" => 4,
  "waitTimeFirst" => 1500,
  "twoOpenings" => true,
  "mustCallBellFirst" => true,
  "remainingOpenings" => 100,
  "remainingTestOpenings" => 25,
  "remainingPhoneCalls" => 100,
  "remainingRaixerPhoneCalls" => 25,
  "sensorMode" => "bell",
  "name" => "Lorem",
  "port" => "right",
  "use" => "street",
  "openingsDuration" => 3000
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/doors");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("deviceId", "edcba54321");
body.put("openingValue", 6500);
body.put("tolerance", 1000);
body.put("maxOpenings", 4);
body.put("waitTimeFirst", 1500);
body.put("twoOpenings", true);
body.put("mustCallBellFirst", true);
body.put("remainingOpenings", 100);
body.put("remainingTestOpenings", 25);
body.put("remainingPhoneCalls", 100);
body.put("remainingRaixerPhoneCalls", 25);
body.put("sensorMode", "bell");
body.put("name", "Lorem");
body.put("port", "right");
body.put("use", "street");
body.put("openingsDuration", 3000);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/doors");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "deviceId": "edcba54321",
  "openingValue": 6500,
  "tolerance": 1000,
  "maxOpenings": 4,
  "waitTimeFirst": 1500,
  "twoOpenings": true,
  "mustCallBellFirst": true,
  "remainingOpenings": 100,
  "remainingTestOpenings": 25,
  "remainingPhoneCalls": 100,
  "remainingRaixerPhoneCalls": 25,
  "sensorMode": "bell",
  "name": "Lorem",
  "port": "right",
  "use": "street",
  "openingsDuration": 3000
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/doors",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "insertedId": "abcde54321",
}

Creates (add) a new door to a device.

HTTP Request

POST https://api.raixer.com/devices/:id/doors

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to add the door to.

Body Parameters

Parameter Required Default Description
deviceId No N/A A string that specifies the device associated to the door.
openingValue No N/A A number that specifies the value (in Volts) in which the sensor will react.
tolerance No N/A A number that specifies the value (in Volts) to add/remove to the openingValue to define the range in which the sensor will react.
maxOpenings No N/A A number that specifies the maximum number of auto openings allowed by the device in listening mode before it is automatically ended.
waitTimeFirst No N/A A number that specifies the amount of time in seconds the device will wait before opening the door when it is informed to do it (via the API, APP or Phone call).
twoOpenings No N/A A boolean that specifies if the sensor will open the door two times when it is informed to do it (via the API, APP or Phone call).
mustCallBellFirst No N/A A boolean that specifies if the sensor need to call the bell before opening the door when it is informed to do it (via the API, APP or Phone call).
remainingOpenings No N/A A number that specifies the amount of openings remaining (not in use).
remainingTestOpenings No N/A A number that specifies the amount of openings remaining when the device has not been upgraded (not in use).
remainingPhoneCalls No N/A A number that specifies the amount of openings via phone calls remaining in one month (not in use).
remainingRaixerPhoneCalls No N/A A number that specifies the amount of openings via phone calls remaining when the device has not beem upgrades (not in use).
sensorMode No N/A A string that specifies the type of use destined to the sensor. Must be one of the following: bell, openingSensor
name No N/A A string that specifies the name of the sensor.
port No N/A A string that specifies the port of the device that this configuration is applied to. Must be one of the following: null, left, right.
use No N/A A string that specifies the use destined to the sensor of the port. It must be one of the following: null, street, home, garage, other.
openingsDuration No N/A A number that specifies the time, in milliseconds, the door will stay open when the door is opened through any of our methods (APP, Phone call, Auto Access, Codes).

Update a Door of a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321/doors/abcde54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X PUT
  -d '{"deviceId": "edcba54321", "openingValue": 6500, "tolerance": 1000, "maxOpenings": 4, "waitTimeFirst": 1500, "twoOpenings": true, "mustCallBellFirst": true, "remainingOpenings": 100, "remainingTestOpenings": 25, "remainingPhoneCalls": 100, "remainingRaixerPhoneCalls": 25, "sensorMode": "bell", "name": "Lorem", "port": "right", "use": "street", "openingsDuration": 3000}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/doors/abcde54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.request_uri, headers)

body = {
  "deviceId": "edcba54321", 
  "openingValue": 6500, 
  "tolerance": 1000, 
  "maxOpenings": 4, 
  "waitTimeFirst": 1500, 
  "twoOpenings": true, 
  "mustCallBellFirst": true, 
  "remainingOpenings": 100, 
  "remainingTestOpenings": 25, 
  "remainingPhoneCalls": 100, 
  "remainingRaixerPhoneCalls": 25, 
  "sensorMode": "bell", 
  "name": "Lorem", 
  "port": "right", 
  "use": "street",
  "openingsDuration": 3000
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"deviceId": "edcba54321", "openingValue": 6500, "tolerance": 1000, "maxOpenings": 4, "waitTimeFirst": 1500, "twoOpenings": true, "mustCallBellFirst": true, "remainingOpenings": 100, "remainingTestOpenings": 25, "remainingPhoneCalls": 100, "remainingRaixerPhoneCalls": 25, "sensorMode": "bell", "name": "Lorem", "port": "right", "use": "street", "openingsDuration": 3000}
req = requests.put("https://api.raixer.com/devices/edcba54321/doors/abcde54321", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "deviceId" => "edcba54321",
  "openingValue" => 6500,
  "tolerance" => 1000,
  "maxOpenings" => 4,
  "waitTimeFirst" => 1500,
  "twoOpenings" => true,
  "mustCallBellFirst" => true,
  "remainingOpenings" => 100,
  "remainingTestOpenings" => 25,
  "remainingPhoneCalls" => 100,
  "remainingRaixerPhoneCalls" => 25,
  "sensorMode" => "bell",
  "name" => "Lorem",
  "port" => "right",
  "use" => "street"
  "openingsDuration" => 3000
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/doors/abcde54321");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("deviceId", "edcba54321");
body.put("openingValue", 6500);
body.put("tolerance", 1000);
body.put("maxOpenings", 4);
body.put("waitTimeFirst", 1500);
body.put("twoOpenings", true);
body.put("mustCallBellFirst", true);
body.put("remainingOpenings", 100);
body.put("remainingTestOpenings", 25);
body.put("remainingPhoneCalls", 100);
body.put("remainingRaixerPhoneCalls", 25);
body.put("sensorMode", "bell");
body.put("name", "Lorem");
body.put("port", "right");
body.put("use", "street");
body.put("openingsDuration", 3000);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPut("https://api.raixer.com/devices/edcba54321/doors/abcde54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "deviceId": "edcba54321", 
  "openingValue": 6500, 
  "tolerance": 1000, 
  "maxOpenings": 4, 
  "waitTimeFirst": 1500, 
  "twoOpenings": true, 
  "mustCallBellFirst": true, 
  "remainingOpenings": 100, 
  "remainingTestOpenings": 25, 
  "remainingPhoneCalls": 100, 
  "remainingRaixerPhoneCalls": 25, 
  "sensorMode": "bell", 
  "name": "Lorem", 
  "port": "right", 
  "use": "street",
  "openingsDuration": 3000
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/doors/abcde54321",
  "method": "PUT",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "n": 1,
  "nModified": 1,
  "ok": 1
}

Updates a door of a device

HTTP Request

PUT https://api.raixer.com/devices/:deviceId/doors/:doorId

Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the ID of the device associated to the door
doorId Yes N/A A string that specifies the ID of the door to update

Body Parameters

Parameter Required Default Description
deviceId No N/A A string that specifies the device associated to the door.
openingValue No N/A A number that specifies the value (in Volts) in which the sensor will react.
tolerance No N/A A number that specifies the value (in Volts) to add/remove to the openingValue to define the range in which the sensor will react.
maxOpenings No N/A A number that specifies the maximum number of auto openings allowed by the device in listening mode before it is automatically ended.
waitTimeFirst No N/A A number that specifies the amount of time in seconds the device will wait before opening the door when it is informed to do it (via the API, APP or Phone call).
twoOpenings No N/A A boolean that specifies if the sensor will open the door two times when it is informed to do it (via the API, APP or Phone call).
mustCallBellFirst No N/A A boolean that specifies if the sensor need to call the bell before opening the door when it is informed to do it (via the API, APP or Phone call).
remainingOpenings No N/A A number that specifies the amount of openings remaining (not in use).
remainingTestOpenings No N/A A number that specifies the amount of openings remaining when the device has not been upgraded (not in use).
remainingPhoneCalls No N/A A number that specifies the amount of openings via phone calls remaining in one month (not in use).
remainingRaixerPhoneCalls No N/A A number that specifies the amount of openings via phone calls remaining when the device has not beem upgrades (not in use).
sensorMode No N/A A string that specifies the type of use destined to the sensor. Must be one of the following: bell, openingSensor
name No N/A A string that specifies the name of the sensor.
port No N/A A string that specifies the port of the device that this configuration is applied to. Must be one of the following: null, left, right.
use No N/A A string that specifies the use destined to the sensor of the port. It must be one of the following: null, street, home, garage, other.
openingsDuration No N/A A number that specifies the time, in milliseconds, the door will stay open when the door is opened through any of our methods (APP, Phone call, Auto Access, Codes).

Delete a Door of a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321/doors/abcde54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -X DELETE
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/doors/abcde54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.delete("https://api.raixer.com/devices/edcba54321/doors/abcde54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/doors/abcde54321");
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpDelete("https://api.raixer.com/devices/edcba54321/doors/abcde54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/doors/abcde54321",
  "method": "DELETE",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

{
  "n": 1,
  "ok": 1
}

Deletes a door of a device.

HTTP Request

DELETE https://api.raixer.com/devices/:deviceId/doors/:doorId

Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the ID of the device associated to the door
doorId Yes N/A A string that specifies the ID of the door to delete

Get all Device Sensors

Example request:

curl "https://api.raixer.com/devices/edcba54321/sensors"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/sensors")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices/edcba54321/sensors", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/sensors");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices/edcba54321/sensors");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices/edcba54321/sensors", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Example response:

[
  {
    "_id": "abcde54321",
    "name": "Movement",
    "use": "movement",
    "port": "left",
    "deviceId": "edcba54321",
    "created": "2018-08-02T10:10:41.294Z",
    "updated": "2018-08-16T19:06:33.628Z"
  },
  ...
]

Retrieves all the sensors (for example: a movement sensor) configured in a device.

HTTP Request

GET https://api.raixer.com/devices/:id/sensors

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device associated to the sensors.

Create (Add) a Sensor to a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321/sensors" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"name": "Lorem", "use": "movement", "port": "right"}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/sensors")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "name": "Lorem",
  "use": "movement",
  "port": "right"
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"name": "Lorem", "use": "movement", "port": "right"}
req = requests.post("https://api.raixer.com/devices/edcba54321/sensors", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "name" => "Lorem",
  "use" => "movement",
  "port" => "right"  
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/sensors");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("name", "Lorem");
body.put("use", "movement");
body.put("port", "right");
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/sensors");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "name": "Lorem",
  "use": "movement",
  "port": "right"
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/sensors",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "insertedId": "abcde54321",
}

Creates (add) a new sensor to a device.

HTTP Request

POST https://api.raixer.com/devices/:id/sensors

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to add the sensor to.

Body Parameters

Parameter Required Default Description
name No N/A A string that specifies the name of the sensor.
use No N/A A string that specifies the type of use destined to the sensor. Must be one of the following: movement.
port No N/A A string that specifies the port of the device that this configuration is applied to. Must be one of the following: null, left, right.

Update a Sensor of a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321/sensors/abcde54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X PUT
  -d '{"name": "Lorem", "use": "movement", "port": "right"}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/sensors/abcde54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.request_uri, headers)

body = {
  "name": "Lorem",
  "use": "movement",
  "port": "right"
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"name": "Lorem", "use": "movement", "port": "right"}
req = requests.put("https://api.raixer.com/devices/edcba54321/sensors/abcde54321", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "name" => "Lorem",
  "use" => "movement",
  "port" => "right" 
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/sensors/abcde54321");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("name", "Lorem");
body.put("use", "movement");
body.put("port", "right");
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPut("https://api.raixer.com/devices/edcba54321/sensors/abcde54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "name": "Lorem",
  "use": "movement",
  "port": "right"
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/sensors/abcde54321",
  "method": "PUT",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "n": 1,
  "nModified": 1,
  "ok": 1
}

Updates a sensor of a device

HTTP Request

PUT https://api.raixer.com/devices/:deviceId/sensors/:sensorId

Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the ID of the device associated to the sensor
sensorId Yes N/A A string that specifies the ID of the sensor to update

Body Parameters

Parameter Required Default Description
name No N/A A string that specifies the name of the sensor.
use No N/A A string that specifies the type of use destined to the sensor. Must be one of the following: movement.
port No N/A A string that specifies the port of the device that this configuration is applied to. Must be one of the following: null, left, right.

Delete a Sensor of a Device

Example request:

curl "https://api.raixer.com/devices/edcba54321/sensors/abcde54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -X DELETE
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/sensors/abcde54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.delete("https://api.raixer.com/devices/edcba54321/sensors/abcde54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/sensors/abcde54321");
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpDelete("https://api.raixer.com/devices/edcba54321/sensors/abcde54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/sensors/abcde54321",
  "method": "DELETE",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

{
  "n": 1,
  "ok": 1
}

Deletes a sensor of a device.

HTTP Request

DELETE https://api.raixer.com/devices/:deviceId/sensors/:sensorId

Parameters

Parameter Required Default Description
deviceId Yes N/A A string that specifies the ID of the device associated to the sensor
sensorId Yes N/A A string that specifies the ID of the sensor to delete

Get a Device Information

Example request:

curl "https://api.raixer.com/devices/edcba54321/information"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/information")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices/edcba54321/information", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/information");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices/edcba54321/information");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices/edcba54321/information", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "id": "edcba54321",
  "name": "lorem_ipsum",
  "last_app": null,
  "last_ip_address": "1.2.3.4",
  "last_heard": "2018-09-19T16:23:52.658Z",
  "product_id": 1234,
  "connected": true,
  "platform_id": 8,
  "cellular": false,
  "notes": null,
  "status": "normal",
  "current_build_target": "0.8.0-rc.10",
  "system_firmware_version": "0.8.0-rc.10",
  "pinned_build_target": "0.8.0-rc.10",
  "default_build_target": "0.7.0",
  "variables": {
    "variable_name": "variable_type",
    ...
  },
  "functions": [
    "function_name",
    ...
  ],
  "groups": [],
  "targeted_firmware_release_version": null
}

Retrieves all the information of a device. The most interesting parts of this information are the variables and the functions, wich, respectively, represents all the variables and functions made available by or to the device.

HTTP Request

GET https://api.raixer.com/devices/:id/information

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to retrieve the information

Get Device Vitals

Example request:

curl "https://api.raixer.com/devices/edcba54321/vitals"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/vitals")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices/edcba54321/vitals", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/vitals");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices/edcba54321/vitals");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices/edcba54321/vitals", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "deviceId": "edcba54321",
  "signal": {
    "rssi": -87,
    "quality": 75,
    "strength": 50,
  },
  // If available
  "power": {
    "battery": {
      "state": "charged",
      "charge": 95
    }
  }
}

Retrieves a device vitals, regarding the signal and power (if the device has the possibility to connect a battery and it has one connected).

HTTP Request

GET https://api.raixer.com/devices/:id/vitals

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to retrieve the vitals

Power index

The power index of the response is present if the device has the possibility to connect a battery and it has one connected. If this index is present, it has a battery index, with the state of the battery and the charge of it.

Signal index

The signal index of the response is always present, regarding the device is an Intercom or an Access. This object describes several things regarding the signal (WiFi for Intercoms and 2G/3G for Access) the device is capturing.

RSSI Value Meaning
> -70 Excellent signal strength (closer to 0 is better)
-70 to -85 Good signal strength
-86 to -100 Fair signal strength
< -100 Poor signal strength
-110 No signal

Important notes

Refresh Device Vitals

Example request:

curl "https://api.raixer.com/devices/edcba54321/vitals" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/vitals")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
req = requests.post("https://api.raixer.com/devices/edcba54321/vitals", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/vitals");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/vitals");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/vitals",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

{
  "deviceId": "edcba54321",
  "signal": {
    "rssi": -87,
    "quality": 75,
    "strength": 50,
  },
  // If available
  "power": {
    "battery": {
      "state": "charged",
      "charge": 95
    }
  }
}

Refresh the device vitals and retrieves the updated device vitals. See the Get Device Vitals section for more information about the device vitals.

HTTP Request

POST https://api.raixer.com/devices/:id/vitals

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to retrieve the vitals

Get a Device Variable

Example request:

curl "https://api.raixer.com/devices/edcba54321/variable/abcd"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/variable/abcd")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/devices/edcba54321/variable/abcd", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/variable/abcd");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/devices/edcba54321/variable/abcd");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/devices/edcba54321/variable/abcd", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "cmd": "VarReturn",
  "name": "variable_name",
  "result": "variable_result",
  "coreInfo": {
    "last_app": "",
    "last_heard": "2018-09-19T16:33:50.372Z",
    "connected": true,
    "last_handshake_at": "2018-09-19T16:18:56.144Z",
    "deviceID": "edcba54321",
    "product_id": 1234
  }
}

Retrieves a the value of a variable of the device. The variable must be listed in the variables section of the information of the device.

The result of the variable will always be in the field result.

HTTP Request

GET https://api.raixer.com/devices/:id/variable/:variable

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to retrieve the variable
variable Yes N/A A string that specifies the name of the variable to retrieve

Practical example

Imagine you need to know if the device is in listening mode (auto access) in this particular moment, you'll need then to call this endpoint with the variable status or statusN (where N is the number of the port to get the info of, starting at 2), depending of the port you'll want to check.

Response of the status variable:

{
  "cmd": "VarReturn",
  "name": "status",
  "result": "0,,0,1537376277,1,0",
  "coreInfo": {
    "last_app": "",
    "last_heard": "2018-09-19T16:33:50.372Z",
    "connected": true,
    "last_handshake_at": "2018-09-19T16:18:56.144Z",
    "deviceID": "edcba54321",
    "product_id": 1234
  }
}

The result of this variable is always a string separated by commas and it always has 6 parts, no matter if some are empty. The parts of the string represent the following:

Position Type Possible values Meaning
0 Number 1 or 0 The device is in listening mode or not (1 for listening, 0 for not listening)
1 String N/A The ID of the last user that put the device in listening mode. Empty if the device is not in listening mode.
2 Date and time (timestamp) N/A The date and time (in a timestamp) that specifies when the device was put in listening mode or not (0 for when it is not in listening mode)
3 Date and time (timestamp) N/A The date and time (in a timestamp) for when the device was last turned on
4 Number 1 or 0 The device is an intercom device or not (1 is an intercom device, 0 not)
5 Number N/A A number that indicates how many auto openings the device has made (f.e. somebody called the door) since it was last put in listening mode (auto access)

List of Available Variables

Below you'll find a list of all the available device variables and their meaning. Please, note that not every variable is available for all device types, so, make sure to know the version and type of your Raixer Device before trying to get a variable.

Name Type Device Type Possible values Meaning
connected Number All 1 The device is connected and running
status String All See section above See section above
status2 String Intercom Two Doors and Access Same as status (See section above) Same as status (See section above) but for the door connected to the door sensor port 2.
buzzerValue Number All Number >= 0 The value in [mV] detected by the device for the door sensor port 1.
buzzerValue2 Number Intercom Two Doors and Access Number >= 0 The value in [mV] detected by the device for the door sensor port 2.
openValue Number All Number >= 0 The target value in [mV] for the device to open the door connected to the door sensor port 1.
openValue2 Number Intercom Two Doors and Access Number >= 0 The target value in [mV] for the device to open the door connected to the door sensor port 2.
tolerance Number All Number >= 0 A value in [mV] that indicates that the device will open the door connected to the door sensor port 1 when it detects a value between openValue - tolerance and openValue + tolerance
tolerance2 Number Intercom Two Doors and Access Number >= 0 A value in [mV] that indicates that the device will open the door connected to the door sensor port 2 when it detects a value between openValue2 - tolerance and openValue + tolerance
sensorMode Number All -1, 0 or 1 The mode in which the door sensor port 1 is functioning, -1 or 0 to bell sensor (for an intercom sensor) or 1 for opening sensor.
sensorMode2 Number Intercom Two Doors and Access -1, 0 or 1 The mode in which the door sensor port 2 is functioning, -1 or 0 to bell sensor (for an intercom sensor) or 1 for opening sensor.
doorIsOpen Number Intercom One Door and Intercom Two Doors 1 or 0 Indicates if the door connected to the door sensor port 1 is open or not. This will only function correctly if the device has an open/closed sensor connected to the port. We recommend to not get this value directly because, depending of the sensor, the value for open or close could be inverted.
doorIsOpen2 Number Intercom Two Doors 1 or 0 Indicates if the door connected to the door sensor port 2 is open or not. This will only function correctly if the device has an open/closed sensor connected to the port. We recommend to not get this value directly because, depending of the sensor, the value for open or close could be inverted.
doorIsOpen3 Number Access 1 or 0 Indicates if the door connected to the door sensor port 3 is open or not. This will only function correctly if the device has an open/closed sensor connected to the port. We recommend to not get this value directly because, depending of the sensor, the value for open or close could be inverted.
movement Number Intercom Two Doors and Access 1 or 0 Indicates if the movement sensor connected to any of the ports is detecting movement or not (1 for movement, 0 for none). This will only function correctly if the device has a movement sensor connected to any port.
lastMovement Number Intercom Two Doors and Access Timestamp in UTC Indicates the last time and date the device detected movement.
timeNow Number Intercom Two Doors and Access Timestamp in UTC Indicates the actual date and time of the device.
timeValid Boolean Intercom Two Doors and Access True or False Indicates if the actual date and time of the device is valid or not.
moveAlarm Number Intercom Two Doors and Access 1 or 0 Indicates if the movement alarm is active or not.

Execute a Device Function

Example request:

curl "https://api.raixer.com/devices/edcba54321/function/abcd" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/function/abcd")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
req = requests.post("https://api.raixer.com/devices/edcba54321/function/abcd", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/function/abcd");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/function/abcd");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/function/abcd",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

{
  "status": "success",
  "msg": "The action abcd was executed successfully",
  "deviceId": "abcde54321",
  "notifications": [
    ...
  ]
}

Execute a function of the device. The function must be listed in the functions section of the information of the device.

HTTP Request

POST https://api.raixer.com/devices/:id/function/:function

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device to retrieve the variable
function Yes N/A A string that specifies the name of the function to execute

List of Available Functions

Below you'll find a list of all the available device functions and their meaning. Please, note that not every variable is available for all device types, so, make sure to know the version and type of your Raixer Device before trying execute a function. Also, on a more important note, some functions are not recommended to use by calling them directly, as they are intended to use through our corresponding API functions or our APP.

Name Deprecated Recommended use Device Type Argument Possible return values Meaning
relay NO API All See related section below 1 or 0 This function starts the Auto Access for the sensor connected to the door sensor port 1. If it returns 1, it started correctly, if 0, it did not start correctly.
relay2 NO API Intercom Two Doors and Access See related section below 1 or 0 This function starts the Auto Access for the sensor connected to the door sensor port 2. If it returns 1, it started correctly, if 0, it did not start correctly.
solenoid YES None All None 1 Starts the solenoid corresponding to the door sensor port 1.
cut NO API All None 1 This function stops the Auto Access for the sensor connected to the door sensor port 1.
cut2 NO API Intercom Two Doors and Access None 1 This function stops the Auto Access for the sensor connected to the door sensor port 2.
state YES None All None 1 Always returns 1, it is called to see if the device is online and running.
add YES None All Number 1 or 0 This function add the passed time to the Auto Access for the sensor connected to the door sensor port 1. It returns 1 if everything was ok, 0 for when it is not.
intercom YES None All None 1 or 0 Indicates if the device is a Power Device or not: 0 for when it is and 1 for when it is not.
openDoor NO API All None 1 Opens the door connected to the door sensor port 1.
openDoor2 NO API Intercom Two Doors and Access None 1 Opens the door connected to the door sensor port 2.
openDoor3 NO API Access None 1 Opens the door connected to the door sensor port 3.
calibrate NO APP All None Number >= 0 Starts the process of auto calibration. Resets all the values associated to the process of auto calibration for the sensor connected to the door sensor port 1. It returns the number of seconds the device will calculate the mean of the buzzer value for the port 1 when it is in resting state. Use it only from our APP.
calibrate2 NO APP Intercom Two Doors and Access None Number >= 0 Starts the process of auto calibration. Resets all the values associated to the process of auto calibration for the sensor connected to the door sensor port 2. It returns the number of seconds the device will calculate the mean of the buzzer value for the port 2 when it is in resting state. Use it only from our APP.
getRestMean NO APP All None Number >= 0 Part to the process of auto calibration. Gets the mean of the buzzer value for the door connected to the door sensor port 1, for it's resting state, calculated after calling the function calibrate. Use it only from our APP.
getRestMean2 NO APP Intercom Two Doors and Access None Number >= 0 Part to the process of auto calibration. Gets the mean of the buzzer value for the door connected to the door sensor port 2, for it's resting state, calculated after calling the function calibrate2. Use it only from our APP.
getMean NO APP All None Number >= 0 Part to the process of auto calibration. Gets the mean of the buzzer value for the door connected to the door sensor port 1, calculated after calling the function calibrate and getRestMean. Use it only from our APP.
getMean2 NO APP Intercom Two Doors and Access None Number >= 0 Part to the process of auto calibration. Gets the mean of the buzzer value for the door connected to the door sensor port 2, calculated after calling the function calibrate2 and getRestMean2. Use it only from our APP.
getTol NO APP All None Number >= 0 Part to the process of auto calibration. Gets the tolerance for the buzzer value for the door connected to the door sensor port 1, calculated after calling the function calibrate, getRestMean and getMean. Use it only from our APP.
getTol2 NO APP Intercom Two Doors and Access None Number >= 0 Part to the process of auto calibration. Gets the tolerance for the buzzer value for the door connected to the door sensor port 2, calculated after calling the function calibrate2, getRestMean2 and getMean2. Use it only from our APP.
setValues NO None All See related section below 1 Sets the values of the variables openValue, tolerance, maxOpenings, waitTimeFirst and sensorMode.
setValues2 NO None Intercom Two Doors and Access See related section below 1 Sets the values of the variables openValue2, tolerance2, maxOpenings2, waitTimeFirst2 and sensorMode2.
activate NO None Access 1 or 0 1 or 0 Activates or deactivates the whole system controlling the open/close mechanism of the door connected to the middle port (port 3) of the Access device. If the argument is 1, the mechanism will activate (will work as normal), if it's 0 it will deactivate the mechanism (will always be open). Returns 1 for when the mechanism is active and 0 for when it's not. DO NOT USE DIRECTLY, as it is intended to work automatically when the device loses its internet connection.
changeMode NO None Access None 1 WORK IN PROGRESS: Activates or deactivates the whole system controlling the failsafe system of the open/close mechanism of the door connected to any of the ports of the device.
lastMove NO API or Direct Intercom Two Doors and Access None Timestamp in UTC or 0 Indicates the date and time of the last movement detected by the movement sensor connected to any of the ports of the device. If it returns 0, indicates that there are no new movement.
alarm NO API or Direct Intercom Two Doors and Access 1, 0 or infinite 1 or 0 Activates or deactivates the "movement alarm" system of the device, sending a maximum of 3 notifications (if parameter was 1) or sending infinite notifications (if parameter was infinite) when the device detects movement when the system is active. Returns 1 for when the system was activated or 0 for when it's not.
offlineAA NO APP, API or Direct All 1 or 0 1 or 0 Activates or deactivates the "Offline Auto Access" Contingency Mode of the device, wich starts the Auto Access whenever the device goes offline. Returns 1 for when the mode was activated or 0 for when it's not.
alwaysActive NO APP, API or Direct All 1 or 0 1 or 0 Activates or deactivates the "Auto Access Always Active" Mode of the device, wich sets the Auto Access on for all time for all the configured door sensor ports. Returns 1 for when the mode was activated or 0 for when it's not.
resetMemory NO None All None 1 Resets the device memory to it's factory state. WARNING: calling this function will delete all the stored values in the device wich may lead to undesired behavior and wrongly executed openings for Auto Access Mode.
invertSensor NO API or Direct Intercom Two Doors and Access 1 or 0 1 or 0 Indicates wether the device has to interpret the readings from a connected movement sensor as inverse or not. If the argument is 1, the sensor will be interpreted as inverted, 0 as normal. Returns 1 if the sensor will be interpreted as inverted, 0 for when it's not.
waitBells NO API or Direct All 1 or 0 1 or 0 Sets the time, in seconds, the device will wait after detecting a bell ring to detect a new one, eliminating the problem of detecting further bell rings one after another. This value is only considerated when the device has its Auto Access mode active for the door sensor port 1.
waitBells2 NO API or Direct Intercom Two Doors and Access 1 or 0 1 or 0 Sets the time, in seconds, the device will wait after detecting a bell ring to detect a new one, eliminating the problem of detecting further bell rings one after another. This value is only considerated when the device has its Auto Access mode active for the door sensor port 2.

Relay Functions Argument

These functions expect a string argument of certain numbers separated by commas. In the table below you'll find the explanation of all the parts.

Position Required Type Possible values Meaning
0 Yes Number Number >= 0 Value indicating how much time the device will be in Auto Access mode for the corresponding port.
1 No String String or empty The ID of the user who started the Auto Access Mode.
2 Yes (Intercom One Door and Intercom Two Doors) / No (Access) Number Number >= 0 or Empty Value for the corresponding openValue variable.
3 Yes (Intercom One Door and Intercom Two Doors) / No (Access) Number Number >= 0 or Empty Value for the corresponding tolerance variable.
4 Yes (Intercom One Door and Intercom Two Doors) / No (Access) Number Number >= 0 or Empty Value for the corresponding maxOpenings variable.
5 Yes (Intercom One Door and Intercom Two Doors) / No (Access) Number Number >= 0 or Empty Value for the corresponding waitTimeFirst variable.

SetValues Functions Argument

These functions expect a string argument of certain numbers separated by commas. In the table below you'll find the explanation of all the parts.

Position Type Possible values Meaning
0 Number Number >= 0 Value for the corresponding openValue variable.
1 Number Number >= 0 Value for the corresponding tolerance variable.
2 Number Number >= 0 Value for the corresponding maxOpenings variable.
3 Number Number >= 0 Value for the corresponding waitTimeFirst variable.
4 Number 0, 1 or 2 Value indicating the sensorMode of the door, 0 for when it is an Auto Access, 1 for when it is an Opening Sensor or 2 for anything else.
5 Number 0 or 1 Value indicating the sensorReverse of an Opening Sensor door, dictating if the sensor has the readings inverse of the expected.
6 Number Number >= 0 Value for the corresponding waitBuzzerTime variable, wich indicates how many seconds the bell has to be pressed before the device recognises the calling and opens the door. This value is only for an Auto Access door.

Open Door at Position

Example request:

curl "https://api.raixer.com/devices/edcba54321/open-door/street" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/open-door/street")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
req = requests.post("https://api.raixer.com/devices/edcba54321/open-door/street", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/open-door/street");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/open-door/street");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/open-door/street",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

[
  {
    "status": "success",
    "msg": "The action openDoor was executed successfully",
    "deviceId": "abcde54321",
    "notifications": [
      ...
    ]
  },
  {
    "status": "success",
    "msg": "The action openDoor2 was executed successfully",
    "deviceId": "abcde54321",
    "notifications": [
      ...
    ]
  },
  ...
]

Opens the door connected to the sensor of the device at the position or use specified.

This method returns an array, with the result of the operation for each of the doors that were selected by the user specified position/use. For example: a device has configured two doors for the use street, this method will return an array with two objects indicating the result of the operation for each of the doors.

HTTP Request

POST https://api.raixer.com/devices/:id/open-door/:position

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device
position Yes N/A A number or string that specifies the position or the use of the sensor you want to open. If it is a number it should be 1 or higher. If it is a string, it can be the ID of the door you want to open or one of the following: street, home, garage or other.

Important notes

Start Job (Auto Access) at Position

Example request:

curl "https://api.raixer.com/devices/edcba54321/start-job/street" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"minutes": 3}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/start-job/street")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "minutes": 3
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"minutes": 3}
req = requests.post("https://api.raixer.com/devices/edcba54321/start-job/street", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "minutes" => 3
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/start-job/street");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("minutes", 3);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/start-job/street");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "minutes": 3
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/start-job/street",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

[
  {
    "status": "success",
    "msg": "The action relay was executed successfully",
    "deviceId": "abcde54321",
    "notifications": [
      ...
    ]
  },
  // If more than one door is configured with the same use/position
  {
    "status": "success",
    "msg": "The action relay2 was executed successfully",
    "deviceId": "abcde54321",
    "notifications": [
      ...
    ]
  },
  ...
]

Starts the auto access listening mode in the door connected to the door of the device at the position or use you specify. If a device is in auto access listening mode, whenever somebody calls the bell of the door or the intercom connected to that sensor, the device will get the call and open the door.

This method returns an array, with the result of the operation for each of the doors that were selected by the user specified position/use. For example: a device has configured two doors for the use street, this method will return an array with two objects indicating the result of the operation for each of the doors.

Important notes

HTTP Request

POST https://api.raixer.com/devices/:id/start-job/:position

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device
position Yes N/A A number or string that specifies the position or the use of the sensor you want to open. If it is a number it should be 1 or higher. If it is a string, it should be one of the following: street, home, garage or other.

Body Parameters

Parameter Required Default Description
minutes Yes N/A A number that specifies the number of minutes the device will be in auto access listening mode.
openingValue No Configured value A number that specifies the value (in Volts) in which the sensor will react. If not passed, the device will take the previously configured value via our APP.
tolerance No Configured value A number that specifies the value (in Volts) to add/remove to the openingValue to define the range in which the sensor will react. If not passed, the device will take the previously configured value via our APP.
maxOpenings No Configured value A number that specifies the maximum number of auto openings allowed by the device in listening mode before it is automatically ended. If not passed, the device will take the previously configured value via our APP.
waitTimeFirst No Configured value A number that specifies the amount of time in seconds the device will wait before opening the door when it is informed to do it (via the API, APP or Phone call). If not passed, the device will take the previously configured value via our APP.

Stop Job (Auto Access) at Position

Example request:

curl "https://api.raixer.com/devices/edcba54321/stop-job/street" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/stop-job/street")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
req = requests.post("https://api.raixer.com/devices/edcba54321/stop-job/street", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/stop-job/street");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/stop-job/street");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/stop-job/street",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

[
  {
    "status": "success",
    "msg": "The action cut was executed successfully",
    "deviceId": "abcde54321",
    "notifications": [
      ...
    ]
  },
  {
    "status": "success",
    "msg": "The action cut2 was executed successfully",
    "deviceId": "abcde54321",
    "notifications": [
      ...
    ]
  },
  ...
]

Stops the auto access listening mode for the door connected to the sensor of the device at the position or use specified.

This method returns an array, with the result of the operation for each of the doors that were selected by the user specified position/use. For example: a device has configured two doors for the use street, this method will return an array with two objects indicating the result of the operation for each of the doors.

HTTP Request

POST https://api.raixer.com/devices/:id/stop-job/:position

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device
position Yes N/A A number or string that specifies the position or the use of the sensor you want to open. If it is a number it should be 1 or higher. If it is a string, it should be one of the following: street, home, garage or other.

Important notes

Manage Movement Alarm

Example request:

curl "https://api.raixer.com/devices/edcba54321/movement-alarm/1" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/movement-alarm/1")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
req = requests.post("https://api.raixer.com/devices/edcba54321/movement-alarm/1", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/movement-alarm/1");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/movement-alarm/1");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/movement-alarm/1",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

// If the movement alarm was activated
{
  "status": "success",
  "msg": "The action alarm was executed successfully",
  "deviceId": "abcde54321",
  "result": 1
}

// If the movement alarm was deactivated
{
  "status": "success",
  "msg": "The action alarm was executed successfully",
  "deviceId": "abcde54321",
  "result": 0
}

Starts or stops the movement alarm.

NOTE: the movement alarm will only trigger when the device has changed movement states, i.e. the device has not been detected movement and then detects movement

HTTP Request

POST https://api.raixer.com/devices/:id/movement-alarm/:action

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device
action Yes N/A A string that specifies the action (f.e. activate for ever, activate or deactivate) to execute for the movement alarm of the device. Has to be one of the following: infinite, 1 or 0

Importat notes

Manage Offline Auto Access (Contingency Mode)

Example request:

curl "https://api.raixer.com/devices/edcba54321/offline-auto-access" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"offlineAutoAccess": true}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/offline-auto-access")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "offlineAutoAccess": true
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"offlineAutoAccess": true}
req = requests.post("https://api.raixer.com/devices/edcba54321/offline-auto-access", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "offlineAutoAccess" => true
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/offline-auto-access");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("offlineAutoAccess", true);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/offline-auto-access");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "offlineAutoAccess": true
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/offline-auto-access",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "n": 1,
  "nModified": 1,
  "ok": 1
}

Enables or disables the Offline Auto Access Contingency Mode of the device. If this mode is active for a device, when it goes offline it will start automatically it's Auto Access Mode as long as it's offline or the maximum number of openings are reached.

HTTP Request

POST https://api.raixer.com/devices/:id/offline-auto-access

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device

Body Parameters

Parameter Required Default Description
offlineAutoAccess Yes N/A A boolean (true/false) that specifies if the Offline Auto Access will be active or not.

Importat notes

Manage Auto Access Always Active

Example request:

curl "https://api.raixer.com/devices/edcba54321/auto-access-always-active" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"autoAccessAlwaysActive": true}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/auto-access-always-active")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "autoAccessAlwaysActive": true
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"autoAccessAlwaysActive": true}
req = requests.post("https://api.raixer.com/devices/edcba54321/auto-access-always-active", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "autoAccessAlwaysActive" => true
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/auto-access-always-active");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("autoAccessAlwaysActive", true);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/auto-access-always-active");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {
  "autoAccessAlwaysActive": true
}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/auto-access-always-active",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "n": 1,
  "nModified": 1,
  "ok": 1
}

Enables or disables the Auto Access Always Active Mode of the device. If this mode is active for a device, the configured sensors door ports will always be in Auto Access mode, doesn't matter the device goes offline or the maximum number of openings are reached.

HTTP Request

POST https://api.raixer.com/devices/:id/auto-access-always-active

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device

Body Parameters

Parameter Required Default Description
autoAccessAlwaysActive Yes N/A A boolean (true/false) that specifies if the Offline Auto Access will be active or not.

Importat notes

Manage Electric Piston

Example request:

curl "https://api.raixer.com/devices/edcba54321/electric-piston/1" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/devices/edcba54321/electric-piston/1")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
req = requests.post("https://api.raixer.com/devices/edcba54321/electric-piston/1", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/devices/edcba54321/electric-piston/1");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/devices/edcba54321/electric-piston/1");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "devices/edcba54321/electric-piston/1",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

// If the movement alarm was activated
{
  "status": "success",
  "msg": "The action activate was executed successfully",
  "deviceId": "abcde54321",
  "result": 1
}

// If the movement alarm was deactivated
{
  "status": "success",
  "msg": "The action activate was executed successfully",
  "deviceId": "abcde54321",
  "result": 0
}

Activates or deactivates the electric piston connected to the door port 3 (middle) of the Access device.

HTTP Request

POST https://api.raixer.com/devices/:id/electric-piston/:action

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the device
action Yes N/A A number that specifies the action (f.e. activate or deactivate) to execute for the electric piston of the device. Has to be one of the following: 1 or 0

Importat notes

Schedules

Example schedule:

{
  "_id": "edcba54321",
  "campaignId": "abcde12345",
  "time": 3,
  "schedule": 1539638640000.0,
  "owner": "fghjkl67890",
  "doorPort": "1",
  "created": "2018-09-15T21:25:59.756Z",
  "updated": "2018-09-15T21:25:59.756Z"
}

To allow an intercom device to listen to bell calls and open the door automatically when they happen, you create a schedule. The API allows you to create, update or delete a schedule. You can retrieve an individual schedule as well as list all of them or list all of them associated to a campaign. Schedules are identified by a unique, random ID.

Create a Schedule

Example request:

curl "https://api.raixer.com/schedules" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X POST
  -d '{"campaignId": "abcde12345", "time": 3, "schedule": 1539638640000}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/schedules")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.request_uri, headers)

body = {
  "campaignId": "abcde12345",
  "time": 3,
  "schedule": 1539638640000
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"campaignId": "abcde12345", "time": 3, "schedule": 1539638640000}
req = requests.post("https://api.raixer.com/schedules", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "campaignId" => "abcde12345", 
  "time" => 3,
  "schedule" => 1539638640000
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/schedules");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("campaignId", "abcde12345");
body.put("time", 3);
body.put("schedule", 1539638640000);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPost("https://api.raixer.com/schedules");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {"campaignId": "abcde12345", "time": 3, "schedule": 1539638640000}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "schedules",
  "method": "POST",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "insertedId": "edcba54321",
  "result": {
      "n": 1,
      "ok": 1
  }
}

Creates a new schedule.

HTTP Request

POST https://api.raixer.com/schedules

Body Parameters

Parameter Required Default Description
campaignId Yes N/A A string that specifies the campaign associated to the schedule.
time Yes N/A A number that specifies the amount of minutes the device will be in listening mode.
schedule Yes N/A A number that specifies the date and time the device will enter the listening mode, in UTC Format.
doorPort No 1 A string that specifies the port of the device that will enter listening mode. If not specified, the device will listen in the default port, the first one (right).

Update a Schedule

Example request:

curl "https://api.raixer.com/schedules/edcba54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -H "Content-Type: application/json" \
  -X PUT
  -d '{"campaignId": "abcde12345", "time": 3, "schedule": 1539638640000}'
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string",
  "Content-Type": "application/json"
}

uri = URI.parse("https://api.raixer.com/schedules/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.request_uri, headers)

body = {
  "campaignId": "abcde12345",
  "time": 3,
  "schedule": 1539638640000
}

req.body = body.to_json

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string", "Content-Type": "application/json"}
data={"campaignId": "abcde12345", "time": 3, "schedule": 1539638640000}
req = requests.put("https://api.raixer.com/schedules/edcba54321", data=data, headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

$body = [
  "campaignId" => "abcde12345",
  "time" => 3,
  "schedule" => 1539638640000
]

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/schedules/edcba54321");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string",
  "Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

JSONObject body = new JSONObject();
body.put("campaignId", "abcde12345");
body.put("time", 3);
body.put("schedule", 1539638640000);
StringEntity params = new StringEntity(body.toString());

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpPut("https://api.raixer.com/schedules/edcba54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");
req.addHeader("Content-Type", "application/json");
req.setEntity(params);

HttpResponse response = client.execute(req);
const https = require("https")

const body = {"campaignId": "abcde12345", "time": 3, "schedule": 1539638640000}

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "schedules/edcba54321",
  "method": "PUT",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string",
    "Content-Type": "application/json",
    "Content-Length": body.toString().length
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write(body)
req.end()

Example response:

{
  "insertedId": "5ba20c5fb0a2ba0015a6f2ab",
  "result": {
      "n": 1,
      "ok": 1
  }
}

Updates a schedule by removing the old one and creating a new one

HTTP Request

PUT https://api.raixer.com/schedules/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the schedule to update

Body Parameters

Parameter Required Default Description
campaignId Yes N/A A string that specifies the campaign associated to the schedule.
time Yes N/A A number that specifies the amount of minutes the device will be in listening mode.
schedule Yes N/A A number that specifies the date and time the device will enter the listening mode, in UTC Format.
doorPort No 1 A string that specifies the port of the device that will enter listening mode. If not specified, the device will listen in the default port, the first one (right).

Delete a Schedule

Example request:

curl "https://api.raixer.com/schedules/edcba54321" \
  -H "Authorization: Basic your_encoded_base64_string" \
  -X DELETE
require 'net/http'
require 'uri'
require 'json'

headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/schedules/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.delete("https://api.raixer.com/schedules/edcba54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/schedules/edcba54321");
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.json.simple.JSONObject;
...

HttpClient client = new DefaultHttpClient();
HttpPost req = new HttpDelete("https://api.raixer.com/schedules/edcba54321");

req.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(req);
const https = require("https")

const options = {
  "hostname": "api.raixer.com",
  "port": 443,
  "path": "schedules/edcba54321",
  "method": "DELETE",
  "headers": {
    "Authorization": "Basic your_encoded_base64_string"
  }
}

let req = https.request(options)

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})
req.write()
req.end()

Example response:

{
  "result": true,
  "msg": "The schedule was deleted correctly"
}

Deletes a schedule.

HTTP Request

DELETE https://api.raixer.com/schedules/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the schedule to delete

Get a Schedule

Example request:

curl "https://api.raixer.com/schedules/edcba54321"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/schedules/edcba54321")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/schedules/edcba54321", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/schedules/edcba54321");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/schedules/edcba54321");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/schedules/edcba54321", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
});
req.on("error", (err) => {
  // Handle error
})

Example response:

{
  "_id": "edcba54321",
  "campaignId": "abcde12345",
  "time": 3,
  "schedule": 1539638640000.0,
  "owner": "fghjkl67890",
  "doorPort": "1",
  "created": "2018-09-15T21:25:59.756Z",
  "updated": "2018-09-15T21:25:59.756Z"
}

Retrieves the details of a schedule that has previously been created.

HTTP Request

GET https://api.raixer.com/schedules/:id

Parameters

Parameter Required Default Description
id Yes N/A A string that specifies the ID of the schedule to retrieve

Get all Schedules

Example request:

curl "https://api.raixer.com/schedules?campaignId=abcde12345"
  -H "Authorization: Basic your_encoded_base64_string"
headers = {
  "Authorization": "Basic your_encoded_base64_string"
}

uri = URI.parse("https://api.raixer.com/schedules?campaignId=abcde12345")
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, headers)

res = http.request(req)
import requests

headers={"Authorization": "Basic your_encoded_base64_string"}
req = requests.get("https://api.raixer.com/schedules?campaignId=abcde12345", headers=headers)
$curl = curl_init(); 

if (!$curl) {
  die("Couldn't initialize a cURL handle"); 
}

curl_setopt($curl, CURLOPT_URL, "https://api.raixer.com/schedules?campaignId=abcde12345");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "Authorization: Basic your_encoded_base64_string"
));

$req = curl_exec($curl); 

if (curl_errno($curl)) {
  echo 'curl error: ' . curl_error($curl); 
} else { 
  // Your following code here
}

curl_close($curl);
...
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpResponse;
...

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://api.raixer.com/schedules?campaignId=abcde12345");

request.addHeader("Authorization", "Basic your_encoded_base64_string");

HttpResponse response = client.execute(request);
const https = require("https")

let req = https.get("https://api.raixer.com/schedules?campaignId=abcde12345", { "Authorization": "Basic your_encoded_base64_string" })

req.on("response", (response) => {
  let data = ""
  response.on("data", (chunk) => {
    data += chunk
  })
  response.on("end", () => {
    // Your following code here
  })
  response.on("error", (err) => {
    // Handle error
  })
})
req.on("error", (err) => {
  // Handle error
})

Example response:

[
  {
    "_id": "edcba54321",
    "campaignId": "abcde12345",
    "time": 3,
    "schedule": 1539638640000.0,
    "owner": "fghjkl67890",
    "doorPort": "1",
    "created": "2018-09-15T21:25:59.756Z",
    "updated": "2018-09-15T21:25:59.756Z"
  },
  {
    "_id": "edcba54322",
    "campaignId": "abcde12345",
    "time": 30,
    "schedule": 1539638840000.0,
    "owner": "fghjkl67890",
    "doorPort": "1",
    "created": "2018-09-15T21:25:59.756Z",
    "updated": "2018-09-15T21:25:59.756Z"
  },
  ...
]

Retrieves all the schedules or all the schedules associated to a campaign.

HTTP Request

GET https://api.raixer.com/schedules?campaignId=abcde12345

Query Parameters

Parameter Required Default Description
campaignId No N/A A string that specifies the ID of the campaign associated to the schedules to retrieve. If not specified, all schedules will be retrieved.

Errors

Our API uses the following error codes:

Code Meaning
400 Bad Request -- Your request is invalid, for example, you didn't provide the necessary parameters for a function or you didn't pass the Content-Type: application/json header.
401 Unauthorized -- You didn't provide any authorization method or your API credentials are wrong. In some cases, also means you are trying to access a device you don't have permission to.
403 Forbidden -- You are trying to access a non existing device.
404 Not Found -- The specified function could not be found or you tried to access a function with an invalid method.
500 Internal Server Error -- We had a problem with our server. Try again later. If the problem persists, please, get in contact with us.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Device Notifications

Our Raixer Devices send notifications when a certain event happens.

Raixer APP

Our Raixer APP receives and displays the following device notifications in each of the devices history and, also, through Push Notifications

Event Trigger Meaning
online Device goes online The device is online
offline Device goes offline The device is offline
doorIsOpen The door in the sensor door port 1 was physically opened The door connected to the sensor door port 1 is physically open
doorIsOpen2 The door in the sensor door port 2 was physically opened The door connected to the sensor door port 2 is physically open
doorIsOpen3 The door in the sensor door port 3 was physically opened The door connected to the sensor door port 3 is physically open
doorIsClosed The door in the sensor door port 1 was physically closed The door connected to the sensor door port 1 is physically closed
doorIsClosed2 The door in the sensor door port 2 was physically closed The door connected to the sensor door port 2 is physically closed
doorIsClosed3 The door in the sensor door port 3 was physically closed The door connected to the sensor door port 3 is physically closed
doorOpened The device in Auto Access mode opened the door connected to the sensor door port 1 The door connected to the sensor door port 1 of the device was opened in Auto Access mode.
doorOpened2 The device in Auto Access mode opened the door connected to the sensor door port 2 The door connected to the sensor door port 2 of the device was opened in Auto Access mode.
doorOpened3 The device in Auto Access mode opened the door connected to the sensor door port 3 The door connected to the sensor door port 3 of the device was opened in Auto Access mode.
stopJob Auto Access of sensor door port 1 ended The Auto Access mode of the door connected in the sensor door port 1 ended because its time ended or because someone ended it.
stopJob2 Auto Access of sensor door port 2 ended The Auto Access mode of the door connected in the sensor door port 2 ended because its time ended or because someone ended it.
stopJob3 Auto Access of sensor door port 2 ended The Auto Access mode of the door connected in the sensor door port 2 ended because its time ended or because someone ended it.
deleteJobAutoAccess Scheduled Auto Access session of sensor door port 1 deleted automatically A scheduled Auto Access session for sensor door port 1 was deleted automatically because we weren't able to initiate it after several retries
deleteJobAutoAccess2 Scheduled Auto Access session of sensor door port 2 deleted automatically A scheduled Auto Access session for sensor door port 2 was deleted automatically because we weren't able to initiate it after several retries
deleteJobAutoAccess3 Scheduled Auto Access session of sensor door port 3 deleted automatically A scheduled Auto Access session for sensor door port 3 was deleted automatically because we weren't able to initiate it after several retries
phoneCall Phone call access of sensor door port 1 The device detected a Phone Call to the Phone associated to the sensor door port 1 and opened the door.
phoneCall2 Phone call access of sensor door port 2 The device detected a Phone Call to the Phone associated to the sensor door port 2 and opened the door.
phoneCall3 Phone call access of sensor door port 3 The device detected a Phone Call to the Phone associated to the sensor door port 3 and opened the door.
phoneCallOffline Phone call access of sensor door port 1 and device offline The device detected a Phone Call to the Phone associated to the sensor door port 1 but could not open the door because it was offline.
phoneCallOffline2 Phone call access of sensor door port 2 and device offline The device detected a Phone Call to the Phone associated to the sensor door port 2 but could not open the door because it was offline.
phoneCallOffline3 Phone call access of sensor door port 3 and device offline The device detected a Phone Call to the Phone associated to the sensor door port 3 but could not open the door because it was offline.
accessByCode Code access of sensor door port 1 The device detected a Code access to the Code URL associated to the sensor door port 1 and opened the door.
accessByCode2 Code access of sensor door port 2 The device detected a Code access to the Code URL associated to the sensor door port 2 and opened the door.
accessByCode3 Code access of sensor door port 3 The device detected a Code access to the Code URL associated to the sensor door port 3 and opened the door.
accesssByCodeOffline Code access with device offline The device was offline when someone triedd to open a door with Code access
openDoor Door of sensor door port 1 was opened The door connected to the sensor door port 1 of the device was opened.
openDoor2 Door of sensor door port 2 was opened The door connected to the sensor door port 2 of the device was opened.
openDoor3 Door of sensor door port 3 was opened The door connected to the sensor door port 3 of the device was opened.
openDoorAssistant Door of sensor door port 1 was opened by Google assistant or Alexa The door connected to the sensor door port 1 of the device was opened by Google assistant or Alexa.
openDoorAssistant2 Door of sensor door port 2 was opened by Google assistant or Alexa The door connected to the sensor door port 2 of the device was opened by Google assistant or Alexa.
openDoorAssistant3 Door of sensor door port 3 was opened by Google assistant or Alexa The door connected to the sensor door port 3 of the device was opened by Google assistant or Alexa.
startJob Started Auto Access of door port 1 The Auto Access Mode was started for the door connected to the sensor door port 1 of the device.
startJob2 Started Auto Access of door port 2 The Auto Access Mode was started for the door connected to the sensor door port 2 of the device.
startJob3 Started Auto Access of door port 3 The Auto Access Mode was started for the door connected to the sensor door port 3 of the device.
startJobAutoAccess Started Scheduled Auto Access of door port 1 A Scheduled Auto Access Mode was started for the door connected to the sensor door port 1 of the device.
startJobAutoAccess2 Started Scheduled Auto Access of door port 2 A Scheduled Auto Access Mode was started for the door connected to the sensor door port 2 of the device.
startJobAutoAccess3 Started Scheduled Auto Access of door port 3 A Scheduled Auto Access Mode was started for the door connected to the sensor door port 3 of the device.
movementDetected Device detected movement The movement sensor connected to any of the sensor ports of the device detected movement
soundAlarm Sound alarm triggeredd The sound alarm was triggered because the device detected excesive noise
soundDetected Sound detected Sound was detected, not enough to trigger the sound alarm though
powerIn Power restored The power has been restored and the battery is charging. The device is functioning on power again
powerOut Power outage The power has been cut and the battery is beign used by the device
physicalButton Physical open button pressed The physical open button on the device has been pressed
offlinePistonOpeningStarted Device is offline The device is offline and started its' procedure to open the piston
offlinePistonOpeningEnded Device is offline The device is offline and ended its' procedure to open the piston. The piston is open
pistonActivated Piston activated The piston was activated
pistonDeactivated Piston deactivated The piston was deactivated
sleep Device goes into sleep mode The device is sleeping
wokeup Device woke up from sleep The device woke up from sleep and is now online
energySaveActivated Energy save activated The energy save mode was activated
energySaveDeactivated Energy save deactivated The energy save mode was deactivated
nukiUnlock Nuki unlocked The Nuki received and executed the unlock command
nukiClose Nuki closed The Nuki received and executed the close command
nukiOpen Nuki opened The Nuki received and executed the open command
gyroUnlock Gyro unlocked The Gyro received and executed the unlock command Not yet available
gyroClose Gyro closed The Gyro received and executed the close command Not yet available
gyroOpen Gyro opened The Gyro received and executed the open command Not yet available
bellRing Bell ring for door in port 1 The door connected to the port 1 and calibrated with a bell sound detected a bell ring Not yet available
bellRing2 Bell ring for door in port 2 The door connected to the port 2 and calibrated with a bell sound detected a bell ring Not yet available
bellRing3 Bell ring for door in port 3 The door connected to the port 3 and calibrated with a bell sound detected a bell ring Not yet available

Webhooks

Example webhook body:

{
  "deviceId": "abcde12345",
  "event": "online",
  "dateTime": "2021-04-15T08:56:14.818Z",
  "owner": "fghjkl67890",
  "doorId": "edcba54321",
  "details": "Lorem ipsum"
}

We also send the following events to our Raixer APIs' users, through their own webhooks URLs previously given to us

Event Trigger Meaning
online Device goes online The device is online
offline Device goes offline The device is offline
door-open The door connected to any of the sensor door ports was physically opened The door connected to any of the sensor door ports is physically open
door-closed The door connected to any of the sensor door ports was physically closed The door connected to any of the sensor door ports is physically closed
movement-1 Device detected movement The movement sensor connected to any of the sensor ports of the device detected movement
movement-0 Device detected no movement The movement sensor connected to any of the sensor ports of the device detected no movement
power-in Device detected power in The device detected that the power was restored and it is now charging it's battery
power-out Device detected power out The device detected that the power was cut and it is now using it's battery to function.
mainButton-press Device detected main button press The device detected that the it's main button (the physical button) was pressed
phone-opened Phone call access The device detected a Phone Call to the Phone associated to a sensor door and opened the door.
phone-call-offline Phone call access and device offline The device detected a Phone Call to the Phone associated to a sensor door port but could not open the door because it was offline.
phone-nuki-opened Phone call access to the Nuki The device detected a Phone Call to the Phone associated to the Nuki and opened the Nuki.
phone-nuki-unlocked Phone call access to the Nuki The device detected a Phone Call to the Phone associated to the Nuki and unlocked the Nuki.
start-job Started Auto Access The Auto Access Mode was started for the door connected to a sensor door port.
stop-job Auto Access ended The Auto Access Mode for the door connected to a sensor door port ended because its' time ran out.
open-door Door of sensor door port was opened The door connected to a sensor door port of the device was opened.
sound-hisory-1 Sound detected Sound was detected, not enough to trigger the sound alarm though
sound-1 Sound alarm triggeredd The sound alarm was triggered because the device detected excesive noise
behaviourUnblocked-openClosed Door status reporting was unblocked The door status reporting was unblocked because it was configured properly and no longer breaks our reporting rules
behaviourUnblocked-autoAccess Auto access reporting was unblocked The Auto Access reporting was unblocked because it was configured properly and no longer breaks our reporting rules
sleep-1 Device goes into sleep mode The device is sleeping
sleep-0 Device woke up from sleep The device woke up from sleep and is now online

Weebhook body

Parameter Always present Description
deviceId Yes A string that specifies the ID of the device that registered the event
event Yes A string that specifies the triggered event. It always will be one from the list above
dateTime Yes A string that specifies the date and time the event was triggered and registered
owner Yes A string that specifies the user that made the operation or the owner of the device if no user made the operation
doorId No A string that specifies the ID of the door of the above device that registered the event
details No A string that specifies any extra details associated to the event (i.e. the phone number that made the call) Not yet available