Documentación
Edificios
Catálogo de edificios y configuración de cobro.
type: edificio EntitySet: Edificios App: /edificios
Scopes
comunidesk:readcomunidesk:write
Endpoints
GET /v1/rest/Edificios
Listar
Scopes: comunidesk:read
GET /v1/rest/Edificios/{id}
Obtener por id
Scopes: comunidesk:read
POST /v1/rest/Edificios
Crear
Scopes: comunidesk:write
PATCH /v1/rest/Edificios/{id}
Actualizar
Scopes: comunidesk:write
Specs OpenAPI y SOAP
Descarga el contrato del módulo (JSON, YAML o WSDL) para importar en Postman, Insomnia o clientes SOAP.
Ejemplo de request
import Foundation
let oauthToken = "OAUTH_TOKEN"
let userJwt = "USER_JWT"
var req = URLRequest(url: URL(string: "https://gateway.comunidesk.com/v1/rest/Edificios")!)
req.httpMethod = "GET"
req.setValue("Bearer \(oauthToken)", forHTTPHeaderField: "Authorization")
req.setValue("Bearer \(userJwt)", forHTTPHeaderField: "x-comunidesk-user-authorization")
req.setValue("application/json", forHTTPHeaderField: "Accept")
let (data, response) = try await URLSession.shared.data(for: req)
let http = response as! HTTPURLResponse
print(http.statusCode, String(data: data, encoding: .utf8) ?? "")
// scope tipico: comunidesk:readApps nativas (iOS / Android)
Después del login, consulta /v1/me/capabilities y muestra solo los módulos disponibles para ese usuario.
import Foundation
let oauthToken = "OAUTH_TOKEN"
let userJwt = "USER_JWT"
var req = URLRequest(url: URL(string: "https://gateway.comunidesk.com/v1/me/capabilities")!)
req.httpMethod = "GET"
req.setValue("Bearer \(oauthToken)", forHTTPHeaderField: "Authorization")
req.setValue("Bearer \(userJwt)", forHTTPHeaderField: "x-comunidesk-user-authorization")
struct CapName: Decodable { let es: String; let en: String }
struct CapModule: Decodable {
let id: String
let entitySet: String
let canRead: Bool
let canWrite: Bool
let name: CapName
}
struct Capabilities: Decodable { let modules: [CapModule] }
let (data, _) = try await URLSession.shared.data(for: req)
let caps = try JSONDecoder().decode(Capabilities.self, from: data)
let menu = caps.modules.filter { $0.canRead }
// menu.forEach { print($0.name.es, $0.entitySet) }Campos de escritura
Campos aceptados en POST/PATCH.
| Campo | Tipo | Obligatorio | Enum |
|---|---|---|---|
| nombre | string | Sí | |
| direccion | string | Sí | |
| comuna | string | Sí | |
| ciudad | string | Sí | |
| pisos | number | Sí | |
| departamentosPorPiso | number | Sí | |
| pais | string | No | |
| jurisdiccion | string | No | |
| geo | object | No | |
| diaCobroGastosComunes | number | Sí | |
| montoGastosComunesBase | number | Sí | |
| porcentajeMora | number | Sí | |
| diasGraciaMora | number | Sí | |
| superAdminEmail | string | No | |
| plan | string | No |
Solo lectura: _id, _rev, dbPrefix, createdAt, updatedAt, totalDepartamentos
