- Previous: Overview
- Up: TampaElectricCompany2 Documentation
- Next: Overview
Quickstart
Quickstart guide
Register an application, obtain your Client ID and Client Secret, exchange them for a Bearer token, and make your first successful API call — in under 5 minutes.
Every API call in TECO CAM is associated with an application — a named entity that holds your OAuth credentials, subscription, and usage quota. Create one before obtaining your Client ID and Client Secret.
- aSign in to the portal and click My Account in the top navigation bar.
- bGo to Applications → click New application.
- cEnter a descriptive name, e.g. teco-integration-prod or my-test-app.
- dSelect Web APIs this application will use.
- eClick Register Application. Your application is registered immediately.
TECO CAM uses OAuth 2.0 client credentials flow. After creating your application, a Client ID and Client Secret are automatically generated. You will use both to request a Bearer token in the next step.
- aFrom My Account → Keys, go to your application name.
- bFrom your application, Copy both the Key(ClientID) and Secret(ClientSecret).
Use your Client ID and Client Secret to request an OAuth 2.0 Bearer token from the token endpoint. This token authenticates all subsequent API calls and expires after 600 seconds (10 minutes).
# Exchange Client ID + Secret for a Bearer token curl -X POST https://api.teco-cam.com/oauth/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET"
import requests TOKEN_URL = "https://api.teco-cam.com/oauth/token" CLIENT_ID = "YOUR_CLIENT_ID" CLIENT_SECRET = "YOUR_CLIENT_SECRET" response = requests.post(TOKEN_URL, data={ "grant_type": "client_credentials", "client_id": CLIENT_ID, "client_secret": CLIENT_SECRET }) token = response.json()["access_token"] print(token)
const response = await fetch("https://api.teco-cam.com/oauth/token", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ grant_type: "client_credentials", client_id: "YOUR_CLIENT_ID", client_secret: "YOUR_CLIENT_SECRET" }) }); const { access_token } = await response.json(); console.log(access_token);
import java.net.URI; import java.net.http.*; import java.net.URLEncoder; String body = "grant_type=client_credentials" + "&client_id=YOUR_CLIENT_ID" + "&client_secret=YOUR_CLIENT_SECRET"; var request = HttpRequest.newBuilder() .uri(URI.create("https://api.teco-cam.com/oauth/token")) .header("Content-Type", "application/x-www-form-urlencoded") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); var res = HttpClient.newHttpClient().send( request, HttpResponse.BodyHandlers.ofString()); println(res.body()); // {"access_token":"eyJ...", "expires_in":600}
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 600
}
Use the Bearer token from Step 3 in the Authorization header to call the health check endpoint. This confirms your token is valid and the gateway is reachable.
# Use the access_token from Step 3 curl -X GET https://api.teco-cam.com/v3/health \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/json"
import requests ACCESS_TOKEN = "YOUR_ACCESS_TOKEN" # token from Step 3 BASE_URL = "https://api.teco-cam.com/v3" headers = { "Authorization": f"Bearer {ACCESS_TOKEN}", "Accept": "application/json" } response = requests.get(f"{BASE_URL}/health", headers=headers) print(response.status_code) # 200 print(response.json()) # {"status": "ok", ...}
const ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"; // token from Step 3 const BASE_URL = "https://api.teco-cam.com/v3"; const response = await fetch(`${BASE_URL}/health`, { method: "GET", headers: { "Authorization": `Bearer ${ACCESS_TOKEN}`, "Accept": "application/json" } }); const data = await response.json(); console.log(data); // { status: "ok", version: "3.2.0", ... }
import java.net.URI; import java.net.http.*; var request = HttpRequest.newBuilder() .uri(URI.create("https://api.teco-cam.com/v3/health")) .header("Authorization", "Bearer YOUR_ACCESS_TOKEN") .header("Accept", "application/json") .GET().build(); var res = HttpClient.newHttpClient().send( request, HttpResponse.BodyHandlers.ofString()); System.out.println(res.statusCode()); // 200 System.out.println(res.body()); // {"status":"ok",...}
A successful call returns HTTP 200 with a JSON body confirming the gateway is healthy and your token is valid.
{
"status": "ok",
"version": "3.2.0",
"region": "us-east-1",
"timestamp": "2026-05-13T10:00:00Z"
}
| Error | Likely cause | How to fix |
|---|---|---|
| 401 Unauthorized | Bearer token missing, malformed, or expired | Check the Authorization: Bearer header is present and the token has not expired. Request a new token from /oauth/token if needed |
| 401 Invalid client | Client ID or Client Secret is incorrect | Confirm both values exactly match what is shown in My Account → Applications → OAuth Credentials |
| 403 Forbidden | Token valid but subscription not active or plan not assigned | Go to My Account → Applications → your app → confirm a plan is active |
| 404 Not Found | Wrong base URL or endpoint path | Confirm base URL and check for typos |
| 429 Too Many Requests | Free plan rate limit reached (100 calls/day, 10 req/min) | Wait for the window to reset or upgrade your plan. Check Retry-After response header |
| Connection refused | Firewall blocking outbound HTTPS to the gateway | Confirm outbound access to the endpoint is allowed on your network |
- Previous: Overview
- Up: TampaElectricCompany2 Documentation
- Next: Overview
0 Comments
Please sign in to post a comment.