2.0info: 2.6.2 Balança description: Serviço Leitura de Balança x-senior-domain: Controle de Pátio x-senior-domain-path: yms x-senior-service-path: balanca contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: platform.senior.com.br /t/senior.com.br/bridge/1.0/rest/ymssecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /balanca/queries/getStabilizedWeight: post: description: Obtem valor do peso da balança se estabilizado\n### Resources:\n- res://senior.com.br/yms/balanca/weight\n tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – code properties: code: type: string description: Código que identifica a balança responses: 200: description: Ok schema: type: object properties: weight: type: number format: double description: Peso em kilogramas se estiver estabiizado 401: description: Usuário ou senha inválido 403: description: Permissão negada default: description: Error response schema: #/definitions/genericError get: description: Obtem valor do peso da balança se estabilizado\n### Resources:\n- res://senior.com.br/yms/balanca/weight\n tags: – Queries x-senior-visibility: PUBLIC parameters: – name: code description: Código que identifica a balança in: query required: true type: string responses: 200: description: Ok schema: type: object properties: weight: type: number format: double description: Peso em kilogramas se estiver estabiizado 401: description: Usuário ou senha inválido 403: description: Permissão negada default: description: Error response schema: #/definitions/genericError /balanca/queries/getLatestWeight: post: description: Obtem valor peso que esteve estabilizado mais recente\n### Resources:\n- res://senior.com.br/yms/balanca/weight\n tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – code properties: code: type: string description: Código que identifica a balança timeoutNextRead: type: integer format: int64 description: Tempo máximo em segundos para aguardar uma nova leitura antes de retonar responses: 200: description: Ok schema: type: object required: – lastUpdate – stabilized properties: weight: type: number format: double description: Peso em kilogramas da pesagem estabilizada mais recenter lastUpdate: type: string format: date-time description: Data última atualização stabilized: type: boolean description: Indica se a balança esta estabilizada 401: description: Usuário ou senha inválido 403: description: Permissão negada default: description: Error response schema: #/definitions/genericError get: description: Obtem valor peso que esteve estabilizado mais recente\n### Resources:\n- res://senior.com.br/yms/balanca/weight\n tags: – Queries x-senior-visibility: PUBLIC parameters: – name: code description: Código que identifica a balança in: query required: true type: string – name: timeoutNextRead description: Tempo máximo em segundos para aguardar uma nova leitura antes de retonar in: query type: integer format: int64 responses: 200: description: Ok schema: type: object required: – lastUpdate – stabilized properties: weight: type: number format: double description: Peso em kilogramas da pesagem estabilizada mais recenter lastUpdate: type: string format: date-time description: Data última atualização stabilized: type: boolean description: Indica se a balança esta estabilizada 401: description: Usuário ou senha inválido 403: description: Permissão negada default: description: Error response schema: #/definitions/genericError /balanca/queries/getMetadata: post: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: metadataFormat: type: string description: responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: metadataFormat description: in: query type: string responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /balanca/queries/getDependencies: post: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /balanca/queries/healthcheck: post: description: HealthCheck plataforma tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/healthcheckDTO description: Status de retorno checks: type: object allOf: – #/definitions/checkDTO description: Checks executados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: HealthCheck plataforma tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/healthcheckDTO description: Status de retorno checks: type: object allOf: – #/definitions/checkDTO description: Checks executados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /balanca/actions/loginWithKey: post: description: Realiza login na plataforma para as balanças reaproveitando tokens. tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – accessKey – secret – tenantName properties: accessKey: type: string description: Chave da aplicação secret: type: string description: Segredo da chave informada tenantName: type: string description: Nome do tenant em que se deseja efetuar o login forceAuthentication: type: boolean description: Indica que não deve usar cache default: false responses: 200: description: Ok schema: type: object required: – jsonToken properties: jsonToken: type: string description: String contendo um json com o token de acesso e tempo de validade do token de acesso 400: description: Requisição inválida, parâmetros obrigatórios não informados 401: description: Não foi possível efetuar o login no tenant com o accessKey e secret informados default: description: Error response schema: #/definitions/genericError /balanca/actions/checkAppAccess: post: description: Checagem de Acesso ao aplicativo de balança tags: – Actions x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – tenantName – code properties: tenantName: type: string description: Nome do tenant em que se deseja efetuar o login code: type: string description: Código da Balança Configurado no aplicativo appVersion: type: string description: Versão do Aplicativo responses: 200: description: Ok schema: type: object properties: role: type: string allOf: – #/definitions/appRole description: Permissão do usuário para o aplicativo message: type: string description: Mensagem de retorno de informação sobre a checagem do aplicativo 400: description: Requisição inválida, parâmetros obrigatórios não informados 401: description: O usuário não esta autorizado a utilizar a aplicação. default: description: Error response schema: #/definitions/genericError /balanca/actions/inputWeight: post: description: Recebe peso de uma balança e envia ao YMS tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – code – weight properties: code: type: string description: Código que identifia a balança weight: type: number format: double description: Peso em kilogramas stabilized: type: boolean description: Indicador de Estabilização default: true responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /balanca/actions/manualWeight: post: description: Recebe peso informado por um usuário tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – code – weight properties: code: type: string description: Código que identifica a balança weight: type: number format: double description: Peso em kilogramas responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /balanca/signals/newWeight: post: description: Enviar peso tags: – Signals parameters: – name: input in: body required: true schema: type: object required: – code – weight properties: code: type: string description: Código que identifia a balança weight: type: number format: double description: Peso em kilogramas stabilized: type: boolean description: Indicador de Estabilização default: true responses: 202: description: Accepted default: description: Error response schema: #/definitions/genericError /balanca/signals/stopResendStabilizedWeight: post: description: Interrompe o reenvio de peso estabilizado tags: – Signals parameters: – name: input in: body required: true schema: type: object required: – code properties: code: type: string description: Código que identifia a balança responses: 202: description: Accepted default: description: Error response schema: #/definitions/genericError /balanca/events/readWeightScale: post: description: Leitura de peso da balança x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – code – weight – stabilized – manual properties: code: type: string description: Código que identifia a balança weight: type: number format: double description: Peso em kilogramas stabilized: type: boolean description: Indicador de Estabilização manual: type: boolean description: Indica se a origem do peso é manual ou direto da balança responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /balanca/events/appStarted: post: description: Indica que um aplicativo de balança esta em uso x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – code – tenantName – lastUpdate properties: code: type: string description: Código que identifia a balança tenantName: type: string description: Tenant em uso userName: type: string description: Usuário da Balança lastUpdate: type: string format: date-time description: Data última atualização responses: 200: description: OK default: description: Error response schema: #/definitions/genericErrordefinitions: appRole: description: Papel para Aplicativo Desktop Balança type: string enum: – ROLE_USER – ROLE_ADMIN userNotificationKind: description: User notification kind. type: string enum: – Operational – Management – News userNotificationPriority: description: User notification priority. type: string enum: – Error – Alert – None eventEmailFormat: description: Format of the email type: string enum: – HTML – PLAIN_TEXT healthcheckDTO: description: Status do healthcheck type: string enum: – UP – DOWN notifyUserEventPayload: description: Represents a regular user event notification payload discriminator: _discriminator type: object required: – notificationKind – notificationPriority – notificationSubject – notificationContent – sourceDomain – sourceService – destinationUser – _discriminator properties: notificationClass: type: string description: Class of notification notificationOrigin: type: string description: Origin of notification. Free text. Optional. notificationKind: type: string allOf: – #/definitions/userNotificationKind description: Notification kind. notificationPriority: type: string allOf: – #/definitions/userNotificationPriority description: Notification priority. notificationSubject: type: string description: Notification subject. notificationContent: type: string description: Notification content. sourceDomain: type: string description: Domain that generates the notification. sourceService: type: string description: Service that generates the notification. destinationUser: type: string description: Username of the destination user. link: type: string description: Notification link _discriminator: type: string description: emailNotifyUserEventPayload: description: Represents an email notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – from properties: from: type: string description: Email sender address sendTo: type: array items: type: string description: Additional recipients to send the email to format: type: string allOf: – #/definitions/eventEmailFormat description: Email format pushNotifyUserEventPayload: description: Represents a push notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – applicationId properties: applicationId: type: string description: Apple/Google application id blobReference: description: Default blob reference type. Every service defines its own. type: object required: – targetObjectId properties: domainName: type: string description: The domain the blob belongs to. serviceName: type: string description: The service the blob belongs to. targetObjectId: type: string description: The basic id of the blob. targetCopyId: type: string description: The id of the blob copy. basicErrorPayload: description: Default error payload type. Every service defines its own. type: object properties: message: type: string description: The user-facing error message, if any. errorCode: type: string description: The program-accessible (and service-specific) error code. dependency: description: Represents a service dependency type: object required: – domain – service – version properties: domain: type: string description: Domain of the dependency service service: type: string description: Name of the dependency service type: string description: Version of the dependency service checkDTO: description: Retorno status usados de retorno type: object required: – status – name properties: status: type: string allOf: – #/definitions/healthcheckDTO description: Status name: type: string description: Status genericError: properties: message: type: string description: Messaging describing the error. reason: type: string description: A symbolic code identifying the category of the reason of the error. enum: – BAD_REQUEST – UNAUTHORIZED – PAYMENT_REQUIRED – FORBIDDEN – OBJECT_NOT_FOUND – REQUEST_TIMEOUT – GONE – UNPROCESSABLE – INTERNAL_ERROR – NOT_IMPLEMENTED – SERVICE_UNAVAILABLE – INSUFFICIENT_STORAGE