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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
pelucapampa
Helper I
Helper I

Passing Variables in API Post Request JSON Body

Hi all, I've a Public API, i defined all of Headers parameters

HEADERS

X-PW-AccessToken <your_api_token>
X-PW-Application developer_api
X-PW-UserEmail <your_email_address>
Content-Type application/json
 
But the next requierement from de API it's include a BODY parameters
BODY

{
  "page_size": 25,
  "sort_by": "name"
  
}

It's possible to include that?? 

2 REPLIES 2
pelucapampa
Helper I
Helper I

I've put this code and obtain data, but only 20 rows, have any IDEA??

 

let

url = "https://api.prosperworks.com/developer_api/v1/opportunities/search",

body = "#(lf)[#(lf){#(lf)""page_size"": 2000,#(lf)}#(lf)]#(lf)",
Source = Json.Document(Web.Contents(url, [Headers=[#"X-PW-AccessToken"="7d9b078105a2dcf7ebde2bd103b2d721", #"X-PW-UserEmail"="[email protected]", #"Content-Type"="application/xml", #"X-PW-Application"="developer_api"], Content=Json.FromValue(body)]))
in
Source
Anonymous
Not applicable

@pelucapampa,

It seems your API only gives you 20 rows by default, you can call the API  to fetch all pages using Power Query code. For more details, please review the following similar threads.

https://community.powerbi.com/t5/Desktop/how-to-create-a-query-that-paginates/m-p/163768/highlight/f...
https://community.powerbi.com/t5/Desktop/Rest-API-Json-several-pages-automatically-call-the-next-pag...

Regards,
Lydia

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.