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
Anonymous
Not applicable

Connect GitHub using API error

Hi!

 

Need to connect GitHub to Power BI using the API. As Power BI connector doesn't give a lot of information, specifically pull requests reviewers. And I'm wondering if it's or Power BI, or I have not enough rights, or something else?

 

I'm receiving error:

 

Web.Contents failed to get contents from 'https://api.github.com/repos/owner/repo/pulls?state=all' (404): Not Found

 

My source code:

let
Source = Web.Contents("https://api.github.com/repos/owner/repo/pulls?state=all", [ApiKeyName="xxxxxxxx"])
in
Source

 

Many thanks in advance!

5 REPLIES 5
lbendlin
Super User
Super User

This seems to work. Did you specify the owner and repo names?

 

let
    Source = Json.Document(Web.Contents("https://api.github.com/repos/migueesc123/PowerBIRESTAPI/pulls?state=all")),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"url", "id", "node_id", "html_url", "diff_url", "patch_url", "issue_url", "number", "state", "locked", "title", "user", "body", "created_at", "updated_at", "closed_at", "merged_at", "merge_commit_sha", "assignee", "assignees", "requested_reviewers", "requested_teams", "labels", "milestone", "draft", "commits_url", "review_comments_url", "review_comment_url", "comments_url", "statuses_url", "head", "base", "_links", "author_association", "auto_merge", "active_lock_reason"}, {"url", "id", "node_id", "html_url", "diff_url", "patch_url", "issue_url", "number", "state", "locked", "title", "user", "body", "created_at", "updated_at", "closed_at", "merged_at", "merge_commit_sha", "assignee", "assignees", "requested_reviewers", "requested_teams", "labels", "milestone", "draft", "commits_url", "review_comments_url", "review_comment_url", "comments_url", "statuses_url", "head", "base", "_links", "author_association", "auto_merge", "active_lock_reason"})
in
    #"Expanded Column1"
Anonymous
Not applicable

Yes, of course, I specified owner and repo.

Can it be caused because of the fact that my owner is organization and repository is private? Maybe there are some other attributes needed to connect to such type of repository?

Could be.  Most likely anonymous auth wouldn't work in that case. Delete your global permissions and try a different auth method.

Anonymous
Not applicable

I was using Web API key method, and as you can see I'm specifying API Key in connection string. 

Did you go through all these steps?

Basics of authentication - GitHub Docs

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.