NAV Navbar
logo
shell ruby java python javascript
  • Introduction
  • Authentication
  • Users
  • Organizations
  • Sites
  • Meters
  • Appliances
  • Entities Metadata
  • Raw Data
  • Consumptions
  • Costs
  • Tariffs
  • Report Definitions
  • Errors
  • Introduction

    Welcome to the Wattics API! You can use our API to access your data pushed to Wattics Dashboard stored in our database.

    We have examples in Shell and Ruby. 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.

    Authentication

    To authorize all requests, use your user's API Token created on Dashboard as an Authorization header in the request.

    curl -X GET \
      https://api.wattics.com/api/v1/RESOURCE \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://api.wattics.com/api/v1/RESOURCE")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("http://api.wattics.com/api/v1/RESOURCEhttps://api.wattics.com/api/v1/RESOURCE")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "http://api.wattics.com/api/v1/RESOURCE"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "http://api.wattics.com/api/v1/RESOURCE");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    Make sure to replace YOUR_API_TOKEN_HERE with your API key.

    To make API calls you will need your personal API token which can be found under My Account.

    Wattics API expects for the API key to be included in all API requests to the server in a header that looks like the following:

    Authorization: YOUR_API_TOKEN_HERE

    Users

    Create an User

    curl -X POST \
      https://api.wattics.com/api/v1/users \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "user": {
        "name": "John",
        "surname": "Doe",
        "email": "john@email.com",
        "plan": "Data import"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/users")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"user\": {\n\t\t\"name\": \"John\",\n\t\t\"surname\": \"Doe\",\n\t\t\"email\": \"john@email.com\",\n\t\t\"plan\": \"Data import\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.post("https://api.wattics.com/api/v1/users")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"user\": {\n\t\t\"name\": \"John\",\n\t\t\"surname\": \"Doe\",\n\t\t\"email\": \"john@email.com\",\n\t\t\"plan\": \"Data import\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/users"
    
    payload = "{\n\t\"user\": {\n\t\t\"name\": \"John\",\n\t\t\"surname\": \"Doe\",\n\t\t\"email\": \"john@email.com\",\n\t\t\"plan\": \"Data import\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE"
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "user": {
        "name": "John",
        "surname": "Doe",
        "email": "john@email.com",
        "plan": "Data import"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("POST", "https://api.wattics.com/api/v1/users");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true,
      "id": NEW_USER_ID
    }
    

    This endpoint creates a new user.

    HTTP Request

    POST https://api.wattics.com/api/v1/users

    User Parameters

    Parameter Description Optional
    NAME The name of the user NO
    SURNAME The surname of the user NO
    E-MAIL The e-mail of the user NO
    PLAN The plan of the user NO

    Associate User to Site

    curl -X PATCH \
      https://api.wattics.com/api/v1/users/USER_ID/grant_site_access \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "site_id": 1
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/users/USER_ID/grant_site_access")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Patch.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"site_id\": 1\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.patch("https://api.wattics.com/api/v1/users/USER_ID/grant_site_access")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"site_id\": 1\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/users/USER_ID/grant_site_access"
    
    payload = "{\n\t\"site_id\": 1\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE"
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "site_id": 1
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("PATCH", "https://api.wattics.com/api/v1/users/USER_ID/grant_site_access");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint grants permission to an specific user to access a specific site.

    HTTP Request

    PATCH https://api.wattics.com/api/v1/users/<USER_ID>/grant_site_access

    URL Parameters

    Parameter Description Optional
    USER_ID The ID of the user NO
    SITE_ID The ID of the site NO

    Show User Details by E-mail

    curl -X GET \
      https://api.wattics.com/api/v1/users/show_by_email?email=john@email.com \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/users/show_by_email?email=john@email.com")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/users/show_by_email?email=john@email.com")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/users/show_by_email?email=john@email.com"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE"
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/users/show_by_email?email=john@email.com");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "name": "John",
      "surname": "Doe",
      "email": "john@email.com",
      "notes": "Something noted"
    }
    

    This endpoint shows the details of a certain user searching by its e-mail.

    HTTP Request

    GET https://api.wattics.com/api/v1/users/show_by_email?email=<EMAIL>

    URL Parameters

    Parameter Description Optional
    EMAIL E-mail of the user NO

    Associate User to Report Definition

    curl -X PATCH \
      https://api.wattics.com/api/v1/users/USER_ID/associate_to_report \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "report_definition_id": REPORT_DEFINITION_ID
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/users/USER_ID/associate_to_report")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Patch.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"report_definition_id\": REPORT_DEFINITION_ID\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.patch("https://api.wattics.com/api/v1/users/USER_ID/associate_to_report")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"report_definition_id\": REPORT_DEFINITION_ID\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/users/USER_ID/associate_to_report"
    
    payload = "{\n\t\"report_definition_id\": REPORT_DEFINITION_ID\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = "{\n\t\"report_definition_id\": REPORT_DEFINITION_ID\n}";
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("PATCH", "https://api.wattics.com/api/v1/users/USER_ID/associate_to_report");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint grants permission to an specific user to receive a specific report.

    HTTP Request

    PATCH https://api.wattics.com/api/v1/users/<USER_ID>/associate_to_report

    URL Parameters

    Parameter Description Optional
    USER_ID The ID of the user NO
    REPORT_DEFINITION_ID The ID of the report definition NO

    Organizations

    Get All Organizations

    curl -X GET \
      https://api.wattics.com/api/v1/organizations \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/organizations")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/organizations")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/organizations"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/organizations");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above commands returns JSON structured like this:

    [
      {
        "id": 1,
        "name": "Organization 1"
      },
      {
        "id": 2,
        "name": "Organization 2"
      },
      {
        "id": 3,
        "name": "Organization 3"
      }
    ]
    

    This endpoint retrieves all organizations that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/organizations

    Create an Organization

    curl -X POST \
      https://api.wattics.com/api/v1/organizations \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "organization": {
        "name": "My New Organization"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/organizations")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"organization\": {\n\t\t\"name\": \"My New Organization\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.post("https://api.wattics.com/api/v1/organizations")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"organization\": {\n\t\t\"name\": \"My New Organization\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/organizations"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"My New Organization\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "organization": {
        "name": "My New Organization"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("POST", "https://api.wattics.com/api/v1/organizations");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true,
      "id": NEW_ORGANIZATION_ID
    }
    

    This endpoint creates a new organization.

    HTTP Request

    POST https://api.wattics.com/api/v1/organizations

    Organization Parameters

    Parameter Description Optional
    NAME The name of the organization NO

    Update an Organization

    curl -X PATCH \
      https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "organization": {
        "name": "Other name"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Patch.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.patch("https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "organization": {
        "name": "Other name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("PATCH", "https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint updates an existing organization.

    HTTP Request

    PATCH https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID

    Organization Parameters

    Parameter Description Optional
    ORGANIZATION_ID id of the organization NO
    NAME The name of the organization YES

    Delete an Organization

    curl -X DELETE \
      https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Delete.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    
    HttpResponse<String> response = Unirest.delete("https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("DELETE", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "organization": {
        "name": "Other name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("DELETE", "https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint deletes an existing organization.

    HTTP Request

    DELETE https://api.wattics.com/api/v1/organizations/ORGANIZATION_ID

    Organization Parameters

    Parameter Description Optional
    ORGANIZATION_ID id of the organization NO

    Sites

    Get Sites of an Organization

    curl -X GET \
      https://api.wattics.com/api/v1/sites \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites?organization_id=1")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/sites?organization_id=1")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites?organization_id=1"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/sites?organization_id=1");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "id": 1,
        "name": "Site 1",
        "address": {
          "line_1": "The Guinness Enterprise Center",
          "line_2": "Taylor’s Ln",
          "line_3": "Dublin 8, Ireland",
          "city": "Dublin",
          "county": "Dublin",
          "country": "Ireland"
        },
        "contact": {
          "name": "John Doe",
          "email": "john@wattics.com",
          "phone_number": "353 01234 5678",
          "mobile_phone_number": "353 01234 5678"
        }
      },
      {
        "id": 2,
        "name": "Site 2",
        "address": {
          "line_1": "College Green",
          "line_2": "Dublin 2, Ireland",
          "line_3": "",
          "city": "Dublin",
          "county": "Dublin",
          "country": "Ireland"
        },
        "contact": {
          "name": "Mike Doe",
          "email": "mike@wattics.com",
          "phone_number": "353 01234 5678",
          "mobile_phone_number": "353 01234 5678"
        }
      }
    ]
    

    This endpoint retrieves all sites of an organization that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/sites?organization_id=<ORGANIZATION_ID>

    URL Parameters

    Parameter Description
    ORGANIZATION_ID (Optional) The ID of the organization that contains the sites. Use it if you want to filter them.

    Get a Specific Site

    curl -X GET \
      https://api.wattics.com/api/v1/sites/1 \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites/1")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/sites/1")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites/1"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/sites/1");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    
    {
      "id": 1,
      "name": "Site 1",
      "address": {
        "line_1": "The Guinness Enterprise Center",
        "line_2": "Taylor’s Ln",
        "line_3": "Dublin 8, Ireland",
        "city": "Dublin",
        "county": "Dublin",
        "country": "Ireland"
      },
      "contact": {
        "name": "John Doe",
        "email": "john@wattics.com",
        "phone_number": "353 01234 5678",
        "mobile_phone_number": "353 01234 5678"
      }
    }
    

    This endpoint retrieves a specific site of an organization.

    HTTP Request

    GET http://api.wattics.com/api/v1/sites/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the site to retrieve

    Create a Site

    curl -X POST \
      https://api.wattics.com/api/v1/sites \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "site": {
        "organization_id": 1,
        "name": "Dublin Office",
        "city": "Dublin",
        "country": "Ireland",
        "address": "Taylors Lane",
        "contact_name": "John Doe",
        "contact_email": "john.doe@wattics.com"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{ \n\t\"site\": {\n\t\t\"organization_id\": 1,\n\t\t\"name\": \"Dublin Office\",\n\t\t\"city\": \"Dublin\",\n\t\t\"country\": \"Ireland\",\n\t\t\"address\": \"Taylors Lane\",\n\t\t\"contact_name\": \"John Doe\",\n\t\t\"contact_email\": \"john.doe@wattics.com\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.post("https://api.wattics.com/api/v1/sites")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{ \n\t\"site\": {\n\t\t\"organization_id\": 1,\n\t\t\"name\": \"Dublin Office\",\n\t\t\"city\": \"Dublin\",\n\t\t\"country\": \"Ireland\",\n\t\t\"address\": \"Taylors Lane\",\n\t\t\"contact_name\": \"John Doe\",\n\t\t\"contact_email\": \"john.doe@wattics.com\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites"
    
    payload = "{ \n\t\"site\": {\n\t\t\"organization_id\": 1,\n\t\t\"name\": \"Dublin Office\",\n\t\t\"city\": \"Dublin\",\n\t\t\"country\": \"Ireland\",\n\t\t\"address\": \"Taylors Lane\",\n\t\t\"contact_name\": \"John Doe\",\n\t\t\"contact_email\": \"john.doe@wattics.com\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "site": {
        "organization_id": 1,
        "name": "Dublin Office",
        "city": "Dublin",
        "country": "Ireland",
        "address": "Taylors Lane",
        "contact_name": "John Doe",
        "contact_email": "john.doe@wattics.com"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("POST", "https://api.wattics.com/api/v1/sites");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true,
      "id": NEW_SITE_ID
    }
    

    This endpoint creates a new site.

    HTTP Request

    POST https://api.wattics.com/api/v1/sites

    Site Parameters

    Parameter Description Optional
    ORGANIZATION_ID The organization to place the site in NO
    NAME The name of the site NO
    COUNTRY The country where the site is located NO
    CITY The city where the site is located NO
    CONTACT_NAME Site contact name NO
    CONTACT_EMAIL Site contact email NO
    ADDRESS The address where the site is located YES
    LATITUDE The latitude where the site is located YES
    LONGITUDE The longitude where the site is located YES
    CONTACT_PHONE Site contact landline phone number YES
    CONTACT_MOBILE Site contact mobile phone number YES
    INTEGRATION_TIMEZONE Specific timezone used for some integration scenarios YES

    Update a Site

    curl -X PATCH \
      https://api.wattics.com/api/v1/sites/SITE_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "site": {
        "name": "New name"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites/SITE_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Patch.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.patch("https://api.wattics.com/api/v1/sites/SITE_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites/SITE_ID"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "site": {
        "name": "New name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("PATCH", "https://api.wattics.com/api/v1/sites/SITE_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint updates an existing site.

    HTTP Request

    PATCH https://api.wattics.com/api/v1/sites/SITE_ID

    Site Parameters

    Parameter Description Optional
    SITE_ID id of the site to be updated NO
    NAME The name of the site YES
    COUNTRY The country where the site is located YES
    CITY The city where the site is located YES
    CONTACT_NAME Site contact name YES
    CONTACT_EMAIL Site contact email YES
    ADDRESS The address where the site is located YES
    LATITUDE The latitude where the site is located YES
    LONGITUDE The longitude where the site is located YES
    CONTACT_PHONE Site contact landline phone number YES
    CONTACT_MOBILE Site contact mobile phone number YES
    INTEGRATION_TIMEZONE Specific timezone used for some integration scenarios YES

    Delete a Site

    curl -X
    ## Delete a Site
    
    ```shell
    curl -X DELETE \
      https://api.wattics.com/api/v1/sites/SITE_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites/SITE_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Delete.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    
    HttpResponse<String> response = Unirest.delete("https://api.wattics.com/api/v1/sites/SITE_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites/SITE_ID"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("DELETE", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "organization": {
        "name": "Other name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("DELETE", "https://api.wattics.com/api/v1/sites/SITE_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint deletes an existing site.

    HTTP Request

    DELETE https://api.wattics.com/api/v1/sites/SITE_ID

    Site Parameters

    Parameter Description Optional
    SITE_ID id of the site NO

    Meters

    Get Meters of a Site

    curl -X GET \
      https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1 \
      -H 'Authoriza&site_id=1tion: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "id": 1,
        "reference": "m01234345",
        "name": "Meter 01",
        "type": "electricity",
        "process_sampling_rate_minutes": 5,
        "unit": "Watt",
        "wh_per_pulse": 1,
        "reading": "Interval",
        "real_meter": true,
        "is_shared_across_sites": false,
        "data_type": "generic",
        "temperature_unit": null,
        "base_temperature": null,
        "years_to_import": null,
        "station_id": null
      },
      {
        "id": 2,
        "reference": "7874878",
        "name": "Meter 02",
        "type": "water",
        "process_sampling_rate_minutes": 15,
        "unit": null,
        "wh_per_pulse": 1,
        "reading": "Interval",
        "real_meter": true,
        "is_shared_across_sites": false,
        "data_type": "generic",
        "temperature_unit": null,
        "base_temperature": null,
        "years_to_import": null,
        "station_id": null
      },
      {
        "id": 3,
        "reference": "223133",
        "name": "Meter 03",
        "type": "gas",
        "process_sampling_rate_minutes": 15,
        "unit": null,
        "wh_per_pulse": 1,
        "reading": "Interval",
        "real_meter": true,
        "is_shared_across_sites": false,
        "data_type": "generic",
        "temperature_unit": null,
        "base_temperature": null,
        "years_to_import": null,
        "station_id": null
      },
      {
        "id": 4,
        "reference": "abc46583",
        "name": " Meter 04 Generic",
        "type": "numeric_value",
        "process_sampling_rate_minutes": 5,
        "unit": "1",
        "wh_per_pulse": 1,
        "reading": "Interval",
        "real_meter": true,
        "is_shared_across_sites": false,
        "data_type": "generic",
        "temperature_unit": null,
        "base_temperature": null,
        "years_to_import": null,
        "station_id": null
      }
    ]
    

    This endpoint retrieves all meters of a site that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/meters?organization_id=<ORGANIZATION_ID>&site_id=<SITE_ID>

    URL Parameters

    Parameter Description Optional
    ORGANIZATION_ID The ID of the organization that contains the meter YES
    SITE_ID The ID of the site that contains the meters YES

    Get a Specific Meter

    curl -X GET \
      https://api.wattics.com/api/v1/meters/1 \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/1")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters/1")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/1"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters/1");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "reference": "m01234345",
      "name": "Meter 01",
      "type": "electricity",
      "process_sampling_rate_minutes": 5,
      "unit": "Watt",
      "wh_per_pulse": 1,
      "reading": "Interval",
      "real_meter": true,
      "is_shared_across_sites": false,
      "data_type": "generic",
      "temperature_unit": null,
      "base_temperature": null,
      "years_to_import": null,
      "station_id": null
    }
    

    This endpoint retrieves a specific meter of a site.

    HTTP Request

    GET http://api.wattics.com/api/v1/organizations/<ORGANIZATION_ID>/sites/<SITE_ID>/meters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the meter to retrieve

    Create a Meter

    curl -X POST \
      https://api.wattics.com/api/v1/meters \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "meter": {
        "name": "Meter 1",
        "site_id": 1,
        "type": "electricity",
        "reference": "meter-1234-0000",
        "param_type": "all",
        "reading": "cum",
        "process_sampling_rate": 5
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"meter\": {\n\t\t\"name\": \"Meter 1\",\n\t\t\"site_id\": 1,\n\t\t\"type\": \"electricity\",\n\t\t\"reference\": \"meter-1234-0000\",\n\t\t\"param_type\": \"all\",\n\t\t\"reading\": \"cum\",\n\t\t\"process_sampling_rate\": 5\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.post("https://api.wattics.com/api/v1/meters")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"meter\": {\n\t\t\"name\": \"Meter 1\",\n\t\t\"site_id\": 1,\n\t\t\"type\": \"electricity\",\n\t\t\"reference\": \"meter-1234-0000\",\n\t\t\"param_type\": \"all\",\n\t\t\"reading\": \"cum\",\n\t\t\"process_sampling_rate\": 5\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters"
    
    payload = "{\n\t\"meter\": {\n\t\t\"name\": \"Meter 1\",\n\t\t\"site_id\": 1,\n\t\t\"type\": \"electricity\",\n\t\t\"reference\": \"meter-1234-0000\",\n\t\t\"param_type\": \"all\",\n\t\t\"reading\": \"cum\",\n\t\t\"process_sampling_rate\": 5\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "meter": {
        "name": "Meter 1",
        "site_id": 1,
        "type": "electricity",
        "reference": "meter-1234-0000",
        "param_type": "all",
        "reading": "cum",
        "process_sampling_rate": 5
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("POST", "https://api.wattics.com/api/v1/meters");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true,
      "id": NEW_METER_ID
    }
    

    This endpoint creates a new meter.

    HTTP Request

    POST https://api.wattics.com/api/v1/meters

    Meter Parameters

    Parameter Description Optional
    SITE_ID site to place meter NO
    NAME meter name NO
    REFERENCE meter unique reference NO
    TYPE electricity/gas/water/numeric_value NO
    REAL_METER true/false Use only with electricity
    READING cum (cumulative) / avg (interval) NO
    UNIT kWh for example NO
    PARAM_TYPE channel param type all/one NO
    PROCESS_SAMPLING_RATE minutes - 5/10/15/30/60/1440 (1 day) NO
    DATA_TYPE hdd/cdd Use only with numeric values
    YEARS_TO_IMPORT amount of years before today Use only with numeric values
    TEMPERATURE_UNIT C (celsius) / F (Fareinheit) Use only with numeric values HDD and CDD
    BASE_TEMPERATURE base temperature Use only with numeric values
    AGGREGATION_ELABORATION cum/avg Use only with numeric values
    CT_FACTOR - YES
    PT_FACTOR - YES
    CONVERSION_FACTOR - YES
    IS_SHARED_ACROSS_SITES - YES
    USE_ACTIVE_ENERGY_RECEIVED - YES
    USE_THRESHOLD_INTERPOLATION - YES
    THRESHOLD_INTERPOLATION_VALUE - YES

    Update a Meter

    curl -X PATCH \
      https://api.wattics.com/api/v1/meters/METER_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "meter": {
        "name": "New name"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/METER_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Patch.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"meter\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.patch("https://api.wattics.com/api/v1/meters/METER_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"meter\": {\n\t\t\"name\": \"Other name\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/METER_ID"
    
    payload = "{\n\t\"meter\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "meter": {
        "name": "New name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("PATCH", "https://api.wattics.com/api/v1/meters/METER_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint updates an existing meter.

    HTTP Request

    PATCH https://api.wattics.com/api/v1/meters/METER_ID

    Meter Parameters

    Parameter Description Optional
    ID meter id YES
    SITE_ID site to place meter YES
    NAME meter name YES
    REFERENCE meter unique reference YES
    REAL_METER true/false Use only with electricity
    READING cum (cumulative) / avg (interval) YES
    UNIT kWh for example YES
    PARAM_TYPE channel param type all/one YES
    PROCESS_SAMPLING_RATE minutes - 5/10/15/30/60/1440 (1 day) YES
    DATA_TYPE hdd/cdd Use only with numeric values
    YEARS_TO_IMPORT amount of years before today Use only with numeric values
    TEMPERATURE_UNIT C (celsius) / F (Fareinheit) Use only with numeric values HDD and CDD
    BASE_TEMPERATURE base temperature Use only with numeric values
    AGGREGATION_ELABORATION cum/avg Use only with numeric values
    CT_FACTOR - YES
    PT_FACTOR - YES
    CONVERSION_FACTOR - YES
    IS_SHARED_ACROSS_SITES - YES
    USE_ACTIVE_ENERGY_RECEIVED - YES
    USE_THRESHOLD_INTERPOLATION - YES
    THRESHOLD_INTERPOLATION_VALUE - YES

    Delete a Meter

    curl -X DELETE \
      https://api.wattics.com/api/v1/meters/METER_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/METER_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Delete.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    
    HttpResponse<String> response = Unirest.delete("https://api.wattics.com/api/v1/meters/METER_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/METER_ID"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("DELETE", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "organization": {
        "name": "Other name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("DELETE", "https://api.wattics.com/api/v1/meters/METER_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint deletes an existing meter.

    HTTP Request

    DELETE https://api.wattics.com/api/v1/meters/METER_ID

    Meter Parameters

    Parameter Description Optional
    METER_ID id of the meter NO

    Appliances

    Get Appliances of a Meter

    curl -X GET \
      https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1&meter_id=1 \
      -H 'Authoriza&site_id=1tion: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1&meter_id=1")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1&meter_id=1")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1&meter_id=1"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters?organization_id=1&site_id=1&meter_id=1");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "id": 1,
        "reference": "ap9011",
        "name": "A001",
        "process_sampling_rate_minutes": 15,
        "unit": "Watt",
        "reading": "Interval"
      },
      {
        "id": 2,
        "reference": "ap9012",
        "name": "A002",
        "process_sampling_rate_minutes": 15,
        "unit": "Watt",
        "reading": "Interval"
      }
    ]
    

    This endpoint retrieves all appliances of a meter that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/organization_id=<ORGANIZATION_ID>&site_id=<SITE_ID>&meter_id=<METER_ID>

    URL Parameters

    Parameter Description Optional
    ORGANIZATION_ID The ID of the organization that contains the appliances YES
    SITE_ID The ID of the site that contains the appliances YES
    METER_ID The ID of the meter that contains the appliances YES

    Get a Specific Appliance

    curl -X GET \
      https://api.wattics.com/api/v1/appliances/1 \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances/1")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/appliances/1")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances/1"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/appliances/1");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "reference": "ap9011",
      "name": "A001",
      "process_sampling_rate_minutes": 15,
      "unit": "Watt",
      "reading": "Interval"
    }
    

    This endpoint retrieves a specific appliance of a meter.

    HTTP Request

    GET https://api.wattics.com/api/v1/appliances/ID

    URL Parameters

    Parameter Description
    ID The ID of the appliance to retrieves

    Create an Appliance

    curl -X POST \
      https://api.wattics.com/api/v1/appliances \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "appliance": {
        "meter_id": 1, 
        "name": "Fan",
        "reference": "app0123-99",
        "process_sampling_rate": 5,
        "reading": "avg",
        "channel_param_type": "one"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"appliance\": {\n\t\t\"meter_id\": 1, \n\t\t\"name\": \"Fan\",\n\t\t\"reference\": \"app0123-99\",\n\t\t\"process_sampling_rate\": 5,\n\t\t\"reading\": \"avg\",\n\t\t\"channel_param_type\": \"one\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.post("https://api.wattics.com/api/v1/appliances")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"appliance\": {\n\t\t\"meter_id\": 1, \n\t\t\"name\": \"Fan\",\n\t\t\"reference\": \"app0123-99\",\n\t\t\"process_sampling_rate\": 5,\n\t\t\"reading\": \"avg\",\n\t\t\"channel_param_type\": \"one\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances"
    
    payload = "{\n\t\"appliance\": {\n\t\t\"meter_id\": 1, \n\t\t\"name\": \"Fan\",\n\t\t\"reference\": \"app0123-99\",\n\t\t\"process_sampling_rate\": 5,\n\t\t\"reading\": \"avg\",\n\t\t\"channel_param_type\": \"one\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("POST", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "appliance": {
        "meter_id": 1, 
        "name": "Fan",
        "reference": "app0123-99",
        "process_sampling_rate": 5,
        "reading": "avg",
        "channel_param_type": "one"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("POST", "https://api.wattics.com/api/v1/appliances");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true,
      "id": NEW_APPLIANCE_ID
    }
    

    This endpoint creates a new appliance.

    HTTP Request

    POST https://api.wattics.com/api/v1/appliances

    Appliance Parameters

    Parameter Description Optional
    METER_ID meter to place appliance NO
    NAME meter name NO
    REFERENCE meter unique reference NO
    READING cum (cumulative) / avg (interval) NO
    PROCESS_SAMPLING_RATE minutes - 5/10/15/30/60/1440 (1 day) NO
    CHANNEL_PARAM_TYPE channel param type all/one NO

    Update an Appliance

    curl -X PATCH \
      https://api.wattics.com/api/v1/appliances/APPLIANCE_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
      -d '{
      "meter": {
        "name": "New name"
      }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances/APPLIANCE_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Patch.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    request.body = "{\n\t\"meter\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.patch("https://api.wattics.com/api/v1/appliances/APPLIANCE_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .body("{\n\t\"meter\": {\n\t\t\"name\": \"Other name\"\n\t}\n}")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances/APPLIANCE_ID"
    
    payload = "{\n\t\"meter\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("PATCH", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "meter": {
        "name": "New name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("PATCH", "https://api.wattics.com/api/v1/appliances/APPLIANCE_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint updates an existing appliance.

    HTTP Request

    PATCH https://api.wattics.com/api/v1/appliances/APPLIANCE_ID

    Appliance Parameters

    Parameter Description Optional
    ID appliance id YES
    METER_ID meter to place appliance NO
    NAME meter name NO
    REFERENCE meter unique reference NO
    READING cum (cumulative) / avg (interval) NO
    PROCESS_SAMPLING_RATE minutes - 5/10/15/30/60/1440 (1 day) NO
    CHANNEL_PARAM_TYPE channel param type all/one NO

    Delete an Appliance

    curl -X DELETE \
      https://api.wattics.com/api/v1/appliances/APPLIANCE_ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances/APPLIANCE_ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Delete.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    
    HttpResponse<String> response = Unirest.delete("https://api.wattics.com/api/v1/appliances/APPLIANCE_ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances/APPLIANCE_ID"
    
    payload = "{\n\t\"organization\": {\n\t\t\"name\": \"Other name\"\n\t}\n}"
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("DELETE", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify({
      "organization": {
        "name": "Other name"
      }
    });
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("DELETE", "https://api.wattics.com/api/v1/appliances/APPLIANCE_ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    This endpoint deletes an existing appliance.

    HTTP Request

    DELETE https://api.wattics.com/api/v1/appliances/APPLIANCE_ID

    Appliance Parameters

    Parameter Description Optional
    APPLIANCE_ID id of the appliance NO

    Entities Metadata

    Get Metadata of a Site

    curl -X GET \
      https://api.wattics.com/api/v1/sites/ID/metadata \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites/ID/metadata")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/sites/ID/metadatahttps://api.wattics.com/api/v1/sites/ID/metadata")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites/ID/metadata"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/sites/ID/metadata");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "title": "What is the size of the building in m2?",
        "type": "double",
        "value": 200.5
      },
      {
        "title": "How many employees?",
        "type": "int",
        "value": 80
      }
    ]
    

    This endpoint retrieves all metadata of a site that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/sites/<SITE_ID>/metadata

    URL Parameters

    Parameter Description
    SITE_ID The ID of the site that contains the metadata

    Get Metadata of a Meter

    curl -X GET \
      https://api.wattics.com/api/v1/meters/ID/metadata \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/ID/metadata")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters/ID/metadata")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/ID/metadata"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters/ID/metadata");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "title": "Which is the model of the meter?",
        "type": "text",
        "value": "M01234"
      },
      {
        "title": "Is the meter a new model?",
        "type": "bool",
        "value": true
      }
    ]
    

    This endpoint retrieves all metadata of a meter that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/meters/<METER_ID>/metadata

    URL Parameters

    Parameter Description
    METER_ID The ID of the meter that contains the metadata

    Raw Data

    Fetch Raw Data from a Meter

    curl -X GET \
      https://api.wattics.com/api/v1/meters/36/raw_data?from=01/01/2018&to=01/03/2018&data_type=active_power \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/36/raw_data?from=01/01/2018&to=01/03/2018&data_type=active_power")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters/36/raw_data?from=01/01/2018&to=01/03/2018&data_type=active_power")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/36/raw_data?from=01/01/2018&to=01/03/2018&data_type=active_power"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters/36/raw_data?from=01/01/2018&to=01/03/2018&data_type=active_power");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "timestamp": "2018-01-01T20:00:00Z",
        "phase A": 8862.4,
        "phase B": 1413.43,
        "phase C": 2487.5
      },
      {
        "timestamp": "2018-01-01T22:00:00Z",
        "phase A": 8660.86,
        "phase B": 1402.85,
        "phase C": 2481.67
      }
    ]
    
    // Or if SHOW_PHASES is false:
    [
      {
        "timestamp": "2018-01-01T20:00:00Z",
        "total": 12763.33
      },
      {
        "timestamp": "2018-01-01T22:00:00Z",
        "total": 12545.38
      }
    ]
    
    

    HTTP Request

    GET https://api.wattics.com/api/v1/meters/<ID>/raw_data?from=<FROM>&to=<TO>&data_type=<DATA_TYPE>&show_phases=<SHOW_PHASES>

    URL Parameters

    Parameter Description Mandatory? Default
    ID The ID of the meter that contains the raw data. YES -
    FROM Initial Date or DateTime for collect data. YES -
    TO Final Date or DateTime for collect data. The maximum allowed time interval is 90 days. YES -
    DATA_TYPE Used in case of electricity entities. Possible values are: active_power, apparent_power, power_factor, reactive_power, rms_volts, volts and rms_current YES for electricity entities -
    SHOW_PHASES Used in case of electricity entities. Set to false if you don't want to separate phases. NO true

    Fetch Raw Data from an Appliance

    curl -X GET \
      https://api.wattics.com/api/v1/appliances/1/raw_data?from=31/05/2018&to=30/06/2018&data_type=active_power&show_phases=true \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances/1/raw_data?from=31/05/2018&to=30/06/2018&data_type=active_power&show_phases=true")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/appliances/1/raw_data?from=31/05/2018&to=30/06/2018&data_type=active_power&show_phases=true")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances/1/raw_data?from=31/05/2018&to=30/06/2018&data_type=active_power&show_phases=true"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/appliances/1/raw_data?from=31/05/2018&to=30/06/2018&data_type=active_power&show_phases=true");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "timestamp": "2018-01-01T20:00:00Z",
        "phase A": 8862.4,
        "phase B": 1413.43,
        "phase C": 2487.5
      },
      {
        "timestamp": "2018-01-01T22:00:00Z",
        "phase A": 8660.86,
        "phase B": 1402.85,
        "phase C": 2481.67
      }
    ]
    
    // Or if SHOW_PHASES is false:
    [
      {
        "timestamp": "2018-01-01T20:00:00Z",
        "total": 12763.33
      },
      {
        "timestamp": "2018-01-01T22:00:00Z",
        "total": 12545.38
      }
    ]
    
    

    HTTP Request

    GET https://api.wattics.com/api/v1/appliances/<ID>/raw_data?from=<FROM>&to=<TO>&data_type=<DATA_TYPE>&show_phases=<SHOW_PHASES>

    URL Parameters

    Parameter Description Mandatory? Default
    ID The ID of the appliance that contains the raw data. YES -
    FROM Initial Date or DateTime for collect data. YES -
    TO Final Date or DateTime for collect data. The maximum allowed time interval is 90 days. YES -
    DATA_TYPE Used in case of electricity entities. Possible values are: active_power, apparent_power, power_factor, reactive_power, rms_volts, volts and rms_current YES for electricity entities -
    SHOW_PHASES Used in case of electricity entities. Set to false if you don't want to separate phases. NO true

    Consumptions

    Fetch Consumptions from a Meter

    curl -X GET \
      https://api.wattics.com/api/v1/meters/1/consumptions?month=10&year=2018&detailed=true \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/1/consumptions?month=10&year=2018&detailed=true")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters/1/consumptions?month=10&year=2018&detailed=true")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/1/consumptions?month=10&year=2018&detailed=true"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters/1/consumptions?month=10&year=2018&detailed=true");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_consumption": "300500.0 Watt"
      },
      {
        "date": "2018-06-02",
        "weekday": "Saturday",
        "total_consumption": "301700.0 Watt"
      }
    ]
    
    // Or if DETAILED is true:
    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_consumption": "300500.0 Watt",
        "consumption_by_time": {
          "00h00m": "1024.03 Watt",
          "00h05m": "1011.52 Watt",
          "00h10m": "1088.15 Watt",
          "00h15m": "1037.87 Watt",
          "00h20m": "1007.05 Watt",
          ...
        }
      },
      ...
    ]
    
    

    HTTP Request

    GET https://api.wattics.com/api/v1/meters/<ID>/consumptions?month=<MONTH>&year=<YEAR>&detailed=<DETAILED>

    URL Parameters

    Parameter Description Mandatory? Default
    ID The ID of the meter that contains the consumption. YES -
    MONTH The month you want to check the consumptions. YES -
    YEAR The year you want to check the consumptions. YES -
    DETAILED Set this to true if you want to check consumption by time intervals. NO false

    Fetch Consumptions from an Appliance

    curl -X GET \
      https://api.wattics.com/api/v1/appliances/1/consumptions?month=10&year=2018&detailed=true \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances/1/consumptions?month=10&year=2018&detailed=true")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/appliances/1/consumptions?month=10&year=2018&detailed=true")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances/1/consumptions?month=10&year=2018&detailed=true"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/appliances/1/consumptions?month=10&year=2018&detailed=true");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_consumption": "300500.0 Watt"
      },
      {
        "date": "2018-06-02",
        "weekday": "Saturday",
        "total_consumption": "301700.0 Watt"
      }
    ]
    
    // Or if DETAILED is true:
    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_consumption": "300500.0 Watt",
        "consumption_by_time": {
          "00h00m": "1024.03 Watt",
          "00h05m": "1011.52 Watt",
          "00h10m": "1088.15 Watt",
          "00h15m": "1037.87 Watt",
          "00h20m": "1007.05 Watt",
          ...
        }
      },
      ...
    ]
    
    

    HTTP Request

    GET https://api.wattics.com/api/v1/appliances/<ID>/consumptions?month=<MONTH>&year=<YEAR>&detailed=<DETAILED>

    URL Parameters

    Parameter Description Mandatory? Default
    ID The ID of the appliance that contains the consumption. YES -
    MONTH The month you want to check the consumptions. YES -
    YEAR The year you want to check the consumptions. YES -
    DETAILED Set this to true if you want to check consumption by time intervals. NO false

    Costs

    Fetch Costs from a Meter

    curl -X GET \
      https://api.wattics.com/api/v1/meters/1/costs?month=10&year=2018&detailed=true \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/meters/1/costs?month=10&year=2018&detailed=true")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/meters/1/costs?month=10&year=2018&detailed=true")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/meters/1/costs?month=10&year=2018&detailed=true"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/meters/1/costs?month=10&year=2018&detailed=true");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_cost": 52.500
      },
      {
        "date": "2018-06-02",
        "weekday": "Saturday",
        "total_cost": 30.000
      }
    ]
    
    // Or if DETAILED is true:
    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_cost": 30.500,
        "cost_by_time": {
          "00h00m": 0.163845,
          "00h05m": 0.161843,
          "00h10m": 0.174103,
          "00h15m": 0.166059,
          ...
        }
      },
      ...
    ]
    
    

    HTTP Request

    GET https://api.wattics.com/api/v1/organizations/meters/<ID>/costs?month=<MONTH>&year=<YEAR>&detailed=<DETAILED>

    URL Parameters

    Parameter Description Mandatory? Default
    ID The ID of the meter that contains the consumption. YES -
    MONTH The month you want to check the costs. YES -
    YEAR The year you want to check the costs. YES -
    DETAILED Set this to true if you want to check consumption by time intervals. NO false

    Fetch Costs from an Appliance

    curl -X GET \
      https://api.wattics.com/api/v1/appliances/1/costs?month=10&year=2018&detailed=true \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/appliances/1/costs?month=10&year=2018&detailed=true")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/appliances/1/costs?month=10&year=2018&detailed=true")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/appliances/1/costs?month=10&year=2018&detailed=true"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/appliances/1/costs?month=10&year=2018&detailed=true");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_cost": 52.500
      },
      {
        "date": "2018-06-02",
        "weekday": "Saturday",
        "total_cost": 30.000
      }
    ]
    
    // Or if DETAILED is true:
    [
      {
        "date": "2018-06-01",
        "weekday": "Friday",
        "total_cost": 30.500,
        "cost_by_time": {
          "00h00m": 0.163845,
          "00h05m": 0.161843,
          "00h10m": 0.174103,
          "00h15m": 0.166059,
          ...
        }
      },
      ...
    ]
    
    

    HTTP Request

    GET https://api.wattics.com/api/v1/appliances/<ID>/costs?month=<MONTH>&year=<YEAR>&detailed=<DETAILED>

    URL Parameters

    Parameter Description Mandatory? Default
    ID The ID of the appliance that contains the costs. YES -
    MONTH The month you want to check the costs. YES -
    YEAR The year you want to check the costs. YES -
    DETAILED Set this to true if you want to check costs by time intervals. NO false

    Tariffs

    Get Tariffs of a Site

    curl -X GET \
      https://api.wattics.com/api/v1/sites/ID/tariffs \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/sites/ID/tariffs")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/sites/ID/tariffs")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/sites/ID/tariffs"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/sites/ID/tariffs");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "electricity": [
        {
          "id": 1,
          "name": "Tariff1",
          "from": "2012-08-01",
          "to": "2018-03-31"
        },
        {
          "id": 2,
          "name": "Tariff2",
          "from": "2018-04-01",
          "to": "2018-04-28"
        },
        {
          "id": 3,
          "name": "Tariff3",
          "from": "2018-04-28",
          "to": "now"
        }
      ],
      "water": [
        {
          "id": 4,
          "name": "Tariff4",
          "from": "2015-12-30",
          "to": "now"
        }
      ],
      "gas": [
        {
          "id": 5,
          "name": "Tariff5",
          "from": "2015-12-30",
          "to": "now"
        }
      ]
    }
    

    This endpoint retrieves all sites of an organization that the api token owner has access.

    HTTP Request

    GET https://api.wattics.com/api/v1/sites/<ID>/tariffs

    URL Parameters

    Parameter Description
    ID The ID of the site that contains the tariffs.

    Get Details of a Specific Tariff

    curl -X GET \
      https://api.wattics.com/api/v1/tariffs/ID \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/tariffs/ID")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/tariffs/ID")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/tariffs/ID"
    
    payload = ""
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, data=payload, headers=headers)
    
    print(response.text)
    
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/tariffs/ID");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above command returns JSON structured like this:

    {
      "name": "Airtricity",
      "tariff_periods": [
        {
          "from": "01/01",
          "to": "31/03",
          "monday": {
            "00h00m": -0.12,
            "00h30m": -0.12,
            "01h00m": -0.12,
            "01h30m": -0.12,
            "02h00m": -0.12,
            ...
            "tuesday": {
              "00h00m": -0.12,
              "00h30m": -0.12,
              "01h00m": -0.12,
              "01h30m": -0.12,
              "02h00m": -0.12,
              ...
              ...
    
    

    This endpoint retrieves a specific tariff.

    HTTP Request

    GET http://api.wattics.com/api/v1/tariffs/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the tariff to retrieve

    Report Definitions

    Get All Report Definitions

    curl -X GET \
      https://api.wattics.com/api/v1/report_definitions \
      -H 'Authorization: YOUR_API_TOKEN_HERE' \
      -H 'Content-Type: application/json' \
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.wattics.com/api/v1/report_definitions")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Authorization"] = 'YOUR_API_TOKEN_HERE'
    
    response = http.request(request)
    puts response.read_body
    
    HttpResponse<String> response = Unirest.get("https://api.wattics.com/api/v1/report_definitions")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_TOKEN_HERE")
      .asString();
    
    import requests
    
    url = "https://api.wattics.com/api/v1/report_definitions"
    
    headers = {
        'Content-Type': "application/json",
        'Authorization': "YOUR_API_TOKEN_HERE",
        }
    
    response = requests.request("GET", url, headers=headers)
    
    print(response.text)
    
    var data = null;
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === 4) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://api.wattics.com/api/v1/report_definitions");
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE");
    
    xhr.send(data);
    

    The above commands returns JSON structured like this:

    [
        {
            "id": 1,
            "name": "Report 1",
            "users": [
                {
                    "id": 1,
                    "email": "john@email.com",
                },
                {
                    "id": 2,
                    "email": "mary@email.com",
                }
            ],
            "sites_used": "SPECIFIC_LIST",
            "sites": [
                {
                    "id": 1,
                    "name": "Site 1"
                },
                {
                    "id": 2,
                    "name": "Site 2"
                }
            ]
        },
        {
            "id": 2,
            "name": "Report 2",
            "users": [
                {
                    "id": 1,
                    "email": "john@email.com"
                }
            ],
            "sites_used": "ALL_ASSOCIATED_TO_USERS"
        }
    ]
    

    This endpoint retrieves all report definitions created in the partner dashboard that the api-token's owner has access. If the report is associated to specific sites, the response will contain the sites list.

    HTTP Request

    GET https://api.wattics.com/api/v1/report_definitions

    Errors

    The Wattics API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The resource requested is not allowed to the user who owns the token.
    404 Not Found -- The specified resource could not be found.
    422 Unprocessable Entity -- Resource transformation invalid
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.