API - Documentation

Authentication

API Base URL

    https://apidiscovery.teejlab.com/edsn/api/
            

The TeejLab APIDiscovery API uses api-key to authenticate all API requests.

Please log in and check your api_key

Endpoint Request


# Here is a curl example
curl -X POST \
  'https://apidiscovery.teejlab.com/edsn/api/
  benchmark/endpoint_request_live?endpoint_id=ZMVbc' \
  -H 'password: ******' \
  -H 'username: ******' \
  -d '{"i":"canada","timeout":"5"}'
            

Users can call an api on the platform by this endpoint.

To get the response, you need to make a POST call to the following url :
POSThttps://apidiscovery.teejlab.com/edsn/api/benchmark/endpoint_request_live



Result example :

"Canada is a country in the northern part of North America."

            

PARAMETERS

Field Placement Description Required
endpoint_id Query String the id of the endpoint you would like to consume True
Parameters for the target API Body It should be in JSON format True

Endpoint list


# Here is a curl example
curl -X GET \
  'https://apidiscovery.teejlab.com/edsn/api/benchmark/
  endpoint_list' \
            

You may wonder what endpoints could be accessable on the platform, and this endpoint is here to help you get all the endpoint information.

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/benchmark/endpoint_list



Result example :

[
    {
        "id": 21,
        "endpoint": "http://api.openweathermap.org/data/2.5/weather",
        "method": "get",
        "description": "Access current weather data for any location on Earth including over 200,000 cities."
    },
    {
        "id": 16,
        "endpoint": "http://api.wolframalpha.com/v1/result",
        "method": "get",
        "description": "The Short Answers API returns a single plain text result directly from Wolfram|Alpha. In general, this text is taken directly from the Result pod of Wolfram|Alpha output. This API type is designed to deliver brief answers in the most basic format possible."
    }
]

            

PARAMETERS

Field Placement Description Required
N/A N/A N/A True

Endpoint Parameter


# Here is a curl example
curl -X GET \
  'https://apidiscovery.teejlab.com/edsn/api/benchmark/
  endpoint_parameter?endpoint_id=ZMVbc' \
  -H 'password: ******' \
  -H 'username: ******' \
            

Before consuming the third-party API on our platform, you may need to know the parameters about that. And this endpoint is helping you understand what parameters are used for this API. All the related parameters should be put into the body of this TeejLab API.

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/benchmark/endpoint_parameter



Result example :

{
    "parameter": [
        {
            "parameter_example_value": "5",
            "is_required": false,
            "parameter_default_value": "5",
            "parameter_placement": "query",
            "parameter_name": "timeout",
            "parameter_description": "Specifies the maximum amount of time (in seconds) allowed to process the query, with a default value of \"5\". Although it is primarily used to optimize response times in applications, the timeout parameter may occasionally affect what value is returned by the Short Answers API."
        }
    ],
    "description": "The Short Answers API returns a single plain text result directly from Wolfram|Alpha. In general, this text is taken directly from the Result pod of Wolfram|Alpha output. This API type is designed to deliver brief answers in the most basic format possible.",
    "endpoint_name": "http://api.wolframalpha.com/v1/result",
    "method": "get"
}

            

PARAMETERS

Field Placement Description Required
endpoint_id Query String the id of the endpoint True

Endpoint Example


# Here is a curl example
curl -X GET \
  'https://apidiscovery.teejlab.com/edsn/api/benchmark/
  data_example?endpoint_id=ZMVbc' \
  -H 'password: ******' \
  -H 'username: ******' \
            

For some APIs on the platform, you may need to know what the response looks like before consuming that. And this endpoint is providing the information about the data example.

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/benchmark/data_example



Result example :

{
    "output_response": "Canada is a country in the northern part of North America." ,
    "endpoint_id": "ZMVbc",
    "input_parameters": {
        "i": "Canada",
        "timeout": "5"
    }
}

            

PARAMETERS

Field Placement Description Required
endpoint_id Query String the id of the endpoint True

Upload Swagger


    # Here is a curl example
    curl -X POST \
    'https://apidiscovery.teejlab.com/edsn/api/benchmark/
    upload_swagger' \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -H 'api-key: *************************' \
    -H 'vendor=Test_org_vendor' \
    -H 'category=Finance & Banking' \
    -F 'file=@/Users/Downloads/swagger.json' \

            

Our platform supports the Swagger format to upload an API, users can upload a Swagger file through this endpoint. Before uploading the Swagger file, an existing vendor name and a category name are required.

To get the response, you need to make a POST call to the following url :
POSThttps://apidiscovery.teejlab.com/edsn/api/benchmark/upload_swagger



    Result example :

    {"info": "", "result": "Success"}

                

PARAMETERS

Field Placement Description Required
Content-Type header This value should be application/x-www-form-urlencoded True
file form-data / body the swagger file True
vendor header the name of vendor True
category header the name of category True

Get all Vendors in NIST CVE


# Here is a curl example
curl --location --request GET 'https://apidiscovery.teejlab.com/edsn/api/cvesearch/vendors/' \
--header 'Authorization: Basic abcdefgh'
            

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/cvesearch/vendors/



Result example :

{
    "vendors": [
        "priorswood",
        "clever_components",
        "todoomasters",
        "overlay_weaver",
        "dominic_gamble",
        "foxmail",
        "niushop",
        "redirection",
        .....
    ]
}

            

PARAMETERS

Field Placement Description Required
N/A N/A N/A True

Get all products for a vendor


# Here is a curl example
curl --location --request GET 'https://apidiscovery.teejlab.com/edsn/api/cvesearch/vendor/products?vendor=Microsoft' \
--header 'Authorization: Basic abcdefgh'
            

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/cvesearch/vendor/products



Result example :
{
    "products": [
        "office",
        "wins",
        "active_directory_lightweight_directory_service",
        "adam",
        "organization_chart",
        "windows_2003_server",
        "sql_server_2016",
        "security_essentials",
        "microsoft.aspnetcore.mvc.webapicompatshim",
        "office_communicator",
        "sharepoint_enterprise_server",
        "forefront_endpoint_protection",
        "office_word_viewer",
        "digital_image",
        "web_applications",
        "windows_data_access_components",
        "host_integration_server_2000",
        .......
    ]
}
            

PARAMETERS

Field Placement Description Required
vendor URL query parameter Vendor name True

Get all products asscociated with a CVE ID


# Here is a curl example
curl --location --request GET 'https://apidiscovery.teejlab.com/edsn/api/cvesearch/cve/products?cve_id=CVE-2012-1180s' \
--header 'api-key: **************' \
            

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/cvesearch/cve/products



Result example :
{
    
}

            

PARAMETERS

Field Placement Description Required
cve_id URL query parameter Given CVE ID True


















Get all interrupted or in-progess Gateway Scans for an user


# Here is a curl example
curl --location --request GET 'https://apidiscovery.teejlab.com/edsn/api/networkscan/user_scans/' \
--header 'api-key: **************' \
or --header 'Authorization: Basic abcde123456' \
or --header 'Authorization: Token abcde123456' \
--header 'Content-Type: application/json'
            

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/networkscan/user_scans/



Result example :
"scan_details": [
        {
            "scan_status": "in_progress",
            "repo_id": "abcedsfsnujfn===",
            "mac_address": "00:1B:44:11:3A:B7",
            "start_time": "2020-04-08 20:50:05.095247+00:00",
            "nic_name": "wlp2s0",
            "instance_id": "efghfnsujifnsuinfin==",
            "project_name": "testProject1",
            "analyzed_datetime": "2020-05-01 06:59:29.817063+00:00",
            "nic_ip": "192.64.2.1",
            "scan_data_send_freq": "180",
            "end_time": "2020-04-09 20:50:21+00:00",
            "review_status": "Not Started",
            "network_name": "testNetwork1"
        },
        .....
    ]
}

            

