You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Confluence] cql() attempt returning TypeError from get_endpoint() #1710
This one is on the calling side, not in cql(). ConfluenceV2.cql(self=ConfluenceV2, ...) calls the method on the class and passes the class itself as self. Inside, cql() does self.get_endpoint("search"). Because self is the class, that's an unbound call, so "search" is bound to self and nothing is left for endpoint_key. That's exactly the get_endpoint() missing 1 required positional argument: 'endpoint_key' you're seeing. Even if that call worked, there'd be no URL, session or credentials to send the request with.
Create a client first and call cql() on it:
fromatlassianimportConfluenceV2confluence=ConfluenceV2(
url="https://your-site.atlassian.net",
username="you@example.com",
password="<API token>",
)
response=confluence.cql(
'space = "mySpace" and type = page',
limit=25,
expand="content.body.storage",
)
forresultinresponse.get("results", []):
print(result["content"]["body"]["storage"]["value"])
Two other things to check:
Your snippet has expand = "content.body.stoage" (missing an "r"). Confluence won't expand the body with that spelling, so ["body"]["storage"] would then raise a KeyError.
ConfluenceV2.cql() came in with [Confluence] ConfluenceV2: add cql() #1696 and so far only exists on master. In 5.0.5 from PyPI, hasattr(ConfluenceV2, "cql") is False. Until the next release, install from git: pip install git+https://github.com/atlassian-api/atlassian-python-api.
I checked this against current master (785fc03) with the HTTP layer mocked via responses. Your exact call raises the same TypeError. The instance call sends GET https://your-site.atlassian.net/wiki/rest/api/search?cql=...&limit=25&expand=content.body.storage, and the loop prints the storage value from the mocked response.
Not a setup problem, it's the call line. Your snippet still calls the method on the class:
response=ConfluenceV2.cql(self=ConfluenceV2, ...)
That ignores the confluence object you created, so it fails with the same TypeError no matter how the client is configured. Call it on your instance instead, and drop the self= argument:
response=confluence.cql(
'space = "mySpace" and type = page',
limit=25,
expand="content.body.storage",
)
On the release question: cql() is not in 5.0.5 from PyPI. There, ConfluenceV2.cql(...) gives AttributeError: type object 'ConfluenceCloud' has no attribute 'cql'. Since you get the TypeError instead, you are probably already on a master install. Note that a master install also reports version 5.0.5, so the version number won't tell you which one you have. If in doubt:
I checked both versions just now. On 5.0.5 the class call gives the AttributeError. On master the class call gives your TypeError, and confluence.cql(...) sends GET /wiki/rest/api/search?cql=...&limit=25&expand=content.body.storage (HTTP mocked).
Activity
hamarshehmhmd commentedon Oct 28, 2026
This one is on the calling side, not in
cql().ConfluenceV2.cql(self=ConfluenceV2, ...)calls the method on the class and passes the class itself asself. Inside,cql()doesself.get_endpoint("search"). Becauseselfis the class, that's an unbound call, so"search"is bound toselfand nothing is left forendpoint_key. That's exactly theget_endpoint() missing 1 required positional argument: 'endpoint_key'you're seeing. Even if that call worked, there'd be no URL, session or credentials to send the request with.Create a client first and call
cql()on it:Two other things to check:
expand = "content.body.stoage"(missing an "r"). Confluence won't expand the body with that spelling, so["body"]["storage"]would then raise aKeyError.ConfluenceV2.cql()came in with [Confluence] ConfluenceV2: add cql() #1696 and so far only exists onmaster. In 5.0.5 from PyPI,hasattr(ConfluenceV2, "cql")isFalse. Until the next release, install from git:pip install git+https://github.com/atlassian-api/atlassian-python-api.I checked this against current master (785fc03) with the HTTP layer mocked via
responses. Your exact call raises the sameTypeError. The instance call sendsGET https://your-site.atlassian.net/wiki/rest/api/search?cql=...&limit=25&expand=content.body.storage, and the loop prints the storage value from the mocked response.fiddlefig commentedon Oct 28, 2026
@hamarshehmhmd
i just didnt include it in my original comment.
Does this mean it was my own user error ? still getting the same issue after fixing the typo.
hamarshehmhmd commentedon Oct 28, 2026
Not a setup problem, it's the call line. Your snippet still calls the method on the class:
That ignores the
confluenceobject you created, so it fails with the sameTypeErrorno matter how the client is configured. Call it on your instance instead, and drop theself=argument:On the release question:
cql()is not in 5.0.5 from PyPI. There,ConfluenceV2.cql(...)givesAttributeError: type object 'ConfluenceCloud' has no attribute 'cql'. Since you get theTypeErrorinstead, you are probably already on a master install. Note that a master install also reports version 5.0.5, so the version number won't tell you which one you have. If in doubt:I checked both versions just now. On 5.0.5 the class call gives the AttributeError. On master the class call gives your
TypeError, andconfluence.cql(...)sendsGET /wiki/rest/api/search?cql=...&limit=25&expand=content.body.storage(HTTP mocked).fiddlefig commentedon Oct 28, 2026
@hamarshehmhmd
yes i said i was on the master.
this is the error i receive after removing the self argument.
exact code i have:
hamarshehmhmd commentedon Oct 29, 2026
cql()is an instance method, so call it on the object you created rather than on the class:ConfluenceV2.cql(...)passes your arguments in place ofself, which is why it fails.