How can I embed an existing draw.io diagram into Confluence from Github?

Tone July 7, 2022

I bring up the macro, select Github and enter what I would think are obvious values, but it continually tells me diagram cannot be found or cannot be accessed. I cannot find any relevant documentation from the app publisher on this. Has anyone else been able to get this working, and if so, what did you do?

Screenshot 2022-07-07 154759.png

 

 

2 answers

1 vote
Marija Radovic
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2022

Hi, 

Not sure what you typed into other fields, but take a look at the example I tested (which is working) and you'll probably know how to change inputs.

I took "link" diagram as an example from our GitHub https://github.com/jgraph/drawio-diagrams and filled the fields:

github.JPG

I assume filename you added wasn't correct but our label is not clear enough (we'll change that). Filename should include the path. 

Does this help?

Marija

Tim Glenn October 24, 2022

Hi. I am getting a 404 on the github api. I am using an organization with private repository. Is there something else I need to setup? I am able to see your test example. But it cannot locate my github repository.

Marija Radovic
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 25, 2022

Hi Tim,

You also submitted your questions to our JSD and we replied there.

Kind regards,

Tim Glenn October 25, 2022

Thanks. I got the connection to work. But requires each user that goes to a confluence page to authenticate with Github. I was told in a future version this experience will change for private repos. Not sure how that will work, but excited to see that I don't need to have my users all have a github account.

Jonathan Sayce November 9, 2022

Hi Marija, I'm having the same issue as Tim.

I've authorised GitHub, and I'm trying to use a diagram from a private repo. The URL for the diagram in GitHub is https://github.com/jsayce/draw.io/blob/main/GcobLegacyCloud, so I've entered the following values:

image.png

The request to https://api.github.com/repos/jsayce/draw.io/contents/GcobLegacyCloud?ref=main&t=### gives a 404.

Am I doing something wrong?

Thanks,

Jon.

Tim Glenn November 9, 2022

Jon, 

 

Have you tried putting  blob/GcobLegacyCloud 

in the path field? 

Jonathan Sayce November 9, 2022

Hi Tim,

Thanks - just tried that - the request is now 

ppaulweber December 9, 2022

Hi Tim,

I've the same problem. Looks like they changed the token handling in the GitHub REST API[1], because it's now part of the HTTP Header and the plugin is passing the token in form of a query parameter as `&t=...` which is not part of the latest API any more :-/ 

[1] https://docs.github.com/rest/reference/repos#get-repository-content

Best,
Philipp

Rob Garner December 20, 2022

Hi Tim and Marija

Can we see this response from JSD?

I'm having the same issue as described above. Works as expected if the repo is public, but not private.

Is there a plan to fix the issue?

I really had high hopes for this plugin.

Eli Shalnev November 2, 2023

We also have this issue, it's been a year ++ since first reported, is there a fix available? :pray:

TIA

Like ppaulweber likes this
Marija Radovic
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2023

Hi,

Are you trying to embed from private repo? Did you authorize it? 

Please note the “Path Filename” should include the full path of the file unless the file is in the root directory.


If possible add the print screen showing all inputs. 

Thanks,

Marija

0 votes
Eli Shalnev November 3, 2023

Thank you Marija! 

Yes i'm using private repo and i have confluence app authorized.
Also attached the screens you asked, i double checked all input fields and theres no typo there (just in case).

If reading through => https://docs.github.com/en/rest/overview/authenticating-to-the-rest-api?apiVersion=2022-11-28

If you try to use a REST API endpoint without a token or with a token that has insufficient permissions, you will receive a 404 Not Found or 403 Forbidden response.

It seems that @ppaulweber is right, and the issue is related to deprecated auth method against GH api (wich is required for private repos).

drawio_confluence_gh.jpgdrawio_confluence_gh_response.jpgAuthorized_GitHub_Apps.jpg

ppaulweber November 3, 2023

@Eli Shalnev @Marija Radovic I could provide a fix for this plugin if you can point me to the open source repository so that I can have a closer look at this outdated REST API integration.

Eli Shalnev November 5, 2023

I believe its somewhere along those lines at
https://github.com/jgraph/drawio-github/blob/master/nanocms.js

Theres also an open issue at main repo
https://github.com/jgraph/drawio/issues/3443

Mohamed Mohamedin November 7, 2023

@Eli Shalnev I've just tested it and it works for me

Also, we are using the latest Github auth method. If you check the 404 failed request headers, you'll see Authorization header and the token there.

Many times it's the path of the file that is incorrect

Is your diagram in [drawio-diagrams REPO_ROOT]/charts/test.drawio in main branch?

Thanks

Like Mike Rink - draw_io likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events