API access is available to users via their JWT bearer token, or can be made available to a backend system via an M2M token issued by InnerSpace.
Developer Access
Contact sales@innerspace.io for developer access. They will provide you with a ClientID and ClientSecret.
They will need to know the usage of the credentials - whether it is needed for a backend service, a native application, a single-page web app or regular web app.
Backend Services
Backend services should use the /oauth/token endpoint below, which behaves as documented in the .
import logging
import sys
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport
from gql.transport.aiohttp import log as requests_logger
requests_logger.setLevel(logging.WARNING)
def main(argv):
# Select your transport with a defined url endpoint, using the auth token from above
transport = AIOHTTPTransport(url="https://api.innerspace.io/", headers={"Authorization": "Bearer {access_token}"})
# Create a GraphQL client using the defined transport
client = Client(transport=transport, fetch_schema_from_transport=True)
# Execute the query on the transport
query = """
query sample_graphql {
BUILDING_INSIGHTS(where: {DATE_PARTITION: {_eq: 20250501}, BUILDING_ID: {_eq: 71}, GRANULARITY: {_eq: "PT1H"}, GROUP_ID: {_eq: "all-e707b3a8-0732-49ae-9156-13ff1138540e"}, SITE_ID: {_eq: 900000222}}, order_by: {DATE_TIME_START: desc}) {
BUILDING_ID
DATE_TIME_START
OCCUPANCY_MEAN
GRANULARITY
GROUP_ID
SITE_ID
}
}
"""
print(client.execute(gql(query)))
if __name__ == "__main__":
main(sys.argv)