Getting 400 Unauthorized error while creating baseline on GC stream using Rest/OSLC APIs
Hi Team,
We are using IBM tool chain with version 7.0.2.
We are trying to create baseline using POST method on GC streams with following details:
1. Method: POST
2. URL: https://<Server_name>/gc/api/createBaseline
3. Body:"@prefix oslc_config_ext: <http://jazz.net/ns/config_ext#>
<https://<Server_name>/gc/api/createBaseline>
oslc_config_ext:titleTemplate "{0} Example baseline (2023-05-31)" ;
oslc_config_ext:rootConfiguration <https://<Server_name>/gc/configuration/12>"
4.Content-Type:text/turtle
Using this we are getting below error:
400 unautherised
After giving credentials also it is not able to create
Anyone please help me
Thanks
|
Accepted answer
Ian Barnard (1.9k●6●13)
| answered Jun 01 '23, 4:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jun 01 '23, 4:07 a.m. You're missing a space and a dot (period) on the end of your prefix line - without that I get a 500 error. If you get a 403 error read the response content and add the header it tells you to.
With it I get the expected 200 response and the Location header in the response gives the tracker; the baseline is created. I have to change the titleTemplate to create another new baseline because it quite reasonably won't let you create a baseline with an already-existing title.
Not sure how you get a 400 error; perhaps basic auth isn't working.
KT PD selected this answer as the correct answer
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
What authentication are you using? All POSTs do require authentication with the server.
I am using basic auth method
Have you confirmed that the user id you are passing in the POST has permission to create baselines in the project area you are executing against?
Yes that userid is having all configuration related permissions including creating baselines
Hi,