Dynamic REST Documentation

Explore what you can do with this API, populated with fake data of companies, findnancial reports, and employees.

Users

Expand

POST /api/users/register

Post New User

Implementation Notes

Registers a new user and sends responds with a token

Response Messages

HTTP Status Code Reason Sample Response
201 Created

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
                
401 Unauthorized

Try it

Request URL

                

Response Body

                

Response Code

                

PUT /api/users/login

Login User

Implementation Notes

Login an existing user and responds with a token

Response Messages

HTTP Status Code Reason Sample Response
200 OK

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
                
401 Unauthorized

Try it

Request URL

                

Response Body

                

Response Code

                

Companies

Expand

GET /api/companies

Fetch Companies

Implementation Notes

Returns an array of all companies

Response Messages

HTTP Status Code Reason Sample Response
200 OK

[
  {
    "id": "48jJZAVGXs57k&P9nPRif",
    "company_name": "Abernathy-Baumbach",
    "industry": "Savings Institutions",
    "market_cap": "$231.87M",
    "logo_img": "http://dummyimage.com/247x100.png/dddddd/000000",
    "street_address": "45 Mariners Cove Park",
    "state": "TX",
    "phone": "512-192-3551"
  },
  {
    "id": "92AWJaTG8d09a&V8MOTew",
    "company_name": "Altenwerth, Upton and Erdman",
    "industry": "Major Banks",
    "market_cap": "$640.53M",
    "logo_img": "http://dummyimage.com/118x100.png/dddddd/000000",
    "street_address": "18 Johnson Point",
    "state": "WV",
    "phone": "304-134-5160"
    },
    {
    "id": "02yWGrT2Xg21s&IWgRycf",
    "company_name": "Bartoletti-Roob",
    "industry": "Industrial Machinery/Components",
    "market_cap": "$219.92M",
    "logo_img": "http://dummyimage.com/171x100.png/dddddd/000000",
    "street_address": "896 Gulseth Plaza",
    "state": "NH",
    "phone": "603-192-4675"
    },
    ...
]
                

GET /api/companies/random

Fetch Random Company

Implementation Notes

Returns a random company

Response Messages

HTTP Status Code Reason Sample Response
200 OK

{
  "id": "97SsVUFKHd64f&YMNjTvq",
  "company_name": "Rath-Connelly",
  "industry": "Building Products",
  "market_cap": "$558.63M",
  "logo_img": "http://dummyimage.com/246x100.png/cc0000/ffffff",
  "street_address": "4384 Bayside Parkway",
  "state": "TX",
  "phone": "281-325-3412"
  }
                

GET /api/companies/:id

Fetch Specific Company

Implementation Notes

Returns the specified companies

Response Messages

HTTP Status Code Reason Sample Response
200 OK

{
  "id": "97SsVUFKHd64f&YMNjTvq",
  "company_name": "Rath-Connelly",
  "industry": "Building Products",
  "market_cap": "$558.63M",
  "logo_img": "http://dummyimage.com/246x100.png/cc0000/ffffff",
  "street_address": "4384 Bayside Parkway",
  "state": "TX",
  "phone": "281-325-3412"
}
                
404 Not Found

Financial Data

Expand

GET /api/financials

Fetch Financial Data

Implementation Notes

Returns an array of all financial reports

Response Messages

HTTP Status Code Reason Sample Response
200 OK

[
  {
    "id": 1,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "quarter": "Q122",
    "cogs": "87",
    "profit_margin": "2.328",
    "revenue": "89.02536"
  },
  {
    "id": 2,
    "company_id": "739bStMZKr28j&IV4PGuj",
    "quarter": "Q122",
    "cogs": "85",
    "profit_margin": "4.716",
    "revenue": "89.0086"
  },
  {
    "id": 3,
    "company_id": "53FyQxFNZe88o&KGeWrae",
    "quarter": "Q122",
    "cogs": "127",
    "profit_margin": "10.479",
    "revenue": "140.30833"
  },
  {
    "id": 4,
    "company_id": "48jJZAVGXs57k&P9nPRif",
    "quarter": "Q122",
    "cogs": "132",
    "profit_margin": "10.035",
    "revenue": "145.2462"
  },
  ...
]
                

