Power Automate: Retornar um arquivo de uma chamada HTTP

By | 30/08/2020

Olá pessoal! Hoje trago uma diga bem bacana para quem faz uso do power automate.

No Power Automate, podemos ter trigger a partir de uma chamada HTTP, isso ajuda muito quando queremos fazer APIs rapidamente. Você pode nessa chamada retornar um response se quiser em formato JSON, texto, xml. Mas se quisermos retornar um binário de um arquivo? Se analisar, não existe nenhuma action que realiza esse retorno. Porém olhando como o Power Automate se comporta para tratar arquivos, principalmente na parte do SharePoint, descobri que seguindo uma estrutura JSON você consegue retornar o binário.

Vamos para esse exemplo pegando uma imagem. Vamos pega o logo do power automate:

Power Automate Logo

Agora vamos transformar esse arquivo em base64. Para isso você pode utilizar código c#, javascript ou até mesmo sites que fazem a conversão online, e teremos o seguinte resultado:

iVBORw0KGgoAAAANSUhEUgAAAbgAAAEYCAMAAAAZCBNvAAAAsVBMVEX///8AZv8HZv8SZv+hof8iZv9XZv/k5P9aZv/X1/8MZv/d3f9+fv81Zv+5uf97e/8mZv/h4f9QZv+Njf8dZv/m5v/7+/+bm/+UlP/MzP/q6v9ra/9UZv9lZv8uZv/9/f/09P+8vP+zs/+Fhf9ubv9GZv+pqf9AZv87Zv/Cwv/w8P+lpf/t7f+AgP/R0f9MZv/4+P8YZv/z8/92dv/29v+Kiv9zc/9fZv/Hx/+trf+2tv8gxoBFAAAPfUlEQVR42uzLsQrCQAwG4CvqERFBcBAsUjuIOFQn+/6PptQrznYpwveRI0eSPwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/q7kvu1PkyDlHDO8txhoHZR/D79sil0gxRkofA4Ny+am6frbHxGTrLraLaha7R982iSk2+2s1p1XfJn53u1RzWxzOiRc7d9uUOAzEAXw3PBQoSA/BAtp6Ik9VrAo4At//g12bcp4yZ2i0JXXm/wNFebuTzWaTVNO0wQWwuiPQcs9vROnUxLvIYcxpCf4VCWO3fGr95utccOIcJYoGe8LSsxeQGcNmhRNbgtRclsSWzKn7LFV7BCnVZywNyKS7GUtTgpT6LI3ILN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wWVUCJ83BrAC2519gRhScA602713ZOyVJ6KFwLgK+vevI4gMmycH0AHVluHIioPQfYe/qTbxbLHj2J+3Bc5GsApooSA+zYplw7ANj+6mgFnTKLKS6Ck6JIDNC/C9cFArrmF9/QVJDQACxrRh5ONgDMB81F8u4TXDSVAYDYjx4LFw4AiK4yB44nAR/FcRtBU3LoYiPhwjgp/L+7oCfBT8/p3vAsCUhY28510DqAEaUOAqBFlFP3gYCUuO3Rxfnv4Rre/R//jFlxotCa40LYzuhTQ31IXG0qADD5eIbdqYaEOThTRhfLT6l683Ltx/wTMnVi4oJtlzu/eKtlIAD5F7zt9TRGKp4+z1epFUXy6e92lbWiKNVxj645kuJevVKp0BV9OVEUSZm817Jr6ssKhnfhFGmi07VeVZKWlNr4itQ/y0SbiTQr1lrpS26lQZzc2UvKqTXala8/KlI+2LvL62uUWipK9scqw1H1pNTPctJQqgyJUzuu1F+2KSXP9ooiSX1//DR7ypeXl5eXl5eXl5e/2IMDAQAAAAAg/9dGUFVVVVVVVVVVVVVVVVVVNgpGwSgYBaOANAAA/1hYUcCRni8AAAAASUVORK5CYII=

