2.0info: 2.30.2 Bot Factory description: Serviço BotFactory x-senior-domain: Plataforma x-senior-domain-path: platform x-senior-service-path: botfactory contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: api.senior.com.br /platform/botfactory/securityDefinitions: bearerAuth: type: apiKey in: header name: Authorization – application/json – application/jsonpaths: /listTemplates: post: description: Lista os templates de bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object required: – contents properties: contents: #/definitions/botTemplate 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /verifyBotPermissions: post: description: Verifica permissões do bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botsIds – actions properties: botsIds: type: array items: type: string description: Identificadores do Bot actions: type: array items: type: string description: Ações a serem verifcadas responses: 200: description: Ok schema: type: object required: – permissions properties: permissions: #/definitions/botPermissionChecked 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /anonymous/message: post: description: Envio de mensagens para o bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – in: header name: X-Tenant description: Nome do tenant type: string – in: header name: X-TenantDomain description: Domínio tenant type: string – name: input in: body required: true schema: type: object required: – from – to – content – conversationId – datetime properties: from: type: string description: Origem da mensagem to: type: string description: Destinatário da mensagem content: type: string description: Conteúdo da mensagem conversationId: type: string description: Id da conversa datetime: type: string description: Hora de envio da mensagem authorization: type: string description: Token de autorização conversationResource: #/definitions/conversationResource ip: type: string description: IP do usuário responses: 200: description: Ok schema: type: object required: – from – to – content – conversationId – conversationConfidence – datetime properties: from: type: string description: Origem da mensagem to: type: string description: Destinatário da mensagem content: #/definitions/contentRecord conversationId: type: string description: Id da conversa conversationConfidence: #/definitions/confidenceLevel datetime: type: string description: Hora de envio da resposta 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /getBotChannels: post: description: Query para listar as configurações de channels para um bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId properties: botId: type: string description: Bot ID responses: 200: description: Ok schema: type: object required: – botChannels properties: botChannels: #/definitions/botChannelConfig 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /anonymous/getBotStatus: post: description: Obtém o status do workspace de um determinado Bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – in: header name: X-Tenant description: Nome do tenant type: string – in: header name: X-TenantDomain description: Domínio tenant type: string – name: input in: body required: true schema: type: object required: – botId properties: botId: type: string description: Identificador do Bot responses: 200: description: Ok schema: type: object required: – status properties: status: #/definitions/botStatus 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /listBots: post: description: Lista os bots e retorna a url do avatar x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – page – size properties: page: type: integer description: Página size: type: integer description: Quantidade por página botChannels: type: array items: #/definitions/conversationResource description: Canais no qual se deseja filtrar permissionLevel: #/definitions/botPermissionLevel responses: 200: description: Ok schema: type: object required: – total properties: contents: #/definitions/botRecord total: type: integer description: Total de ítens 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /getConversationsHistory: post: description: Retorna as mensagens mais recentes de uma conversa x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object properties: conversationsIds: type: array items: type: string description: Ids das conversas a serem consultadas page: type: integer description: Página limit: type: integer description: Quantidade de registros retornados responses: 200: description: Ok schema: type: object properties: conversationsHistory: #/definitions/conversationHistory 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /saveNode: post: description: Cria ou atualiza as informações do nó
### Resources:
– res://senior.com.br/platform/botfactory
x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: #/definitions/saveNodeInput responses: 200: description: Ok 404: description: Nó não encontrado 403: description: Permissão negada 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /getNodeInfo: post: description: Retorna as informações do nó para o frontend x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId – nodeId properties: botId: type: string description: Id do bot nodeId: type: string description: Id do nó responses: 200: description: Ok schema: type: object required: – name properties: name: type: string description: Nome output: #/definitions/contentRecord examples: type: string description: Lista de exemplos goToNode: type: string description: Ir para nó 404: description: Nó não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /changeBotChannels: post: description: Action para alterar a configuração de channels do bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId – botChannels properties: botId: type: string description: Bot uuid botChannels: type: array items: #/definitions/botChannelConfig description: responses: 200: description: Ok 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /removeNode: post: description: Remove um nó
### Resources:
– res://senior.com.br/platform/botfactory
x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId – nodeId properties: botId: type: string description: Identificador do bot nodeId: type: string description: Identificador do nó responses: 200: description: Ok schema: type: object required: – success properties: success: type: boolean description: assignedNodes: #/definitions/nodeFullInfo 404: description: Nó não encontrado 403: description: Permissão negada 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /getConversationHistory: post: description: Retorna as mensagens de uma conversa, iniciando pelas mais recentes x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – conversationId properties: conversationId: type: string description: Id da conversa page: type: integer description: Página limit: type: integer description: Quantidade de registros retornados responses: 200: description: Ok schema: type: object properties: messages: #/definitions/logMessageRecord 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /anonymous/startConversation: post: description: Inicia uma conversa com o bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – in: header name: X-Tenant description: Nome do tenant type: string – in: header name: X-TenantDomain description: Domínio tenant type: string – name: input in: body required: true schema: type: object required: – to – from properties: to: type: string description: Bot from: type: string description: Usuário que quer iniciar a conversa conversationResource: #/definitions/conversationResource responses: 200: description: Ok schema: type: object required: – from – to – content – conversationId – messengerUrl – conversationConfidence – datetime properties: from: type: string description: Origem da mensagem to: type: string description: Destinatário da mensagem content: #/definitions/contentRecord conversationId: type: string description: Id da conversa messengerUrl: type: string description: Url do serviço responsável pela troca de mensagens da conversa conversationConfidence: #/definitions/confidenceLevel datetime: type: string description: Hora de início da conversa ip: type: string description: IP do usuário 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /getTreeNodes: post: description: Retorna a árvore de nós x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId properties: botId: type: string description: Identificador do bot responses: 200: description: Ok schema: type: object required: – contents properties: contents: #/definitions/treeNode 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /createBotFromTemplate: post: description: Cria um novo bot a partir de um template x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – templateName properties: templateName: type: string description: Nome do Template responses: 200: description: Ok schema: type: object required: – bot properties: bot: #/definitions/bot 404: description: Template não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /anonymous/getBotInfo: post: description: Retorna todas as informações do bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – in: header name: X-Tenant description: Nome do tenant type: string – in: header name: X-TenantDomain description: Domínio tenant type: string – name: input in: body required: true schema: type: object required: – botId properties: botId: type: string description: Identificador do bot responses: 200: description: Ok schema: type: object required: – content properties: content: #/definitions/botRecord 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /getSubjectAndVariationNodes: post: description: Retorna lista de nós e seus ids x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId properties: botId: type: string description: Id do bot responses: 200: description: Ok schema: type: object required: – contents properties: contents: #/definitions/nodeInfo 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /duplicateBot: post: description: Duplica um bot x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – name: input in: body required: true schema: type: object required: – botId properties: botId: type: string description: Id do bot a ser duplicado responses: 200: description: Ok schema: type: object required: – newBotId properties: newBotId: type: string description: id do novo bot 404: description: Bot não encontrado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /anonymous/getBotInfoFromAppKey: post: description: Retorna as informações do bot a partir de uma AppKey x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – in: header name: X-Tenant description: Nome do tenant type: string – in: header name: X-TenantDomain description: Domínio tenant type: string – name: input in: body required: true schema: type: object required: – appKey properties: appKey: type: string description: appKey responses: 200: description: Ok schema: type: object required: – botId – tenant properties: botId: type: string description: informações do bot tenant: type: string description: Tenant que o bot está criado 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericErrordefinitions: botPermissionLevel: type: string enum: – VIEW – EDIT botStatus: type: string enum: – NON_EXISTENT – TRAINING – FAILED – AVAILABLE – UNAVAILABLE confidenceLevel: type: string enum: – LOW – MEDIUM – HIGH conversationResource: type: string enum: – BROWSER – GOOGLE_ASSISTANT – WHATSAPP – INSTANT_MESSAGING nodeType: type: string enum: – INTENT – VARIATION – WELCOME – FALLBACK – TOPIC contentType: type: string enum: – PLAINTEXT – HTML – BUTTON – IMAGE – GALLERY – CARD – INTEGRATION httpMethodType: type: string enum: – GET – POST – PUT – DELETE – PATCH paramType: type: string enum: – CONSTANT – INPUT – VARIABLE dataType: type: string enum: – STRING – INTEGER messageSourceType: type: string enum: – BOT – USER – MONITOR saveNodeInput: type: object required: – botId – position – type – name properties: botId: type: string description: Identificador do bot nodeId: type: string description: Identificador do nó parent: type: string description: Nó pai position: type: integer description: Posição do nó no nível type: #/definitions/nodeType name: type: string description: Nome output: type: array items: #/definitions/contentRecord description: Lista de respostas examples: type: array items: type: string description: Lista de exemplos goToNode: type: string description: Ir para nó contentRecord: type: object required: – type properties: type: #/definitions/contentType text: type: array items: type: string description: textos options: type: array items: #/definitions/optionContentRecord description: Opções image: #/definitions/imageContentRecord cards: type: array items: #/definitions/cardContentRecord description: lista de cards integration: #/definitions/integrationRecord optionContentRecord: 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 imageContentRecord: type: object properties: url: type: string description: Url da imagem link: type: string description: link ao clicar na imagem text: type: string description: texto para enviar ao clicar na imagem cardContentRecord: type: object required: – imageUrl – title properties: imageUrl: type: string description: imagem type: string description: Título da imagem description: type: string description: Descrição da imagem option: #/definitions/optionContentRecord integrationRecord: type: object required: – url – method – isSDKIntegration properties: url: type: string description: Url da integração method: #/definitions/httpMethodType isSDKIntegration: type: boolean description: Se a integração é feita através do SDK fileName: type: string description: Nome do arquivo no ambiente SDK params: type: array items: #/definitions/paramRecord description: Lista de parâmetros paramRecord: type: object required: – name – type – askFor properties: name: type: string description: Nome do parâmetro type: #/definitions/paramType dataType: #/definitions/dataType value: type: string description: Valor do parâmetro, se constante askFor: type: string description: Pergunta feita para preencher o valor do parâmetro logMessageRecord: type: object required: – conversationId – contents – confidence – logDate – from – to – sourceType properties: conversationId: type: string description: Id da conversa contents: type: array items: #/definitions/contentRecord description: Conteúdo da mensagem confidence: #/definitions/confidenceLevel logDate: type: string description: Momento em que a mensagem foi logada format: date-time from: type: string description: Origem da mensagem to: type: string description: Destinatário da mensagem sourceType: #/definitions/messageSourceType botRecord: type: object required: – id – name – description – avatar – accuracy – appKey properties: id: type: string description: Identificador name: type: string description: Nome description: type: string description: Descrição avatar: type: string description: Avatar accuracy: #/definitions/confidenceLevel appKey: type: string description: AppKey owner: type: string description: Usuário que criou o bot treeNode: type: object required: – data – label properties: data: #/definitions/treeNodeData label: type: string description: Nome di diálogo children: type: array items: #/definitions/treeNode description: Filhos treeNodeData: type: object required: – id – type – position – hasGoTo properties: id: type: string description: Identificador do nó type: #/definitions/nodeType position: type: integer description: Posição hasGoTo: type: boolean description: Ir para nodeInfo: type: object required: – id – name properties: id: type: string description: Id do nó name: type: string description: Nome do nó nodeFullInfo: type: object required: – nodeId – name – type – position – examples – output – botId properties: nodeId: type: string description: Identificador do nó name: type: string description: Nome do nó type: #/definitions/nodeType position: type: integer description: Posição do nó examples: type: array items: type: string description: Exemplos output: type: array items: #/definitions/contentRecord description: Respostas do bot parent: type: string description: Pai do nó goToNode: type: string description: Referencia a outro nó botId: type: string description: Identificador do bot que possui esse nó conversationHistory: type: object required: – conversationId – messages properties: conversationId: type: string description: Id da conversa messages: type: array items: #/definitions/logMessageRecord description: Mensagem realizadas na conversa botTemplate: type: object required: – id – name – description – icon properties: id: type: integer description: identificação unica do processo que representa o template do processo name: type: string description: Nome do Modelo description: type: string description: Descrição explicando o modelo icon: type: string description: representação do icone downloadUrl: type: string description: URL para download do template botChannelConfig: type: object required: – name – enabled properties: name: #/definitions/conversationResource enabled: type: boolean description: Se está habilitado ou não providerId: type: string description: Id do provedor quando o canal for via instant-messaging botPermissionChecked: type: object required: – botId – actions properties: botId: type: string description: Identificador do bot actions: type: array items: #/definitions/botPermissionActionChecked description: Ações verificadas botPermissionActionChecked: type: object required: – action – authorized properties: action: type: string description: Nome da ação authorized: type: boolean description: Se possui autorização bot: type: object required: – name properties: id: type: string description: format: uuid name: type: string description: Nome description: type: string description: Descrição do Robô avatar: #/definitions/avatar accuracy: type: integer description: Meta de acertividade do bot currentAccuracy: type: integer description: Acertividade atual nodes: type: array items: #/definitions/node description: Lista de nós raiz build: type: string description: Identificador de build PLN appKey: type: string description: AppKey do tenant senior owner: type: string description: Usuário que criou o bot channels: type: array items: #/definitions/botChannel description: Canais em que o bot se encontra disponível isPublic: type: boolean description: Se o bot está configurado para ser público avatar: type: object required: – fileId – fileName properties: id: type: string description: format: uuid fileId: type: string description: TargetObjectId fileName: type: string description: Nome do arquivo type: string description: Versão do arquivo no blob-service bot: #/definitions/bot node: type: object required: – position properties: id: type: string description: format: uuid configuration: #/definitions/nodeConfig position: type: integer description: Ordem do campo parent: #/definitions/node children: type: array items: #/definitions/node description: nós filhos goToNode: #/definitions/node bot: #/definitions/bot nodeConfig: type: object required: – type properties: id: type: string description: format: uuid type: #/definitions/nodeType name: type: string description: Nome variationGroup: #/definitions/variationGroup variation: #/definitions/variation subject: #/definitions/subject output: #/definitions/output node: #/definitions/node variationGroup: type: object properties: id: type: string description: format: uuid variations: type: array items: #/definitions/variation description: Lista de variações node: #/definitions/nodeConfig build: type: string description: Identificador de build PLN variation: type: object properties: id: type: string description: format: uuid synonyms: type: array items: #/definitions/synonym description: Lista de sinônimos patterns: type: array items: #/definitions/pattern description: Lista de padrões variationGroup: #/definitions/variationGroup synonym: type: object required: – synonym properties: id: type: string description: format: uuid variation: #/definitions/variation synonym: type: string description: Sinônimo pattern: type: object required: – pattern properties: id: type: string description: format: uuid variation: #/definitions/variation pattern: type: string description: Pattern subject: type: object properties: id: type: string description: format: uuid examples: type: array items: #/definitions/subjectExample description: Lista de exemplos node: #/definitions/nodeConfig build: type: string description: Identificador de build PLN subjectExample: type: object required: – example properties: id: type: string description: format: uuid example: type: string description: Exemplo subject: #/definitions/subject output: type: object properties: id: type: string description: format: uuid contents: type: array items: #/definitions/content description: Lista de Itens de resposta variables: type: array items: #/definitions/contextVariable description: Lista de variáveis de contexto node: #/definitions/nodeConfig content: type: object required: – type – seq properties: id: type: string description: format: uuid type: #/definitions/contentType text: type: array items: #/definitions/textContent description: textos image: #/definitions/imageContent options: type: array items: #/definitions/optionContent description: Valor das opções de botões, quando botões cards: type: array items: #/definitions/cardContent description: lista de cards integration: #/definitions/integration output: #/definitions/output seq: type: integer description: Sequencia do conteúdo textContent: type: object required: – text properties: id: type: string description: format: uuid text: type: string description: Texto content: #/definitions/content imageContent: type: object properties: id: type: string description: format: uuid url: type: string description: Url da imagem link: type: string description: link ao clicar na imagem text: type: string description: texto para enviar ao clicar na imagem content: #/definitions/content card: #/definitions/cardContent cardContent: type: object required: – imageUrl – title properties: id: type: string description: format: uuid imageUrl: type: string description: Imagem type: string description: Título da imagem description: type: string description: Descrição da imagem option: #/definitions/optionContent content: #/definitions/content optionContent: type: object required: – text – seq properties: id: type: string description: format: uuid text: type: string description: Label do botão value: type: string description: Valor da opção url: type: string description: Url content: #/definitions/content seq: type: integer description: Sequencia da opção integration: type: object required: – url – method – isSDKIntegration properties: id: type: string description: format: uuid url: type: string description: Url do serviço method: #/definitions/httpMethodType isSDKIntegration: type: boolean description: Se a integração é feita através do SDK fileName: type: string description: Nome do arquivo no ambiente SDK params: type: array items: #/definitions/param description: Lista de parâmetros content: #/definitions/content param: type: object required: – name – type – askFor properties: id: type: string description: format: uuid name: type: string description: Nome do parâmetro type: #/definitions/paramType dataType: #/definitions/dataType value: type: string description: Valor do parâmetro, se constante askFor: type: string description: Pergunta para informar o parâmetro integration: #/definitions/integration contextVariable: type: object required: – name – value properties: id: type: string description: format: uuid name: type: string description: Nome da variável value: type: string description: Valor da variável output: #/definitions/output botChannel: type: object required: – name – enabled properties: id: type: string description: format: uuid bot: #/definitions/bot name: #/definitions/conversationResource enabled: type: boolean description: Se está habilitado o canal ou não providerId: type: string description: Id do provedor do instant-messaging 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