Forum Discussion

pr92's avatar
pr92
Frequent Visitor
1 year ago
Solved

Call API as data source with parameter hash in MD5

Hello,   I have a GET API that I want to call to get my data.   In Power query, I have to send dynamic values in my GET URL :  First variable : current timestamp, in the following format  YYYY-...
  • vojtechsima's avatar
    1 year ago

    Hello, pr92 ,
    I am not aware of native way, however, here's workaround using public API to hash it:
    here's M code, you can turn it into function:

     

    let
        valueToHash = "hello",
        md5 = Web.Contents("api.hashify.net", [RelativePath="/hash/md5/hex?value="&valueToHash]),
        openJson = Json.Document(md5)[Digest]
    in
        openJson


    edit:
    I am gonna give you the function also here:

    let
        hastToMD5 = (valueToHash as text)=>
        let
            md5 = Web.Contents("api.hashify.net", [RelativePath="/hash/md5/hex?value="&valueToHash]),
            openJson = Json.Document(md5)[Digest]
        in
            openJson
    in
        hastToMD5

    and then you call it like this: