Forum Discussion

Spigaw's avatar
Spigaw
Icon for Helper III rankHelper III
1 year ago
Solved

Using Cornerstone/CSOD APIs with cURL in Power Query

Hello everyone,

 

My company is using Cornerstone as an HRIS tool. We were able to access the Reporting API, but not the other ones (for example Learning Search, Session Roster).

 

We want to use their APIs through Power Query, but we did not find a way to implement their cURL syntax, even with the help of IT.


If someone is able to help, here are the URL provided by CSOD:

- API reference

- Usage of cURL

 

Thanks in advance for any help.

  • Hi Spigaw,

    Thank you for reaching out to the Microsoft Fabric Forum community.

     

    Since Power Query does not directly support cURL, you will need to convert the cURL request into Power Query’s Web.Contents function to interact with Cornerstone’s APIs. 

    • To convert a cURL request into Power Query, identify its key components: the URL (API endpoint), headers (e.g., Authorization: Bearer YOUR_ACCESS_TOKEN for authentication), the HTTP method (GET or POST), and, for POST requests, the request body. These elements are essential for structuring the request in Power Query using Web.Contents(). 
    • Use Web.Contents() to call the API, ensuring all required parameters are included. Set the necessary headers, such as Authorization for authentication and Content-Type for the request format. Ensure OAuth tokens or other credentials are correctly handled and passed in the request for successful authentication. 
    • In Power BI or Excel, open the Power Query Editor and create a new query using Web.Contents(). Execute the request, review the response, and address any errors related to authentication, headers, or request formatting to ensure successful API integration. 

    Please refer to the similar threads listed below for your reference: 

    Solved: Convert cURL POST request to M - Microsoft Fabric Community 

    Solved: Assistance with converting CURL request into Power... - Microsoft Fabric Community 

     

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

     

    Thank you. 

4 Replies

  • v-saisrao-msft's avatar
    v-saisrao-msft
    Icon for Community Support rankCommunity Support

    Hi Spigaw,

    Thank you for reaching out to the Microsoft Fabric Forum community.

     

    Since Power Query does not directly support cURL, you will need to convert the cURL request into Power Query’s Web.Contents function to interact with Cornerstone’s APIs. 

    • To convert a cURL request into Power Query, identify its key components: the URL (API endpoint), headers (e.g., Authorization: Bearer YOUR_ACCESS_TOKEN for authentication), the HTTP method (GET or POST), and, for POST requests, the request body. These elements are essential for structuring the request in Power Query using Web.Contents(). 
    • Use Web.Contents() to call the API, ensuring all required parameters are included. Set the necessary headers, such as Authorization for authentication and Content-Type for the request format. Ensure OAuth tokens or other credentials are correctly handled and passed in the request for successful authentication. 
    • In Power BI or Excel, open the Power Query Editor and create a new query using Web.Contents(). Execute the request, review the response, and address any errors related to authentication, headers, or request formatting to ensure successful API integration. 

    Please refer to the similar threads listed below for your reference: 

    Solved: Convert cURL POST request to M - Microsoft Fabric Community 

    Solved: Assistance with converting CURL request into Power... - Microsoft Fabric Community 

     

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

     

    Thank you. 

    • v-saisrao-msft's avatar
      v-saisrao-msft
      Icon for Community Support rankCommunity Support

      Hi Spigaw,

       

      We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

       

      Thank you.

  • v-saisrao-msft's avatar
    v-saisrao-msft
    Icon for Community Support rankCommunity Support

    Hi Spigaw,


    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


    Thank you.

  • v-saisrao-msft's avatar
    v-saisrao-msft
    Icon for Community Support rankCommunity Support

    Hi Spigaw,

     

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

     

    Thank you.