Skip to content

API Quickstart

Get from zero to your first successful API call in under 5 minutes.

Prerequisites

  • API running at http://127.0.0.1:18020/prometheus (see Environments)
  • A portal access code (provided by your administrator)
  • curl or any HTTP client

Step 1: Verify the API is reachable

bash
curl http://127.0.0.1:18020/prometheus/actuator/health
# Expected: {"status":"UP"}

Step 2: Make your first API call

Fetch the list of supported countries (a public endpoint):

bash
curl http://127.0.0.1:18020/prometheus/web/v1/system/constants/countries \
  -H "Content-Type: application/json" \
  -H "X-PORTAL-ACCESS-CODE: {your-access-code}" \
  -H "X-Client-Hash: quickstart-test" \
  -H "X-Request-Id: $(uuidgen)" \
  -H "CF-Connecting-IP: 127.0.0.1" \
  -H "Cf-Ray: quickstart-$(date +%s)-DEV" \
  -H "cf-ipcountry: US" \
  -H "X-Forwarded-Proto: https" \
  -H "X-LOCALE: en" \
  -H "User-Agent: quickstart/1.0"

Expected response:

json
{
  "version": "2.0.0",
  "success": true,
  "code": "2000",
  "data": [
    { "code": "US", "value": 95010301, "label": "United States", "alpha2Code": "US", "alpha3Code": "USA", "numericCode": 840, "phoneCode": "1" },
    { "code": "CN", "value": 95010302, "label": "China", "alpha2Code": "CN", "alpha3Code": "CHN", "numericCode": 156, "phoneCode": "86" }
  ]
}

Step 3: Understand the response format

All responses follow a standard envelope:

FieldTypeDescription
versionstringAPI version (currently "2.0.0")
successbooleantrue for successful requests
codestringResult code ("2000" for success)
dataobject/array/nullResponse payload

For the full specification, see Response Format.

Step 4: Authenticate (Login Flow)

The full login flow requires Secure Channel encryption. For a quick test without encryption, see Testing & Debugging.

For the full flow, see the Login Flow Guide.

Next Steps

SlaunchX Internal Documentation