Application APIs
Applications API
- Introduction
- Authentication
- Response Codes and Format
- Application Catalog API
- Application Categories API
- Application Changelog API
- Application Hierarchy API
- Script Examples
Introduction
When integrating Netify into a user interface (UI), it is often necessary to present the end user with application information. Integrator API endpoints are available to fetch Netify's application list, categories, changelog, and hierarchy as JSON objects.
The following endpoints provide information on the applications supported by the Netify Agent:
Data | Description |
---|---|
Application Catalog | The list of supported applications. |
Application Categories | The list of categories used by applications. |
Application Changelog | The log of application additions, deletions, and signature changes. |
Application Hierarchy | The application hierarchy. |
Authentication
To access these endpoints, an API key must be passed in the x-api-key parameter in the request headers. Please contact us for details about acquiring an API key.
Response Codes and Format
These integrator API endpoints provide payloads with the following top-level JSON properties:
- status_code: a status code number
- status_message: a human-readable status message
- status_fields: an array of validation errors (if any)
Additionally, the API sends standard HTTP response codes.
Code | Response |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
405 | Method Not Allowed |
409 | Conflict |
422 | Validation Error |
429 | Too Many Requests |
500 | Server Error |
Application Catalog API
Endpoint | https://agents.netify.ai/api/v2/integrator/applications/catalog |
The Application Catalog provides a list of all the applications - past and present - supported by the Netify Agent.
ID and Tag
You can identify an application by an ID number (e.g., 120) or tag (e.g., netify.whatsapp).
Label / Full Label
The label is the name an end user would typically use to identify an application, while the full_label (if shown) provides a more formal name. For example, "BBC" is the label, but "British Broadcasting Corporation" is the full_label.
Description
The description is a brief summary of the application.
Home Page
The home_page provides the link to the application home page.
Category
Every application is listed under a primary category. You can find a list of application categories and associated IDs/tags here.
Active
Applications come and go - mergers & acquisitions, liquidations, and product shifts. Remember Google Plus? The active flag is set to false when an application is no longer supported.
Application Object - JSON Example
{
"id": 142,
"tag": "netify.whatsapp",
"label": "WhatsApp",
"full_label": "WhatsApp Messenger",
"description": "WhatsApp allows users...",
"home_page": {
"url": "https://www.whatsapp.com",
"text": "WhatsApp"
},
"category": {
"id": 17,
"tag": "messaging",
"label": "Messaging"
},
"active": true,
"favicon": "https://static.netify.ai...",
"icon": "https://static.netify.ai...",
"logo": "https://static.netify.ai...",
"favicon_source": "app",
"icon_source": "app",
"logo_source": "app"
}
Logos
Three types of logos are available in the data payload. The favicon and icon can be any size, but these images will render well at the sizes described in the adjacent table. The logo, if available, is strictly 128x128.
Key | Description |
---|---|
favicon | A logo that renders well at 16x16 |
icon | A logo that renders well at 128x128 |
logo | A logo that is exactly 128x128 (if available) |
Not all applications have all of the logos available.
By default, the API response will provide a placeholder logo showing the first letter of the app, e.g.,
.
In the data payload, you can check the values for favicon_source, icon_source, and logo_source to verify the source of the images. If the source is set to app, the actual application logo is available. If the source is set to default, the placeholder image is provided.
Application Categories API
Application Categories | https://agents.netify.ai/api/v2/integrator/applications/categories |
Every application is listed under a primary category. You can find a list of application categories and associated IDs/tags here.
The category API provides a standard id, tag and label for each category.
Application Category - JSON Example
{
"id": 3,
"tag": "advertiser",
"label": "Advertiser"
},
{
"id": 4,
"tag": "entertainment",
"label": "Arts and Entertainment"
},
...
Application Changelog API
Endpoint | https://agents.netify.ai/api/v2/integrator/applications/changelog |
The Application Changelog provides application additions, deletions, and changes in chronological order.
Application Hierarchy API
Endpoint | https://agents.netify.ai/api/v2/integrator/applications/hierarchy |
The Application Hierarchy provides application parent/child relationships. The returned data from this API endpoint lists all parent application objects with a children property -- a list of child applications. For example, the Google application includes child applications Gmail, Google Maps, YouTube, and other Google products. A visualization is provided here.
The hierarchy is restricted to a maximum of three levels:
- First Level - Tencent Games: a very large gaming division
- Second Level - Supercell: a subsidiary of Tencent Games and publisher of many games
- Third Level - Clash Royale: one of the games published by Supercell
The hierarchy is provided to help guide decisions on user interfaces (UI) and user experience (UX). This data is not directly used by the Netify Agent.
Script Examples
Curl
curl -H 'x-api-key: {api_key}' https://agents.netify.ai/api/v2/integrator/applications/catalog
curl -H 'x-api-key: {api_key}' https://agents.netify.ai/api/v2/integrator/applications/categories
curl -H 'x-api-key: {api_key}' https://agents.netify.ai/api/v2/integrator/applications/changelog
curl -H 'x-api-key: {api_key}' https://agents.netify.ai/api/v2/integrator/applications/hierarchy
Python
Copy and save the Python script below to a file named, for example, netify.py
, and execute. The script provided is just a demonstration of sample metadata available and how
to format (ex. CSV). Feel free to modify the scripts to access any JSON attributes available in the raw data.
python3 netify.py --csv apps
"ID","Label","Category","Homepage"
"11844","1&1 Versatel","ISP/Telco","https://www.1und1.net"
"10456","101domains","Business","https://www.101domain.com"
..
.
"10398","zombo.com","Arts and Entertainment","https://zombo.com"
To get the full JSON output, omit the --csv
option.
import os
import json
import requests
import sys
import getopt
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "c", ["csv"])
except getopt.GetoptError as err:
print(f"Error: {err}")
sys.exit(2)
api_key = os.getenv('NETIFY_API_KEY')
if not api_key:
print("Netify API key not set in environment variable NETIFY_API_KEY")
sys.exit(2)
csv = False
for opt, _ in opts:
if opt in ("-c", "--csv"):
csv = True
if len(args) != 1 or args[0] not in ("apps", "protos"):
print("Usage: netify.py [-c] ")
sys.exit(2)
resource = args[0]
if resource == "apps":
url = 'https://agents.netify.ai/api/v2/integrator/applications/catalog'
else:
url = 'https://agents.netify.ai/api/v2/integrator/protocols/catalog'
headers = {
'content-type': 'application/json',
'x-api-key': api_key
}
response = requests.get(url, headers=headers)
if response.status_code != 200:
print(response.json())
sys.exit(2)
data = response.json()['data']
if csv == True:
print('"ID","Label","Category","Homepage"')
for d in data:
if csv == True:
print('"%d","%s","%s","%s"' % (d['id'], d['label'], d['category']['label'], d['home_page']['url']))
if csv == False:
jprint(data)
def jprint(obj):
text = json.dumps(obj, sort_keys=False, indent=4)
print(text)
if __name__ == "__main__":
main()