Getting Started

This page will help you get started with Raptor App API.

For detailed guides and tips check out our new Knowledge Hub:
Visit Knowledge Hub

🚧

API Change Notice:

Endpoints in "Raptor App API" at https://app.raptormaps.com are being migrated to "Raptor App API (NEW)" at https://api.raptormaps.com between June to July 2021. Not all endpoints will be migrated immediately.

Inspection results delivered prior to June 11, 2021 will still be available at https://app.raptormaps.com until August 31, 2021.

Inspections delivered after June 11, 2021 will only be available at https://api.raptormaps.com. Deprecated currently endpoints are marked as "deprecated" at the top of the description.

For example:
If inspection results were delivered to your organization on June 11, 2021. The findings table can be accessed at https://app.raptormaps.com/api/v2/solar_inspections/<inspection_uuid>/findings AND https://api.raptormaps.com/solar_inspections/<inspection_id>/findings.

If inspection results were delivered to your organization on June 14, 2021 the findings table can only be accessed at https://api.raptormaps.com/solar_inspections/<inspection_id>/findings.

Historical API request results contained both UUIDs and IDs and accessed via UUID. Going forward requests will use ID.

The quickest way to get started using the Raptor App API is by copying your API token from the web portal that can be found here: https://app.raptormaps.com/account

Please note that if you change your account's password your API token will change.

1462

Navigate to My Profile

1466

Copy your API token to your clipboard.

Once you have your API token, you may want to save it to your system's environment variables. We've chosen to save it as the environment variable, RAPTOR_MAPS_API_TOKEN.

Here is a short example using Python's requests library that shows how to retrieve a list of inspections for a particular solar farm.

import requests
import os

BASE_URL = "https://app.raptormaps.com"

# Authenticate with an API token
token = os.environ['RAPTOR_MAPS_API_TOKEN']

# GET all inspections for a particular solar farm
# Specify the solar farm uuid
solar_farm_uuid = '0006afb4-c616-4cb2-9ace-1658155d02d0'

# Specify API endpoint
endpoint = "%s/api/v2/solar_farms/%s/solar_inspections" % (BASE_URL, solar_farm_uuid)

# Specify request headers
headers = {
    'content-type': 'application/json',
    'Authentication-Token': token}

# Make HTTP GET request
r = requests.get(endpoint, headers=headers)

# Parse response
data = r.json()
inspections = data.get('solar_inspections')

print(inspections)
print('Request Complete!')

You can also retrieve your API token by logging in through the API as shown in the next example.

import getpass
import json
import requests

BASE_URL = "https://app.raptormaps.com"

def login(server_path, email, password):
    """Logs user in and Returns cookie and auth token
    Arguments:
        server_path (str): e.g. https://app.raptormaps.com
        email (str): e.g. [email protected]
        password (str): e.g. some_password
    Returns:
        {session: <hashed_session_string>}, <auth_token>
    """

    data = {"email":str(email),"password":str(password)}

    login_path = server_path + '/login'
    headers = {"Content-Type": "application/json"}

    r = requests.post(login_path, headers=headers, data=json.dumps(data))

    response = r.json()
    auth_token = response["response"]["user"]["authentication_token"]

    return auth_token

def main():

    """Authentication
    """

    # My email address for the Raptor App
    email = '[email protected]'

    # Get my password from command line input
    password = getpass.getpass()

    # Log me into the Raptor App
    token = login(BASE_URL, email, password)
    
    # Proceed to use the token in requests headers
    # Code goes here...

At this point you should be authenticated into the Raptor App. Enjoy.