Solinftec Integration

How to connect a Solinftec source to Colmeia and fetch operations, weather, and refueling data over the HTTP API. For the endpoint-by-endpoint field reference, see Solinftec API reference.


Overview

Your application (HTTP)
      │  GET /api/sl/data/{tenant_id}/...   Bearer <tenant-secret>
      ▼
  Colmeia middleware  (HTTP proxy)
      │  Solinftec SCDI API  (token managed for you)
      ▼
  Solinftec SCDI platform

The Colmeia middleware is an HTTP proxy in front of Solinftec's SCDI platform. It owns Solinftec token rotation, per-day fan-out, and response merging — you never manage Solinftec tokens. You call one Colmeia endpoint with a date range and get a single merged result back.


1. Connection setup

A tenant must be connected before data can be fetched.

curl -X POST https://app.colmeia.agr.br/api/integrations/{tenant_id}/connect \
  -H "Content-Type: application/json" \
  -b "session=<manager-session-cookie>" \
  -d '{
    "provider": "solinftec",
    "username": "alvaro_ribeiro",
    "password": "YOUR_PASSWORD",
    "auto_renew": true
  }'

Response:

{ "success": true, "data": { "provider": "solinftec", "connected": true, "expires_at": 2092433279, "auto_renew": true } }

Credentials are exchanged for a Solinftec token and are not stored in plaintext. The middleware re-authenticates automatically when the token chain breaks.

Check status:

curl "https://app.colmeia.agr.br/api/data/{tenant_id}/connections" \
  -H "Authorization: Bearer YOUR_TENANT_SECRET"

Revoke:

curl -X POST https://app.colmeia.agr.br/api/integrations/{tenant_id}/tokens/revoke \
  -H "Content-Type: application/json" \
  -b "session=<manager-session-cookie>" \
  -d '{"provider":"solinftec"}'

2. HTTP API

Base URL: https://app.colmeia.agr.br/api/sl
Auth header: Authorization: Bearer <tenant-secret>

All three endpoints accept a dateini/datefim date range. The middleware fans out one Solinftec pull per day internally, with bounded concurrency, and returns the merged result:

{ "data": [...], "days": 7, "total_rows": 294 }

Endpoints

EndpointData
GET /data/{tenant_id}/operationsField operation details (hourly, with text descriptions)
GET /data/{tenant_id}/weatherMeteorological data (hourly: rainfall, wind, temperature)
GET /data/{tenant_id}/refuelingTrain refueling records (fuel volume, hourmeter)

Common parameters

ParameterFormatNotes
dateiniDD/MM/YYYY or DD/MM/YYYY HH:MM:SSStart date, inclusive
datefimDD/MM/YYYY or DD/MM/YYYY HH:MM:SSEnd date, inclusive
sizeintegerRecords per day per internal page (default 1000)

/operations also accepts: equipamento, operacao, operador, unidade, talhao, ordemservico.

/weather and /refueling accept a legacy ?date=DD/MM/YYYY for single-day queries (backward compatibility).

Date cap

A single HTTP call is capped at 92 days (dateini..datefim). Ranges beyond that are rejected with invalid_date_range — split a longer window into sequential calls on your side.

Examples

# One week of operations
curl "https://app.colmeia.agr.br/api/sl/data/ribeiro/operations?dateini=10/09/2024&datefim=16/09/2024" \
  -H "Authorization: Bearer YOUR_TENANT_SECRET"

# 10 days of weather
curl "https://app.colmeia.agr.br/api/sl/data/ribeiro/weather?dateini=01/11/2024&datefim=10/11/2024" \
  -H "Authorization: Bearer YOUR_TENANT_SECRET"

# 10 days of refueling
curl "https://app.colmeia.agr.br/api/sl/data/ribeiro/refueling?dateini=01/02/2024&datefim=10/02/2024" \
  -H "Authorization: Bearer YOUR_TENANT_SECRET"

Error reference

HTTPerrorMeaning
400missing_date_rangedateini or datefim missing
400invalid_date_rangeDate parse failure, dateini > datefim, or range > 92 days
400missing_datedate missing on legacy single-day path
401no_token_foundTenant not connected
401no_refresh_tokenToken row exists but credentials were not stored
502solinftec_auth_failedSolinftec API unreachable during connect
401invalid_solinftec_credentialsWrong username or password
502solinftec_fetch_failedUpstream error during ranged fan-out
500Solinftec error bodyUpstream SCDI error (legacy single-date path)

See also: Solinftec API reference.