Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm having an issue utilising an API call
The API requires a Token for each request.
I am able to generate the token via this:
() => let url = "http://iserver.x.x:8081/api/token", defaultOptions = [ Content = Text.ToBinary(""), Headers = [ #"Accept" = "application/json", #"Content-Type"="application/json;charset=UTF-8", #"Authorization"= Text.Combine({"Basic ", Binary.ToText(Text.ToBinary("username:password"),0)}) ] ], Token = Json.Document(Web.Contents(url, defaultOptions)) in Token
I've used a function so that it can be used in multiple API calls for different data, the first of these is:
let GetToken = Function.Invoke(iServerGetToken(),null) as text, Source = Json.Document(Web.Contents("http://iserver.x.x:8081/api/item?$filter=Type%20eq%20'Business%20actor'&$expand=Attributes(%24select%3DOwner)", [Headers=[Authorization="Bearer "&GetToken]])), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"iServerId", "Name", "Type", "Library", "Description", "ApprovalStatus", "CheckedOutBy", "IsLocked", "VersionNumber", "CreatedBy", "DateCreated", "ModifiedBy", "DateModified"}, {"Column1.iServerId", "Column1.Name", "Column1.Type", "Column1.Library", "Column1.Description", "Column1.ApprovalStatus", "Column1.CheckedOutBy", "Column1.IsLocked", "Column1.VersionNumber", "Column1.CreatedBy", "Column1.DateCreated", "Column1.ModifiedBy", "Column1.DateModified"}) in #"Expanded Column1"
I am getting the following error from the bolded line.
Expression.Error: We cannot convert the value "OMciXKG3iGWA4CzxI4rP..." to type Function. Details: Value=OMciXKG3iGWA4CzxI4rPgYKAQLxHKLNebFdCSFrdIAGltUa94MevrQT03ZjW6mWP Type=Type
I've done a good deal of searching but can't seem to find a solution.
I'm not sure this is the most appropriate way of going about things either.
Any help would be much appreciated.
Thanks
Solved! Go to Solution.
Hi @SeanSmithy
Please check if below posts could help.
https://community.powerbi.com/t5/Desktop/Create-tables-based-on-all-Query-Parameters/td-p/345947
Regards,
Hi @SeanSmithy
Please check if below posts could help.
https://community.powerbi.com/t5/Desktop/Create-tables-based-on-all-Query-Parameters/td-p/345947
Regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |