Forum Discussion
Anonymous
4 years agoNot applicable
Dataflows asks for credentials for each URL
I am trying to implement a API call as a function in a dataflow. The issue is that the URL is created based on different IDs in a column and for each new ID the data flow asks for credentials. Why ca...
- Anonymous4 years ago
I did actually solve it after I knew what to search for.
This is the M-code that did require a authentication validation for each combination in the url (I wanted anonymous):varApiName = "salesOrders?$expand=salesOrderLines",varApiUrl = "https://api.businesscentral.dynamics.com/v2.0/" & TenantName & "/" & Instance & "/api/v2.0/companies(" & Company & ")/" & varApiName ,varOptions = [Headers=[ApiKeyName= TokenName , #"Authorization"="Bearer " & List.First(GetToken), #"DataAccessIntent" = "ReadOnly" ]],apidata = Json.Document(Web.Contents(varApiUrl , varOptions)),and this is the solution that prevented it:
varApiName = "salesOrders?$expand=salesOrderLines",varApiUrl = "https://api.businesscentral.dynamics.com/v2.0/" & TenantName & "/" & Instance & "/api/v2.0/companies(" & Company & ")/",varOptions = [RelativePath=varApiName, Headers=[ApiKeyName= TokenName , #"Authorization"="Bearer " & List.First(GetToken), #"DataAccessIntent" = "ReadOnly" ]],apidata = Json.Document(Web.Contents(varApiUrl , varOptions)),The changes are in bold.
mahoneypat
4 years agoMicrosoft Employee
In your Data Source Settings, you should have a pull down to choose the root url instead of each detailed one.
Pat
Anonymous
4 years agoNot applicable
In dataflow there is no option:
It is in Swedish but I guess you get the idea.