Agora que temos o base64 vamos criar um Flow no Power Automate. Vamos adicionar como disparo uma chamada HTTP do tipo GET:

Adicionamos uma action, para retornar o nosso arquivo.

Dentro do campo Body da action vamos montar o payload de retorno, seguindo este padrão o Power Automate entende que será um arquivo.

{
   //$content-type - MimeType do tipo do arquivo que deseja retornar
  "$content-type": "image/png",
  //$content - string base64 do arquivo
  "$content": "iVBORw0KGgoAAAANSUhEUgAAAbgAAAEYCAMAAAAZCBNvAAAAsVBMVEX///8AZv8HZv8SZv+hof8iZv9XZv/k5P9aZv/X1/8MZv/d3f9+fv81Zv+5uf97e/8mZv/h4f9QZv+Njf8dZv/m5v/7+/+bm/+UlP/MzP/q6v9ra/9UZv9lZv8uZv/9/f/09P+8vP+zs/+Fhf9ubv9GZv+pqf9AZv87Zv/Cwv/w8P+lpf/t7f+AgP/R0f9MZv/4+P8YZv/z8/92dv/29v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KUASabvw02BZzmP/DHcOYZQo5wqAvXsoQeXJjB4jQosZ2ylA2BLwPtj4TYAGjdn6JMdXQxZkYgaZhEuLlL4DLFarluANXokHA9cvtni/ni5Zzg+5az9X4SLBsBUpozPD3FcT8JA9uCnFRF31hpUSnwCVuORcFEVmFKppUHU883BzZ7ta0U4r5jysS0C+2I1CnB6eyScVoZTzTycVj7PAYSn3OTKcKUlilMyu2WBdSkzg9EBNvll9uSE7Y4SkQQoowfC9SywNZU+LWCWb1HWmG97yxhFuCYQhEUKrZWt5cjAxvRIOAOY7iihN5GHM4BtRKkjsH2Wa7efwg39pNyH3OupdQB9yqkaM+HZ6Qt9mF4xTmoMCF1H7104o+Xbd+EcgG2oFG2BvZ19wA2v62wWVUCJ83BrAC2519gRhScA602713ZOyVJ6KFwLgK+vevI4gMmycH0AHVluHIioPQfYe/qTbxbLHj2J+3Bc5GsApooSA+zYplw7ANj+6mgFnTKLKS6Ck6JIDNC/C9cFArrmF9/QVJDQACxrRh5ONgDMB81F8u4TXDSVAYDYjx4LFw4AiK4yB44nAR/FcRtBU3LoYiPhwjgp/L+7oCfBT8/p3vAsCUhY28510DqAEaUOAqBFlFP3gYCUuO3Rxfnv4Rre/R//jFlxotCa40LYzuhTQ31IXG0qADD5eIbdqYaEOThTRhfLT6l683Ltx/wTMnVi4oJtlzu/eKtlIAD5F7zt9TRGKp4+z1epFUXy6e92lbWiKNVxj645kuJevVKp0BV9OVEUSZm817Jr6ssKhnfhFGmi07VeVZKWlNr4itQ/y0SbiTQr1lrpS26lQZzc2UvKqTXala8/KlI+2LvL62uUWipK9scqw1H1pNTPctJQqgyJUzuu1F+2KSXP9ooiSX1//DR7ypeXl5eXl5eXl5e/2IMDAQAAAAAg/9dGUFVVVVVVVVVVVVVVVVVVNgpGwSgYBaOANAAA/1hYUcCRni8AAAAASUVORK5CYII="
}

$content-type: campo que o power automate entende como mime-type e converte o response com tipo informado.

$content: Conteúdo do arquivo em base64. O Power Automate automaticamente converte para bytes.

Agora salve o seu flow. Com a url gerada pelo Power Automate, coloque no browser e veja a sua imagem ser retornada diretamente.

Agora você já consegue retornar arquivos diretamente pelo seu flow. Espero que está dica ajude todos vocês. Até a próxima

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected by WP Anti Spam