Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confluence returned HTTP error 400 - BadRequest #175

Open
rjdlobik opened this issue Oct 7, 2019 · 2 comments · May be fixed by #185
Open

Confluence returned HTTP error 400 - BadRequest #175

rjdlobik opened this issue Oct 7, 2019 · 2 comments · May be fixed by #185

Comments

@rjdlobik
Copy link

rjdlobik commented Oct 7, 2019

Description

I'm also receiving a 400 bad request when attempting to retrieve a page by label. I've included the request and response below:

$response = Get-ConfluencePage -Label 'noarchive-single'

WARNING: Confluence returned HTTP error 400 - BadRequest
Invoke-Method : Could not parse cql : type=page AND label=noarchive-single
At C:\Program Files\WindowsPowerShell\Modules\ConfluencePS\2.5.0\ConfluencePS.psm1:772 char:17

            Invoke-Method @iwParameters
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidResult: ({"statusCode":4...:"Bad Request"}:String) [Invoke-Method], ArgumentException
FullyQualifiedErrorId : InvalidResponse.Status400,Invoke-Method

Steps To Reproduce

Run this from the command prompt. Any label with a "-" in it will not work.

Get-ConfluencePage -Label 'noarchive-single'

Expected behavior

Content to be returned from the web service.

PS H:\> Get-Module ConfluencePS -ListAvailable | Select Name, Version

Name         Version
----         -------
ConfluencePS 2.5.0

Possible Solution

@jakauppila
Copy link

Running into this as well; in searching I found a comment on an existing issue: https://jira.atlassian.com/browse/CONFSERVER-55559?focusedCommentId=1876652&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1876652

Basically it would appear you cannot query via CQL a label that has a dash '-' in it?

@paulkathro
Copy link

Workaround

Embed single quotes inside double quotes (or vice versa)

Get-ConfluencePage -Label "'noarchive-single'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants