Getting Data from Workplace Graph API

Scenario: I’m looking to get data from the Workplace Graph API. Workplace is owned by Meta and the API allows for a subset of functionality of the Graph API from Facebook.

I’ve used the " Accessing Data via APIs in Power BI" course to get some data already via PQ advanced editor but I’m currently stuck at Pagination.

Here’s the paginated results link from the documentation

Problem: I’m still very new to PQ advanced editor and M code so I’m not sure how to code the pagination using the documentation provided. For example, the maximum number of results we get back for members is 25 if I remove the limit.

Current Code:

let
#“BaseURL” = “https://graph.facebook.com/community/”,
#“limit” = 5,

Source = Json.Document(
Web.Contents(
#“BaseURL”,
[
RelativePath = “members”,
Query =
[
limit = Text.From(#‘limit’),
],
Headers=[
#“Authorization” = "Bearer " & #“Header”,
#“content-type” = “application/json”
]

        ]
        )
)

in
Source

1 Like

Hi @Melissa - Please help here.

Hi @nodeautomate,

Welcome to the Forum!

Have a look here:

I hope this is helpful

2 Likes

Hello @nodeautomate

Did the responses above help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION

Thank you

Thank you @Melissa!

1 Like