2.0info: 1.5.0 Gateway WhatsApp x-senior-domain: platform x-senior-domain-path: platform x-senior-service-path: instant_messaging 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: /instant_messaging/queries/healthcheck: post: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/healthCheckStatus description: Status do serviços checks: type: array items: type: object allOf: – #/definitions/checkDTO minimum: 1 description: Items avaliados 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 responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/healthCheckStatus description: Status do serviços checks: type: array items: type: object allOf: – #/definitions/checkDTO minimum: 1 description: Items avaliados 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /instant_messaging/queries/listProviders: post: description: Lista todos os providers configurados tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object properties: includeInactive: type: boolean description: Incluir os providers inativos default: false responses: 200: description: Ok schema: type: object required: – providers properties: providers: type: array items: type: object allOf: – #/definitions/provider minimum: 1 description: Providers configurados 401: description: Usuário ou senha inválidos default: description: Error response schema: #/definitions/genericError get: description: Lista todos os providers configurados tags: – Queries x-senior-visibility: PUBLIC parameters: – name: includeInactive description: Incluir os providers inativos in: query type: boolean responses: 200: description: Ok schema: type: object required: – providers properties: providers: type: array items: type: object allOf: – #/definitions/provider minimum: 1 description: Providers configurados 401: description: Usuário ou senha inválidos default: description: Error response schema: #/definitions/genericError /instant_messaging/queries/getTenantByPhoneNumber: post: description: Tenant da requisição tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – phoneNumber properties: phoneNumber: type: string description: Número do telefone responses: 200: description: Ok schema: type: object properties: tenant: type: string description: Tenant configurado 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError get: description: Tenant da requisição tags: – Queries x-senior-visibility: PUBLIC parameters: – name: phoneNumber description: Número do telefone in: query required: true type: string responses: 200: description: Ok schema: type: object properties: tenant: type: string description: Tenant configurado 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /instant_messaging/queries/getTenantByProvider: post: description: Tenant da requisição tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – provider properties: provider: type: string description: Id do provider responses: 200: description: Ok schema: type: object properties: tenant: type: string description: Tenant configurado 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError get: description: Tenant da requisição tags: – Queries x-senior-visibility: PUBLIC parameters: – name: provider description: Id do provider in: query required: true type: string responses: 200: description: Ok schema: type: object properties: tenant: type: string description: Tenant configurado 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /instant_messaging/queries/getTenantByNumber: post: description: Tenant da requisição tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – number properties: number: type: string description: To da request responses: 200: description: Ok schema: type: object properties: tenant: type: string description: Tenant 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError get: description: Tenant da requisição tags: – Queries x-senior-visibility: PUBLIC parameters: – name: number description: To da request in: query required: true type: string responses: 200: description: Ok schema: type: object properties: tenant: type: string description: Tenant 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /instant_messaging/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 /instant_messaging/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 /instant_messaging/actions/infoBipCallbackMessage: post: description: tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – results properties: results: type: array items: type: object allOf: – #/definitions/infoBipResult minimum: 1 description: messageCount: type: integer format: int64 description: pendingMessageCount: type: integer format: int64 description: responses: 200: description: Ok schema: type: object required: – message properties: message: type: string description: default: description: Error response schema: #/definitions/genericError /instant_messaging/actions/setServiceToProvider: post: description: Configura o serviço que está chamando essa primitiva para responder as mensagens recebidas pelo provedor, ou true no campo removeLink para remover o vínculo existente tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – providerId properties: providerId: type: string description: Id do provedor removeLink: type: boolean description: Remove a configuração salva default: false responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /instant_messaging/actions/saveProvider: post: description: Configura ou atualiza um provider para ser utilizado no envio de mensagens\n ### Resources:\n – res://senior.com.br/platform/instant_messaging/provider_settings\n tags: – Actions x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – settings – description properties: id: type: string description: ID do provider settings: type: object allOf: – #/definitions/providerSettings description: Configurações para a utilização do provider description: type: string description: Descrição de uso do provider active: type: boolean description: Ativar/Desativar um provider default: true responses: 200: description: Ok schema: type: object 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente 401: description: Usuário ou senha inválidos 403: description: Permissão negada 404: description: Não foi encontrada uma configuração para o provedor default: description: Error response schema: #/definitions/genericError /instant_messaging/actions/removeProvider: post: description: Remover provider tags: – Actions x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – settings – description properties: id: type: string description: ID do provider settings: type: object allOf: – #/definitions/providerSettings description: Configurações para a utilização do provider description: type: string description: Descrição de uso do provider active: type: boolean description: Ativar/Desativar um provider default: true responses: 200: description: Ok schema: type: object 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente 401: description: Usuário ou senha inválidos 403: description: Permissão negada 404: description: Não foi encontrada uma configuração para o provedor default: description: Error response schema: #/definitions/genericError /instant_messaging/actions/testProvider: post: description: Permite efetuar o teste de um provider previamente cadastrado, o provider nao precisa estar ativo para executar o teste tags: – Actions x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – type – destination properties: type: type: string allOf: – #/definitions/providerType description: Provider configurado originNumber: type: string description: Número de origem das mensagens, necessário informar quando tiver mais de um provider do mesmo tipo cadastrado destination: type: string description: Número do WhatsApp no formato internacional, exemplo: 41799999999. Apenas são aceitos números válidos no Brasil responses: 200: description: Ok schema: type: object 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente 401: description: Usuário ou senha inválidos 404: description: Não foi encontrada uma configuração para o provedor default: description: Error response schema: #/definitions/genericError /instant_messaging/actions/sendMessage: post: description: Envio da mensagem tags: – Actions x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – content – destination properties: content: type: object allOf: – #/definitions/content description: Conteúdo da mensagem destination: type: object allOf: – #/definitions/destination description: Destino do envio da mensagem origin: type: object allOf: – #/definitions/service description: Origem do envio da mensagem, se informado, o evento disparado referente ao envio sera destinado ao serviço type: type: string allOf: – #/definitions/providerType description: Provider para envio de mensagem, caso não seja informado vamos utilizar o configurado por padrão para o tenant originNumber: type: string description: Número de origen das mensagens, necessário informar quando tiver mais de um provider do mesmo tipo cadastrado responses: 200: description: Ok schema: type: object required: – ticket properties: ticket: type: string description: Ticket do envio da mensagem 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente 401: description: Usuário ou senha inválidos 404: description: Não foi encontrada uma configuração para o provedor default: description: Error response schema: #/definitions/genericError /instant_messaging/signals/twilioCallbackMessage: post: description: tags: – Signals parameters: – name: input in: body required: true schema: type: object required: – from – to – body – accountSid properties: from: type: string description: to: type: string description: body: type: string description: accountSid: type: string description: responses: 202: description: Accepted default: description: Error response schema: #/definitions/genericError /instant_messaging/signals/zenviaCallbackMessage: post: description: tags: – Signals parameters: – name: input in: body required: true schema: type: object required: – message properties: id: type: string description: message: type: object allOf: – #/definitions/zenviaMessage description: timestamp: type: string format: date-time description: subscriptionId: type: string description: channel: type: string description: direction: type: string description: responses: 202: description: Accepted default: description: Error response schema: #/definitions/genericError /instant_messaging/events/messageSent: post: description: Mensagem enviada com sucesso. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – ticket properties: ticket: type: string description: Ticket do envio da mensagem responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /instant_messaging/events/messageSentError: post: description: Mensagem enviada com erro. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – ticket properties: ticket: type: string description: Ticket do envio da mensagem message: type: string description: Mensagem de erro responses: 200: description: OK default: description: Error response schema: #/definitions/genericErrordefinitions: healthCheckStatus: description: Status do Healthcheck type: string enum: – UP – DOWN providerType: description: Provedor de envio de mensagens suportado type: string enum: – TWILIO – INFOBIP – ZENVIA contentType: description: Tipo do conteúdo da mensagem type: string enum: – PLAINTEXT – HTML – BUTTON 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 checkDTO: description: Componente avaliado no health check type: object required: – name – status properties: name: type: string description: Nome do componente status: type: string allOf: – #/definitions/healthCheckStatus description: Status do componente provider: description: type: object required: – id – type – settings – description properties: id: type: string maxLength: 255 description: Identificador do provider type: type: string allOf: – #/definitions/providerType description: Provider configurado settings: type: object allOf: – #/definitions/providerSettings description: Configurações do provider description: type: string description: Descrição de uso do provider active: type: boolean description: Ativar/Desativar um provider default: true providerSettings: description: discriminator: _discriminator type: object required: – _discriminator properties: _discriminator: type: string description: twilioSettings: description: allOf: – #/definitions/providerSettings – type: object required: – authToken – accountSid – originNumber properties: authToken: type: string description: Token de autorização obtido na plataforma Twilio accountSid: type: string description: SID da conta obtido na plataforma Twilio originNumber: type: string description: Numero de telefone que sera utilizado como origem da mensagem cadastrado na plataforma Twilio infoBipSettings: description: allOf: – #/definitions/providerSettings – type: object required: – authToken – baseUrl – originNumber properties: authToken: type: string description: Token de autorização obtido na plataforma InfoBip baseUrl: type: string description: Base da URL disponibilizada pela InfoBip https://www.infobip.com/docs/essentials/base-url scenarioKey: type: string description: Quando nao informado, o InfoBip vai utilizar o default configurado em sua plataforma originNumber: type: string description: Número de WhatsApp habilitado no provedor contratado zenviaSettings: description: allOf: – #/definitions/providerSettings – type: object required: – authToken – senderId – originNumber properties: authToken: type: string description: Token de autorização obtido na plataforma Zenvia senderId: type: string description: O identificador do sender configurado na plataforma Zenvia originNumber: type: string description: Número de WhatsApp habilitado no provedor contratado service: description: Serviço de origem do envio type: object required: – domain – service properties: domain: type: string description: Domínio service: type: string description: Serviço content: description: Conteúdo da mensagem type: object properties: message: type: string description: Mensagem que sera enviada type: type: string allOf: – #/definitions/contentType description: Tipo do conteúdo options: type: array items: type: object allOf: – #/definitions/optionContentRecord description: Opções template: type: object allOf: – #/definitions/template description: template do conteúdo optionContentRecord: description: type: object required: – text properties: text: type: string description: Label da opção value: type: string description: Valor da opção url: type: string description: Url da opção template: description: type: object required: – id – type – fields properties: id: type: string description: template id type: type: string allOf: – #/definitions/contentType description: tipo do template fields: type: array items: type: object allOf: – #/definitions/templateContentRecord minimum: 1 description: Opções templateContentRecord: description: type: object required: – text – value properties: text: type: string description: Label da opção value: type: string description: Valor da opção destination: description: Destino da mensagem type: object required: – to properties: to: type: string description: Telefone do destinário infoBipResult: description: type: object required: – from – to – receivedAt – message properties: from: type: string description: to: type: string description: receivedAt: type: string description: message: type: object allOf: – #/definitions/infoBipMessage description: integrationType: type: string description: messageId: type: string description: contact: type: object allOf: – #/definitions/infoBipContact description: price: type: object allOf: – #/definitions/infoBipPrice description: infoBipMessage: description: type: object required: – text properties: text: type: string description: type: type: string description: infoBipContact: description: type: object required: – name properties: name: type: string description: infoBipPrice: description: type: object required: – pricePerMessage – currency properties: pricePerMessage: type: number format: double description: currency: type: string description: zenviaMessage: description: type: object required: – from – to – contents – timestamp properties: from: type: string description: to: type: string description: contents: type: array items: type: object allOf: – #/definitions/zenviaContent minimum: 1 description: timestamp: type: string format: date-time description: direction: type: string description: channel: type: string description: visitor: type: object allOf: – #/definitions/zenviaVisitor description: zenviaVisitor: description: type: object required: – name properties: name: type: string description: firstName: type: string description: lastName: type: string description: zenviaContent: description: type: object required: – text properties: type: type: string description: text: type: string description: 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