Hi everyone,
I am trying to get confluence page response using rest API in below format, but getting like 401 unauthorised. I can access in gui without any issues. I can see in few posts like basic authentication is deprecated. I don't have option to generate oauth. Is there any way that I can overcome this issue?
Curl -k -x get https:// url -u id: password
curl -k -u 'username:password's -X GET https://url
Does your password have special characters?
Encode with HTML parameters
https://www.w3schools.com/tags/ref_urlencode.asp
If your instance is not secured with HTTPS go with http://url
Ensure username is not Email ID and it is username you use for login and password is the one you use for login
Can you attach the screenshots of the error you are getting?
Let me know
Thanks
Hi pramod,
version_temp=${response##*'number":'}
version=${version_temp%%%%','*}
version=$((version+1)) #increment version
response=$(curl -X PUT ${confluenceurl} \
-H 'Content-type: application/json' -k \
-u "${confluence_user}":"${confluence_password}" \
-d '{
"id": page id,
"type": "page",
"title": "page title",
"space": {"key": "Myspace"},
"body": {
"storage": {
"value": ","${content}",",
"representation": "storage"
}
}')
Please let me know if I am making some mistake.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can find content= $(awk -F etc at the end of message, as it is not allowing to post html content. Is there anyway that I can make changes to code if it is wrong format?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dastagiri
Please find the example for updating a page
https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/#update-a-page
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.