GET /api/financials/:id

Fetch Financials for a Company

Implementation Notes

Returns an array of all financial reports for a specified company

Response Messages

HTTP Status Code Reason Sample Response
200 OK

[
  {
    "id": 77,
    "company_id": "92AWJaTG8d09a&V8MOTew",
    "quarter": "Q122",
    "cogs": "143",
    "profit_margin": "0.571",
    "revenue": "143.81653"
  }
]
                

Industry Data

Expand

GET /api/industries

Fetch Industries

Implementation Notes

Returns an array of all industries

Response Messages

HTTP Status Code Reason Sample Response
200 OK

[
  {
    "industry": "Auto Parts:O.E.M."
  },
  {
    "industry": "Automotive Aftermarket"
  },
  {
    "industry": "Banks"
  },
  {
    "industry": "Beverages (Production/Distribution)"
  },
  {
    "industry": "Biotechnology: Electromedical & Electrotherapeutic Apparatus"
  },
  {
    "industry": "Broadcasting"
  },
  {
    "industry": "Building Products"
  },
  {
    "industry": "Business Services"
  },
  ...
]
                

Employees

Expand

GET /api/employees

Fetch Employees

Implementation Notes

Returns an array of all employees

Response Messages

HTTP Status Code Reason Sample Response
200 OK

[
  {
    "id": 1,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Mahala",
    "last_name": "Walford",
    "email": "mwalford0@spotify.com",
    "avatar": "https://robohash.org/sitconsequaturconsequatur.png?size=50x50&set=set1",
    "department": "Legal",
    "title": "Quality Engineer"
  },
  {
    "id": 2,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Desirae",
    "last_name": "Pitkin",
    "email": "dpitkin1@pcworld.com",
    "avatar": "https://robohash.org/fugiatquiexplicabo.png?size=50x50&set=set1",
    "department": "Marketing",
    "title": "Database Administrator III"
  },
  {
    "id": 3,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Gordy",
    "last_name": "Salzberger",
    "email": "gsalzberger2@imageshack.us",
    "avatar": "https://robohash.org/velitabenim.png?size=50x50&set=set1",
    "department": "Engineering",
    "title": "Web Designer IV"
  },
  {
    "id": 4,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Annadiane",
    "last_name": "Hirsthouse",
    "email": "ahirsthouse3@irs.gov",
    "avatar": "https://robohash.org/reprehenderitautofficiis.png?size=50x50&set=set1",
    "department": "Legal",
    "title": "Financial Advisor"
  },
  ...
]
                

GET /api/employees/:companyId

Fetch Employees for a Company

Implementation Notes

Returns an array of all employees of the specified company

Response Messages

HTTP Status Code Reason Sample Response
200 OK

[
  {
    "id": 1,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Mahala",
    "last_name": "Walford",
    "email": "mwalford0@spotify.com",
    "avatar": "https://robohash.org/sitconsequaturconsequatur.png?size=50x50&set=set1",
    "department": "Legal",
    "title": "Quality Engineer"
  },
  {
    "id": 2,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Desirae",
    "last_name": "Pitkin",
    "email": "dpitkin1@pcworld.com",
    "avatar": "https://robohash.org/fugiatquiexplicabo.png?size=50x50&set=set1",
    "department": "Marketing",
    "title": "Database Administrator III"
  },
  {
    "id": 3,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Gordy",
    "last_name": "Salzberger",
    "email": "gsalzberger2@imageshack.us",
    "avatar": "https://robohash.org/velitabenim.png?size=50x50&set=set1",
    "department": "Engineering",
    "title": "Web Designer IV"
  },
  {
    "id": 4,
    "company_id": "21ImC8IUCp19m&QEfdBbg",
    "first_name": "Annadiane",
    "last_name": "Hirsthouse",
    "email": "ahirsthouse3@irs.gov",
    "avatar": "https://robohash.org/reprehenderitautofficiis.png?size=50x50&set=set1",
    "department": "Legal",
    "title": "Financial Advisor"
  },
  ...
]