API Endpoints

Flask Server Endpoints (api_server.py)

The following REST endpoints are exposed by the Flask server running in CT 400.

Health Check

GET /health

Returns the health status of the Evercycle API Server.

Example Request:

curl -X GET http://api.veraetime.net/health

Example Response:

{
  "status": "ok",
  "message": "Evercycle API Server is running"
}

Authentication

POST /api/auth

Authenticates with the Evercycle backend and stores tokens locally.

Request JSON Object:
  • username (string) – Evercycle username

  • password (string) – Evercycle password

Response JSON Object:
  • status (string) – “success” or “error”

  • message (string) – Human-readable result

Status Codes:

Example Request:

curl -X POST http://api.veraetime.net/api/auth \
  -H "Content-Type: application/json" \
  -d '{"username":"user@example.com","password":"secret"}'

Example Response (success):

{
  "status": "success",
  "message": "Authentication successful"
}

List Available APIs

GET /api/list

Returns a list of all Evercycle APIs that have JSON config files.

Example Response:

{
  "status": "success",
  "apis": [
    {
      "name": "get-all",
      "method": "GET",
      "path": "/v1/asset",
      "description": "Get all Assets"
    }
  ]
}

Dynamic API Proxy

ANY /api/<api_name>

Proxies a request to the Evercycle backend API identified by api_name. The HTTP method must match the method declared in the API’s JSON config.

Parameters:
  • api_name – Name of the API config file (without .json)

Status Codes:

Supported APIs

api_name

Method

Evercycle Path

Description

auth-signin

POST

/v1/auth/signin

Authenticate user

get-all

GET

/v1/asset

Get all Assets

get-asset-id

GET

/v1/asset/{id}

Get Asset by ID

create

POST

/v1/asset/create

Create a new Asset

create-request

POST

/v1/asset/request

Create an Asset request

edit-asset-id

PUT

/v1/asset/{id}

Edit an Asset

grade

PUT

/v1/pricebook/{id}/{grade}

Update pricebook grade

single-confirm

POST

/v1/asset/confirm

Confirm single asset

by-org

GET

/v1/asset/org/{org_id}

Get assets by organization

programs-list

GET

/v1/programs

List programs

traking-list

GET

/v1/tracking

List tracking items

Evercycle Backend Endpoints

The following endpoints are defined in the markdown specification files inside /opt/evercycle-api/evercycle-api/. They are consumed through the proxy.

/v1/auth/signin

  • Method: POST

  • URL: https://api.evercycle.io/v1/auth/signin

  • Description: Sign in to Evercycle

  • Headers: Content-Type: application/json

  • Body: * username (string) * password (string)

  • Response: AuthenticationResult object containing AccessToken, ExpiresIn, RefreshToken, IdToken

/v1/asset/create

  • Method: POST

  • URL: https://api.evercycle.io/v1/asset/create

  • Description: Create a new Asset for the organization

  • Headers: * Authorization (IdToken) * access-token (AccessToken)

  • Body Fields: asset_type_id, year, make, model, serial_number, asset_damage_type_id, damage_description, carrier, cpu, ram, screen, purchase_date, asset_reference, asset_user_first_name, asset_user_last_name, asset_user_address, asset_user_city, asset_user_state, asset_user_postal_code, asset_user_country, request_id, archived, device_master_list_id, service_provider_org_id, asset_user_email, asset_user_phone, end_of_life_date

  • Response: Created asset object with id, created_at, updated_at

/v1/asset/{id}

  • Method: GET

  • URL: https://api.evercycle.io/v1/asset/{id}

  • Description: Get the Asset information for a given ID

  • Headers: Authorization, access-token

  • Path Parameters: id (number)

  • Response: Asset object

/v1/pricebook/{id}/{grade}

  • Method: PUT

  • URL: https://api.evercycle.io/v1/pricebook/{id}/{grade}

  • Description: Edit an Asset for the given pricebook_catalog_id and grade_name

  • Headers: Authorization, access-token

  • Path Parameters: id (number), grade (string)

  • Body Fields: price (number)

  • Response: Pricebook object with grade_price array

/v1/asset

  • Method: GET

  • URL: https://api.evercycle.io/v1/asset

  • Description: Get all Assets

  • Headers: Authorization, access-token

  • Query Parameters: page_num, per_page

  • Response: Array of Asset objects