PT EN

Ligações

URL base: $CONSUMER_API

Listar ligações

Registos

GET /connections

Each connection carries meter_id and meter_serial, the installed meter's serial number.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Connections for the consumer

curl -X GET "$CONSUMER_API/connections" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Connections for the consumer

Pedir uma nova ligação

Registos

POST /connections

The authenticated consumer must hold connection.manage for an account in the selected tenant. The service resolves the customer from that membership and property; a submitted customer_id does not grant or select access.

Corpo application/json

property_idstring · obrigatório
customer_idstring · opcional

Ignored for consumer requests; customer is resolved from the caller's account membership.

categorystring · opcional

um de residential, commercial, industrial, institutional, government

diameter_mminteger · opcional
pipe_diameter_mminteger · opcional
pipe_materialstring · opcional
pressure_zone_idstring · opcional
gps_coordinatesstring · opcional
addressstring · opcional
notesstring · opcional

Devolve

201 Connection application submitted

Erros 400 · 403 · 404

curl -X POST "$CONSUMER_API/connections" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "property_id": "prp_2ZbuIh1k2RvWMVPQCJD2yPrsOJ3",
  "customer_id": "cus_2UuXtOGTHWKlvkoF5so5Joi3Hck",
  "category": "residential",
  "diameter_mm": 1,
  "pipe_diameter_mm": 1,
  "pipe_material": "pipe material",
  "pressure_zone_id": "pre_2Ww5XCYxHs6jv2K53SI3fu47RkI",
  "gps_coordinates": "gps coordinates",
  "address": "Av. Julius Nyerere 1420, Maputo",
  "notes": "Leitura confirmada no local."
}'
Resposta 201

Connection application submitted

Obter uma ligação

Registos

GET /connections/{id}

Get connection details within the consumer's linked account scope

Returns one service connection, such as a new water connection application, when it belongs to an account in the caller's linked account scope. The tenant is taken from X-Tenant-ID or the token when set, otherwise all of the caller's tenants are searched; anything outside the scope returns 404.

Parâmetros

idstring · caminho · obrigatório

Identifier of the connection to return.

Devolve

200 Connection visible to the authenticated consumer

Erros 404

curl -X GET "$CONSUMER_API/connections/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Connection visible to the authenticated consumer