API

Obtain device and incident detail programmatically

Obtaining an API Key

  • 7SIGNAL utilizes OAuth 2.0, the industry-standard protocol for authorization. Obtain an API key and secret through Mobile Eye by navigating to the Users icon along the left navigation bar, then clicking Manage Users.
API 1
  • Then click the API Key icon along the left, and the Add API Key button at the top.
API 2
  • Select either Administrator or User and click Save.  Users will not be able to make API calls to Configuration endpoints, once 7SIGNAL makes them available.
API 3
  • Copy and paste and save your API key and secret. You will use it in the token exchange request/response process to connect to the API.

API 4  

Public Link to Online Documentation

https://api-v1.7signal.com/swagger-ui/index.html#/

Endpoints Available with Sample Output


https://api-v1.7signal.com/eyes/ Returns the organization name, total device count, and license summary. Sample output below.
{
  "agents": {
    "organizationName": "7signal2",
    "deviceCount": 3,
    "licenseSummary": {
      "packageName": "ENTERPRISE",
      "totalLicenses": 2500,
      "usedLicenses": 2,
      "freeLicenses": 2498
    }
  }
}
https://api-v1.7signal.com/eyes/agents Returns detail for each device in the system. Results are paginated.
{
  "pagination": {
    "pages": 1,
    "page": 1,
    "total": 3,
    "perPage": 250
  },
  "results": [
    {
      "id": "090e52c0-1429-4aad-bf70-ce650a2dfab8",
      "name": "CAMULLI",
      "manufacturer": "LENOVO",
      "model": "20QVS0FN00",
      "platform": "windows",
      "version": "10.0.22621",
      "driverProvider": "Intel - Intel(R) Wi-Fi 6 AX200 160MHz",
      "driverVersion": "22.170.0.3",
      "mac": "74:D8:3E:91:91:19",
      "lastSeen": 1673886395413,
      "lastSsid": "#corpnetwork5",
      "lastTestSeen": 1673886387000,
      "lastAgentVersion": "v1.19.0+59",
      "remoteIpAddress": "65.31.8.238",
      "numberOfTxSpatialStreams": 2,
      "numberOfRxSpatialStreams": 2,
      "lastDefinedLocationId": "bfc88029-c162-48c5-b27c-81cfe0c63842",
      "lastBssid": "a8:bd:27:87:e6:10",
      "localIpAddress": "192.168.0.139",
      "marketModel": "20QVS0FN00"
  },
https://api-v1.7signal.com/incidents/agents Returns a list of incidents that have occurred. Date/time range may be specified. Default range is the last 24 hours.
{
  "range": {
    "to": 1673887213434,
    "from": 1673800813435,
    "total": 10,
    "duration": 86399999
  },
  "results": [
    {
      "id": "d7191d76-0be8-42e5-b500-96dffe59b75c",
      "startTimestamp": "2023-01-15T18:25:00.000Z",
      "asOfTimestamp": "2023-01-15T21:20:00.000Z",
      "endTimestamp": "2023-01-15T21:20:00.000Z",
      "timestampDeterminedToBeIncident": "2023-01-15T18:30:00.000Z",
      "organizationName": "7signal2",
      "type": "SEVEN_MCS",
      "location": "bfc88029-c162-48c5-b27c-81cfe0c63842",
      "network": "#corpnetwork5",
      "band": "5.00",
      "countImpacted": 1,
      "populationCount": 1,
      "thresholds": {
        "warningThreshold": 10,
        "criticalThreshold": 7,
        "successRateThreshold": 90,
        "minPopulationCount": 1,
        "minCountImpacted": 1,
        "minPercentImpacted": null,
        "minIncidentDurationMinutes": 5
      },

 

Sample Code (Python)

import requests
import json 

"""
First step in using 7SIGNAL API is to exchange your key and secret for a JWT token.
This is accomplished with an OAuth request
"""
auth_data = {
  "client_id": "62CAF473.your_key_here.XMXQS",
  "client_secret": "fKKPuynq.your_secret_here.FlFjZupS",
    "grant_type": "client_credentials", "scope": 
    "openid https://login.7signal.com/scopes/user.read https://login.7signal.com/scopes/user.admin"
}

auth_headers = {"Accept": "application/json"}
token_exch_response = requests.post('https://api-v1.7signal.com/oauth2/token', data = auth_data, headers = auth_headers)
token_exch_json_response = token_exch_response.json()

# This token can now be used for subsequent requests. Note the token will expire.
token = token_exch_json_response["access_token"]


"""
Once a token is aquired, it can be used to make calls to the API.
This is done using an Authorization header with a Bearer token.
"""
headers_incidents = {
    "Accept": "application/json", 
    "Authorization": f"Bearer {token}"
}
incidents_response = requests.get('https://api-v1.7signal.com/incidents/agents', headers = headers_incidents)
incidents_json = incidents_response.json()


# Pretty print the JSON response to the console
incidents_json_formatted = json.dumps(incidents_json, indent = 2)
print()
print(incidents_json_formatted)