Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
adarshmadrecha
Regular Visitor

Passing Cookie using Web.Contents in PowerBI Desktop

I have API which authenticates user based on Cookies (PHP Sessions)

 

I am using below code to pass cookies

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID:123abc"]]))

But the above code does not work.

Can you please help in finding out what I am doing wrong?

1 ACCEPTED SOLUTION
adarshmadrecha
Regular Visitor

I understood waht the issue was.

Instead of using : I sould use = to scecify cokie name and value.

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

View solution in original post

3 REPLIES 3
adarshmadrecha
Regular Visitor

I understood waht the issue was.

Instead of using : I sould use = to scecify cokie name and value.

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

Good morning. How did you manage to get the cookie from power bi? I am currently making a request to obtain the cookie, said cookie comes in the headers of the server response.

Thank you !

v-chuncz-msft
Community Support
Community Support

@adarshmadrecha,

 

You may take a look at link below.

http://www.excelandpowerbi.com/?p=58

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.