Forum Discussion

icassiem's avatar
icassiem
Icon for Post Prodigy rankPost Prodigy
2 years ago

PowerQuery version of Javascript function "KJUR.jws.JWS.sign" for REST API certificate sign

Good day,

 

i have been battling to simulate the postman execution that imports the javascript library 

https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js

KJUR.jws.JWS.sign. i even took the function from the library within a web.page but powerquery not executing

 

After so many attempts to add the javascript function in Web.Page but the json and function just do not execute. Now I am back in retrying the exercise connecting to Netsuite rest api signed certificate from powerquery.

 

The "alg":"PS256","typ":"JWT","kid":".." algorithm

 

Please Any help

2 Replies

  • icassiem 

    Web.Contents is the appropriate power query function for APIs. It supports relative path, Headers and body parameters using which you can send your payload. I would suggest you to go through this page:

    https://learn.microsoft.com/en-us/powerquery-m/web-contents



    If the post helps please give a thumbs up


    If it solves your issue, please accept it as the solution to help the other members find it more quickly.


    Tharun

     

    • icassiem's avatar
      icassiem
      Icon for Post Prodigy rankPost Prodigy

      Hi 

      Thank you for assisting tharunkumarRTK 

       

      The issue is more that netsuite use that Javascript function and algorithm to sign the certificate for generating an assertion key

      KJUR.jws.JWS.sign('PS256'

       

      Any thoughts please, my senior wants to cancel the project due to this?

       

      Regards