This endpoint can use api-key to authenticate.
This endpoint can also use Basic Auth to authenticate.
This endpoint can also use Authorization Token to authenticate.

PARAMETERS

Field Placement Description Required
N/A N/A N/A N/A

Get all mappings for a Gateway Scan Instance


# Here is a curl example
curl --location --request GET 'https://apidiscovery.teejlab.com/edsn/api/networkscan/user_scan_mappings/' \
--header 'api-key: **************' \
or --header 'Authorization: Basic abcde123456' \
or --header 'Authorization: Token abcde123456' \
--header 'Content-Type: application/json'
--form 'instance_id=gAAAAABfGHE7iI3PgsrD3zuIZaaRxOVLVh-QaKARewQtoe2LxT0nzX1ODLyPx'
            

To get the response, you need to make a GET call to the following url :
GEThttps://apidiscovery.teejlab.com/edsn/api/networkscan/user_scan_mappings/



Result example :
{
    {
    "scan_mappings": {
        "analyzed_datetime": "2020-05-01 06:59:29.817063+00:00",
        "repo_id": "abcedsfsnujfn===",
        "scan_data_send_freq": "180",
        "end_time": "2020-04-09 20:50:21+00:00",
        "scan_status": "in_progress",
        "mac_address": "00:1B:44:11:3A:B7",
        "project_name": "testProject1",
        "nic_name": "wlp2s0",
        "is_approved": "",
        "start_time": "2020-04-08 20:50:05.095247+00:00",
        "network_name": "testNetwork1",
        "nic_ip": "192.64.2.1",
        "mappings": [
            {
                "captured_ip": "99.79.162.119",
                "direction": "Outgoing",
                "capture_datetime": "2020-04-08 20:52:49+00:00",
                "endpoint_geolocation": "Montreal Canada [Eastern Daylight Time]"
            },
            {
                "api_url": "http://www.open511.org/documentation/1.0/jurisdiction.html",
                "vendor_url": "http://www.open511.org/",
                "vendor_name": "Open 511",
                "direction": "Outgoing",
                "capture_datetime": "2020-04-08 20:52:51+00:00",
                "endpoint": "get http://api.open511.gov.bc.ca/jurisdiction",
                "captured_ip": "142.34.208.155",
                "api_name": "Open 511 Jurisdiction API",
                "endpoint_geolocation": "Victoria Canada [Pacific Daylight Time]",
                "endpoint_auth_type": "none"
            },
            .....
        ]
    }
}

            

This endpoint can use api-key to authenticate.
This endpoint can also use Basic Auth to authenticate.
This endpoint can also use Authorization Token to authenticate.

PARAMETERS

Field Placement Description Required
instance_id form-data / body Scan Instance ID for which correspoding mappings are required True

Lack Resources Rate Limit Test


# Here is a curl example
curl -X POST \
  https://apidiscovery.teejlab.com/edsn/api/benchmark/
  rate_limiting_test \
  -H 'api-key: ************************' \
  -H 'content-type: multipart/form-data;' \
  -F endpoint_id=ZMVbc
            

This test case is designed to check API protection against an excessive amount of calls or being chocked by excessive payload sizes. This test may take a while so you have to check the result later using the following API.

To make the test, you need to make a POST call to the following url :
POSThttps://apidiscovery.teejlab.com/edsn/api/benchmark/rate_limiting_test



Result example :

{
    "result": "Added successfully. Please check the result later.",
    "info": 22
}

            

PARAMETERS

Field Placement Description Required
endpoint_id Request Body the id of the endpoint True


















Lack Resources Rate Limit results


# Here is a curl example
curl -X POST \
  https://apidiscovery.teejlab.com/edsn/api/benchmark/rate_limiting_result \
  -H 'api-key: ************************' \
  -H 'content-type: multipart/form-data;' \
  -F endpoint_id=ZMVbc
            

After putting the rate limit test into the queue, you need to check the result with this endpoint after a while.

To make the test, you need to make a POST call to the following url :
POST https://apidiscovery.teejlab.com/edsn/api/benchmark/rate_limiting_result



Result example :

{
    "datetime": "06/02/2020",
    "result": "the API server does not have a limitation",
    "test_case": "5 requests in total  ,  58.32 requests per second"
}

            

PARAMETERS

Field Placement Description Required
endpoint_id Request Body the id of the endpoint True

projects


# Here is a curl example
curl -X GET \
  https://apidiscovery.teejlab.com/edsn/api/benchmark/projects?project_id=1 \
  -H 'api-key: ************************' \
  -H 'content-type: application/x-www-form-urlencoded;' \

            

After scanning a project through our scanner client, you can check the project details using this endpoint.

To get the project details, you need to make a GET call to the following url :
GET https://apidiscovery.teejlab.com/edsn/api/benchmark/projects



Result example :

{
    "project name": "test",
    "review status": "Not Started",
    "scan details": {
        "4": {
            "files": [
                "okhttp-master/okhttp-master/samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java"
            ],
            "match": {
                "endpoint": "https://www.googleapis.com/urlshortener/v1/url",
                "endpoint_pk": 4,
                "api_pk": 4,
                "url": "https://www.googleapis.com/urlshortener/v1/url?key=",
                "vendor_pk": 2,
                "vendor": "Google",
                "api": "Google URL Shortener API",
                "version": "1"
            },
            "urls": [
                "https://www.googleapis.com/urlshortener/v1/url?key="
            ]
        }
    },
    "datetime created": "2018-07-10 04:40"
}

            

PARAMETERS

Field Placement Description Required
project_id Query String the id of the project True

categories


# Here is a curl example
curl -X GET \
  https://apidiscovery.teejlab.com/edsn/api/benchmark/categories \
  -H 'api-key: ************************' \

            

This endpoint provides the information about the categories on our platform.

To get the categories, you need to make a GET call to the following url :
GET https://apidiscovery.teejlab.com/edsn/api/benchmark/categories



Result example :

[
    "Artificial Intelligence & Data Science",
    "Business & Technology",
    "eCommerce & Trade",
    "Environment & Weather",
    "Finance & Banking",
    "GeoInformatics & Navigation",
    "Government & Public Services",
    "Health Science & Medicine",
    "Information & Science",
    "Justice & Public Safety",
    "Logistics & Infrastrcture",
    "Natural Resources & Energy",
    "News & Media",
    "Religion & spirituality",
    "Research & Education",
    "Sales & Marketing",
    "Security & Technology",
    "Skills & Career Development",
    "Social Media & Technology",
    "Software & Services",
    "Sports & Entertainment",
    "Transportation & Automobile",
    "Work & Personal Assistance"
]

            

PARAMETERS

Field Placement Description Required

agreements


# Here is a curl example
curl -X GET \
  https://apidiscovery.teejlab.com/edsn/api/benchmark/agreements?api_id=****'  \
  -H 'api-key: ************************' \

            

You can use this endpoint to check what agreements are under the API you are interested in.

To get the agreements, you need to make a GET call to the following url :
GET https://apidiscovery.teejlab.com/edsn/api/benchmark/agreements



Result example :

[
    {
        "license_name": "User Data Policy",
        "license_url": "https://developers.google.com/terms/api-services-user-data-policy"
    },
    {
        "license_name": "Yahoo APIs Terms of Use",
        "license_url": "https://info.yahoo.com/legal/us/yahoo/api/api-2140.html"
    },
    {
        "license_name": "Terms of Service",
        "license_url": "https://developers.google.com/terms/site-terms"
    }
]

            

PARAMETERS

Field Placement Description Required
api_id Query String the id of api True