Good afternoon everyone!
I have a query in Power BI, where I have a column with "PedidoId".
I have a function that creates a URL using the "PedidoId" column.
When this function is called, the data loads normally locally. However, when I try to update the credentials in the Power BI webservice, I get the following error below. Please note that this API endpoint requires me to pass the "PedidoId" number. Can someone help me? I've tried a lot of things.
let
get_pedido_atendido = (pedidoId as number) =>
let
baseUrl = "https://api.sienge.com.br/domainexemplo/public/api/v1/purchase-invoices/deliveries-attended?purchaseOrderId=",
response = Web.Contents(
baseUrl,
[
RelativePath = "",
Query = [purchaseOrderId = Number.ToText(pedidoId)]
]
),
json = Json.Document(response)
in
json
in get_pedido_atendido
Segue erro:
Falha ao atualizar as credenciais da fonte de dados: Web.Contents failed to get contents from 'https://api.sienge.com.br/domainexemplo/public/api/v1/purchase-invoices/deliveries-attended?purchaseOrderId=' (400): Bad RequestOcultar detalhes
Código de status: 400 Hora: Wed May 28 2025 14:27:40 GMT-0300 (Horário Padrão de Brasília)