How can we help?
Print

Categories:

OpenAPI

MySites API

MySites Attributes

UPDATED

The MySites object attributes provide summary information for each Pelican site associated with your account. This includes details such as site domain names, gateway statuses, the number of active devices, and notifications. Additionally, the MySites API facilitates multi-site token requests, enabling authentication across multiple sites.

Predefined system-managed attributes for MySites objects, used for essential functions like temperature control, system status, and scheduling. They follow a fixed structure and cannot be renamed or redefined by users.

Reserved Attributes

Site - Object Attributes

Attribute names are not case-sensitive; attribute values are case-sensitive.

Name Value Description
name String The site name.
domain String The full web address of the site.
token String When a token is requested, it can be used to authenticate with the specific site. When querying the site the token must be placed in the “password” field and the “username” must be blank. Tokens are valid for 24 hours. Tokens are useful when the user has different passwords on multiple sites or if the user has been granted access to a site only through MySites “Shared Users”.
gateways Integer The number of gateways assigned to the site.
activeGateways Integer The number of gateways actively communicating with the Internet.
devices Integer The number of Pelican wireless devices installed at the site.
activeDevices Integer The number of Pelican wireless devices actively communicating with the Internet.
notifications Integer The number of active notifications for the site.

Code Examples

GET

How to request an API authentication token from MySites using the Sites object to GET Name, Domaine, and Token attributes.

				
					curl -Ls "https://mysites.officeclimatecontrol.net/api.cgi?username=Email@domain.com&password=MyPassword&request=get&object=Sites&selection=name:my-site-name&value=name;domain;token"
				
			
				
					#!/usr/bin/perl -w

use strict;
use ClimateControl;
# You can request a copy of the ClimateControl Perl
# Module from Pelican Tech Support.
# Send an email to support@pelicanwireless.com

# Create a new ClimateControl object
my $cc = ClimateControl->new(
    'Email@domain.com',                  # username
    'MyPassword',                        # password
    'mysites.officeclimatecontrol.net'   # website (note: no https://)
);

# Define the selection: find site where name = 'my-site-name'
my $selection = { 'name' => 'my-site-name' };

# Define the fields to retrieve
my $value = ['name', 'domain', 'token'];

# Call the generic 'get' method to retrieve Sites data
my $result = $cc->get('Sites', $selection, $value);

# Check and display the result
if ($result->{'success'}) {
    print "Success: $result->{'message'}\n";
    # Optional: pretty-print the data
    if (exists $result->{'data'}) {
        require Data::Dumper;
        print Data::Dumper->Dump([$result->{'data'}], ['data']);
    }
} else {
    print "Error: $result->{'message'}\n";
}
				
			
				
					#!/usr/bin/env python3
import requests

# Build the full URL with query parameters
url = "https://mysites.officeclimatecontrol.net/api.cgi"
params = {
    'username': 'Email@domain.com',
    'password': 'MyPassword',
    'request': 'get',
    'object': 'Sites',
    'selection': 'name:my-site-name',
    'value': 'name;domain;token'
}

# Make the GET request
# - allow_redirects=True → matches curl -L
# - verify=True → FULL SSL verification (default, safe)
response = requests.get(url, params=params, allow_redirects=True)

# Output
if response.status_code == 200:
    print(response.text)  # Raw body, just like curl
else:
    print(f"Error: {response.status_code}")
    if response.text:
        print(response.text)
				
			
				
					#!/usr/bin/env node
const https = require('https');
const { URLSearchParams } = require('url');

// Build query parameters
const params = new URLSearchParams({
  username: 'Email@domain.com',
  password: 'MyPassword',
  request: 'get',
  object: 'Sites',
  selection: 'name:my-site-name',
  value: 'name;domain;token'
});

// Construct full URL
const url = `https://mysites.officeclimatecontrol.net/api.cgi?${params.toString()}`;

// Make HTTPS GET request
https.get(url, { 
  // rejectUnauthorized: true by default → FULL SSL verification
  // No need to set anything → secure by default
}, (resp) => {
  let data = '';

  // Collect response chunks
  resp.on('data', (chunk) => {
    data += chunk;
  });

  // Response complete
  resp.on('end', () => {
    if (resp.statusCode === 200) {
      console.log(data);  // Raw body only, just like curl
    } else {
      console.log(`Error: HTTP ${resp.statusCode}`);
      if (data) console.log(data);
    }
  });

}).on('error', (err) => {
  console.error('Error:', err.message);
});
				
			

Response

				
					<result>
<Sites>
<token>MJTqzt+oOAan+jniquglKfTbyEcc+bbO3hAM+O6EGJaQtM89VgO6/CVDBAc9E0Kgo+9ECwOxkjVaUIyJriyELK6zqT+lgAuyQF5mONzmhAG0b7LAYzFvPelh1InQb8TwWprhFA==</token>
</Sites>
<success>1</success>
<message>Retrieved attributes for 1 sites.</message>
</result>
				
			
Table of Contents