Skip to content

Latest commit

 

History

History
57 lines (47 loc) · 1.52 KB

README.md

File metadata and controls

57 lines (47 loc) · 1.52 KB

Threatstack Rest Api Example Clients

This repository provides examples of the Threat Stack v2 API. The examples center on setting up Hawk authentication.

All sample projects require the same environment variables to be set:

  • TS_USER_ID - User id of the api key holder
  • TS_API_KEY - API key for the user specified by TS_USER_ID
  • TS_ORGANIZATION_ID - Organization id of the organization to access

Python

Install Python 3 to run the python example. To install dependencies, run pip:

pip install -r requirements.txt

Run the following python command using the environment variables:

TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x python3 example.py

Ruby

Before you can install the dependencies, you must install Ruby and bundler: To install dependencies, run bundle:

bundle install

Run the following ruby command using the environment variables:

TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x ruby example.rb

Java

Before you can install the dependencies, you must install Java and Maven 3. To install dependencies, run mvn:

mvn compile

Run the following mvn command using the environment variables:

TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x mvn exec:java

Node JS

Before you can install the dependencies, you must install Node and npm. To install dependencies, run npm:

npm install

Run the following node command using the environment variables:

TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x node example.js