Comments (9)
Can you elaborate on what Confluence is returning? HTTP 200 OK
is an expected HTTP status code. Is there no response body? If there is a body, what does it contain? (From the error message, it looks like it's not JSON.)
from md2conf.
I'm not very familiar with python and confluence API, but I've just inserted "print(response)" in api.py before line 188 and I got string "<Response [200]>".
from md2conf.
When you do a print(response)
, Python would print the string representation of the object held in the variable response
as defined by the object type. Developers of the Requests library have likely opted to do a compact representation that prints the status code, and nothing else. What would be interesting to know is what the actual response payload is. Normally, this should be a JSON string, which is de-serialized automatically into a Python object when calling response.json()
. Since the function call to response.json()
is triggering an error, you would need to call print
on response.text
, which could produce the response body as-is, revealing what Confluence is returning.
from md2conf.
Thanks for info.
I've checked it and found that response.text contains HTML, indicating that my user doesn't have access to the page. However, this page is in my own user space and doesn't have any restrictions. Additionally, I've tried creating a simple custom script using the atlassian-python-api module, and it works with the same initial data (token, space key, page id).
from md2conf.
Looking at the implementation of the class AtlassianRestAPI
in the library atlassian-python-api, it looks way more complex than the basic authentication scheme available in md2conf. I would need to understand which exact authentication path is taken in AtlassianRestAPI
such that it could be reproduced in the corresponding API wrapper in md2conf. For example, I could include requests-oauthlib in md2conf but we would need to identify first if this is indeed what is lacking in your case.
from md2conf.
I've used authentication with a personal access token in the following way:
confluence = Confluence(url=confluence_url, token=api_token)
It seems that it simply adds an "Authorization" header with the value "Bearer {token}".format(token=token)
.
from md2conf.
If you don't pass a user name, md2conf will also call
session.headers.update({"Authorization": f"Bearer {self.api_key}"})
Perhaps you have a stray setting that assigns the environment variable CONFLUENCE_USER_NAME
and thus invokes the HTTP basic authentication path in md2conf as opposed to the desired HTTP bearer authentication path (as in AtlassianRestAPI
).
from md2conf.
I was digging deep into debugging when I realised that I had missed the default value of the wiki PATH parameter. I feel so silly. Really sorry for your time. I've just added -p /
to parameters and it works now.
from md2conf.
That's great news! Don't worry; the important point is that you got it working in the end.
from md2conf.
Related Issues (20)
- Enable URL auto-linking HOT 3
- Setting the Confluence space doesn't work HOT 3
- Make sub-items/nested lists work HOT 1
- Is it possible to create under a certain page instead of the root space? HOT 1
- Conversion is not working properly HOT 11
- Fail to update page with attached image. It tries to upload it again HOT 1
- Support "Info Panel" (incl. all other derivates) in text HOT 2
- "unable to find matching page for URL: {url}" HOT 2
- Links from ./foo/bar.md to ../baz/foo-bar.md issues HOT 4
- Relative links to gitlab files HOT 4
- only convert, do not publish? HOT 3
- warning and notes appear to render incorrectly HOT 2
- Is there any way to export a subfolder as a file? HOT 4
- Ignore parts of the markdown HOT 2
- md2conf for cloud hosted Confluence HOT 1
- Markdown validator HOT 8
- Pictures in a subfolder don't show HOT 2
- Invalid href with local url HOT 1
- Improve internal links (=header anchors) handling HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from md2conf.