2.0info: 1.3.1 Integrador de Webhooks e APIs description: Serviço responsável pela integração de Webhooks e APIs x-senior-domain: Plataforma x-senior-domain-path: platform x-senior-service-path: events_hub 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/platformsecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /events_hub/queries/listWebhooks: post: description: Lista todos os Webhooks tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – filter properties: filter: type: object allOf: – #/definitions/listWebhooksFilterDTO description: Filtro para a pesquisa de Webhooks pagination: type: object allOf: – #/definitions/paginationDTO description: Dados para paginação responses: 200: description: Ok schema: type: object required: – webhooks – totalElements – totalPages properties: webhooks: type: array items: type: object allOf: – #/definitions/simpleWebhookDTO minimum: 1 description: Lista de Webhooks totalElements: type: integer format: int64 description: Total de elementos na lista totalPages: type: integer format: int64 description: Total de páginas geradas 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/queries/getWebhook: post: description: Busca um Webhook tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do Webhook responses: 200: description: Ok schema: type: object required: – webhook properties: webhook: type: object allOf: – #/definitions/completeWebhookDTO description: Dados do Webhook 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Busca um Webhook tags: – Queries x-senior-visibility: PRIVATE parameters: – name: id description: Identificador do Webhook in: query required: true type: string responses: 200: description: Ok schema: type: object required: – webhook properties: webhook: type: object allOf: – #/definitions/completeWebhookDTO description: Dados do Webhook 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/queries/listLogHistories: post: description: Lista todos os históricos de requisições de sucesso e erros nas entregas dos eventos aos serviços externos tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do Webhook filter: type: object allOf: – #/definitions/listLogHistoriesFilterDTO description: Filtros para pesquisa de histórico pagination: type: object allOf: – #/definitions/paginationDTO description: Dados para paginação responses: 200: description: Ok schema: type: object required: – histories – totalElements – totalPages properties: histories: type: array items: type: object allOf: – #/definitions/logHistoryDTO minimum: 1 description: Lista de históricos totalElements: type: integer format: int64 description: Total de elementos na lista totalPages: type: integer format: int64 description: Total de páginas geradas 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/queries/healthcheck: post: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: Status geral do serviço checks: type: array items: type: object allOf: – #/definitions/checkDataDTO minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: Status geral do serviço checks: type: array items: type: object allOf: – #/definitions/checkDataDTO minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/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 /events_hub/queries/getDependencies: post: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PUBLIC 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: PUBLIC 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 /events_hub/actions/updateWebhook: post: description: Atualiza os endpoints associados a um evento de um Webhook tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object allOf: – #/definitions/completeWebhookDTO responses: 200: description: Ok schema: type: object required: – id properties: id: type: string description: Identificador do Webhook 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/actions/createWebhook: post: description: Cria um Webhook associando endpoints a um evento tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object allOf: – #/definitions/webhookDTO responses: 200: description: Ok schema: type: object required: – id properties: id: type: string description: Identificador do Webhook 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/actions/testUrlConnection: post: description: Testa a conexão do events-hub com os serviços externos, via requisição REST com o método HTTP OPTIONS tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – url properties: url: type: string description: Endereço do endpoint responses: 200: description: Ok schema: type: object required: – code – message properties: code: type: integer format: int64 description: O código http retornado pela requisição message: type: string description: A mensagem retornada pela requisição 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /events_hub/events/createdWebhook: post: description: Evento que notifica a criação de um novo Webhook x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do Webhook responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /events_hub/events/updatedWebhook: post: description: Evento que notifica a atualização de um Webhook x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – id properties: id: type: string description: Identificador do Webhook responses: 200: description: OK default: description: Error response schema: #/definitions/genericErrordefinitions: upDown: description: Up or down type: string enum: – UP – DOWN 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 listLogHistoriesFilterDTO: description: Dados para o filtro do listLogHistories type: object properties: term: type: string description: Termo para pesquisa nos payloads de entrada e/ou de saída since: type: string format: date-time description: Data início do período. O valor padrão é 30 dias atrás until: type: string format: date-time description: Data fim do período. O valor padrão é a data atual onlyError: type: boolean description: Apenas logs de erro default: false logHistoryDTO: description: Dados para o filtro do listWebhookHistories type: object required: – id – url – start – end – duration – payloadSent – payloadReceived – bytesSent – bytesReceived – headers – success – httpCode properties: id: type: string description: Identificador do Histórico url: type: string description: Endereço do endpoint start: type: string format: date-time description: Início do envio end: type: string format: date-time description: Fim do envio duration: type: integer format: int64 description: Intervalo entre o início e fim da chamada em milissegundos payloadSent: type: string description: Payload enviado no POST do Request payloadReceived: type: string description: Payload recebido no Response do POST bytesSent: type: integer format: int64 description: Quantidade de bytes enviados bytesReceived: type: integer format: int64 description: Quantidade de bytes recebidos headers: type: array items: type: object allOf: – #/definitions/headerDTO minimum: 1 description: Cabeçalho da requisição success: type: boolean description: Enviado com sucesso? httpCode: type: integer format: int64 description: Código HTTP do Response listWebhooksFilterDTO: description: Dados para o filtro do listWebhooks type: object required: – search properties: search: type: string description: Termo a ser buscado simpleWebhookDTO: description: Dados para Simplificado do Webhoook type: object required: – id – event properties: id: type: string description: Identificador do Webhook event: type: object allOf: – #/definitions/eventDTO description: Evento em que deseja se inscrever webhookDTO: description: Dados para Weboook type: object required: – event – endpoints properties: event: type: object allOf: – #/definitions/eventDTO description: Evento em que deseja se inscrever endpoints: type: array items: type: object allOf: – #/definitions/endpointDTO minimum: 1 description: Lista de endpoints que receberá as informações do evento completeWebhookDTO: description: Dados para Weboook type: object required: – id – event – endpoints properties: id: type: string description: Identificador do Webhook event: type: object allOf: – #/definitions/eventDTO description: Evento em que deseja se inscrever endpoints: type: array items: type: object allOf: – #/definitions/completeEndpointDTO minimum: 1 description: Lista de endpoints que receberá as informações do evento eventDTO: description: Dados do Evento type: object required: – domainName – serviceName – primitiveName properties: domainName: type: string description: Nome do Domínio serviceName: type: string description: Nome do Serviço primitiveName: type: string description: Nome do Evento endpointDTO: description: Dados do endpoint discriminator: _discriminator type: object required: – url – _discriminator properties: url: type: string description: Endereço acessível pela Internet configurado para ouvir mensagens via POST contendo informações do evento active: type: boolean description: Identifica se o enpoint está ativo ou não. Por padrão é ativo default: true basicAuth: type: object allOf: – #/definitions/basicAuthDTO description: Informações para autenticação do tipo Basic headers: type: array items: type: object allOf: – #/definitions/headerDTO description: Campos a serem adicionados aos headers do POST payloadFilter: type: string description: Em caso de envio para destinatários específicos é verificado se os dados deste campo são iguais aos enviados\n no cabeçalho do evento applyRetry: type: boolean description: Se desabilitado será executada apenas uma tentativa de entrega do evento default: true authByEndpoint: type: boolean description: Indica se o webhook deverá utilizar um endpoint para obter o token de autorização. Por padrão é false default: false ignoreHttpCode: type: array items: type: integer format: int64 description: Indica os erros em que a mensagem poderá ser descartada authSettings: type: object allOf: – #/definitions/authSettings description: Informações de configuração do endpoint de autenticação _discriminator: type: string description: completeEndpointDTO: description: Dados do endpoint allOf: – #/definitions/endpointDTO – type: object required: – id properties: id: type: string description: Identificador do endpoint headerDTO: description: Dados do Cabeçalho HTTP type: object required: – key – value properties: key: type: string description: Chave value: type: string description: Valor basicAuthDTO: description: Dados da Autenticação Básica (Basic Authentication) type: object required: – username – password properties: username: type: string description: Usuário password: type: string description: Senha paginationDTO: description: Dados da paginação type: object properties: offset: type: integer format: int64 description: Número da página size: type: integer format: int64 description: Quantidade de registros por página checkDataDTO: description: Dados do healthcheck type: object required: – name – status properties: name: type: string description: Nome do healthcheck status: type: string allOf: – #/definitions/upDown description: Status do healthcheck authSettings: description: Dados de configuração do endpoint de autenticação type: object required: – url – payloadFilter – refreshToken properties: authTestSuccess: type: boolean description: Identifica se o teste de conexão retornou sucesso. Por padrão é false default: false url: type: string description: Url de autenticação headers: type: array items: type: object allOf: – #/definitions/headerDTO description: Campos a serem adicionados aos headers do POST payload: type: array items: type: object allOf: – #/definitions/requestBody description: Informações para autenticação payloadFilter: type: string description: JsonPath para identificar o token gerado na autenticação refreshToken: type: object allOf: – #/definitions/refreshToken description: Informações de configuração do endpoint de refresh token requestBody: description: Dados para autenticação type: object required: – key – value properties: key: type: string description: Chave value: type: string description: Valor refreshToken: description: Dados de configurações do endpoint de refresh token type: object required: – url properties: url: type: string description: Url de autenticação payload: type: array items: type: object allOf: – #/definitions/requestBody description: Informações para autenticação webhookExecutionInformationPayload: description: Informações de sucesso ou erro na execução de um Webhook type: object required: – id – event – endpoint – requestPayload – status – messageError properties: id: type: string description: Identificador do webhook event: type: string description: Evento em que se está inscrito endpoint: type: string description: Endpoint que receberá as informações do evento requestPayload: type: string description: Payload do webhook que se está executando status: type: string description: Status sucesso ou erro messageError: type: object allOf: – #/definitions/messageError description: Mensagem e código de erro retornada pela requisição messageError: description: Mensagem e código de erro retornada pela requisição type: object required: – httpCode – message properties: httpCode: type: integer format: int64 description: Código HTTP do Response message: type: string description: Mensagem retornada pela requisição 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 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