It's all about the answers!

Ask a question

While creating categoryType using Rest API - I am getting 403 Error.


ast java (4512048) | asked Apr 12 '16, 2:36 a.m.
Using RestClient i am trying to create a category type with POST method

url:
https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Thiru_Playground+%28Quality+Management%29/categoryType/
urn:com.ibm.rqm:categoryType

Headers:

Accept: application/rdf+xml

OSLC-Core-Version: 2.0

X-Jazz-CSRF-Prevent: 00002mT2kZHJgS67Jd5U-2PPFkU:-1

Content-Type: application/rdf+xml

In the Body i'm putting the response i got from using the below url

https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Thiru_Playground+%28Quality+Management%29/categoryType

and performed POST operation i am getting 403 error. i may be wrong in sending the xml body for the POST operation. i could not generate slug id as well.

Kindly help me to get the xml body for POST method. Or in case if i am following wrong steps please guide me to create a category type in RQM using Rest API

Comments
Donald Nong commented Apr 12 '16, 3:31 a.m.

What's the detailed message in the response body? It should give you a clue what's going on.


ast java commented Apr 12 '16, 5:37 a.m.

It says Permission Denied -  403 Forbidden error


ast java commented Apr 12 '16, 8:30 a.m.

i can update a category value and category so same permissions are required for creation as well if i am not wrong.
i need to know what needs to be given in request body for performing POST method to get slug id.


ast java commented Apr 12 '16, 8:31 a.m.

i can update a category value and category so same permissions are required for creation as well if i am not wrong.
i need to know what needs to be given in request body for performing POST method to get slug id.


ast java commented Apr 13 '16, 2:00 a.m.

Slug id i cannot create using the xml representation of response from category. Whether i am trying a wrong xml?

2 answers



permanent link
Simone Ravanini (262) | answered Apr 12 '16, 8:39 a.m.
Hello Ast Java

You should check your permissions to this project area.
1 - Open your project
2 - Go to Administration
3 - Manage This Project Area
4 - Permissions.

Also make you sure you are a member of the project area in.

1 - Go to Administration
2 - Manage Project Area
3 - Members

Let me know if any of this helped.

Comments
ast java commented Apr 12 '16, 11:57 p.m.

Yes Simone i have the permission and also i am member of that project area.
i can perform update using PUT Method in RestClient using Rest API and i can delete a category too but create not.


permanent link
Donald Nong (14.5k614) | answered Apr 14 '16, 1:45 a.m.
The "urn:com.ibm.rqm:categoryType" bit in the URL looks off. When you POST, you are trying to create a new entity which does not have an Id yet, so you cannot specify an Id. You should just POST to /categoryType. If you still have issues, you should show us the details of the request, including URL, headers and body.

Comments
ast java commented Apr 15 '16, 5:55 a.m.

URL :https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Playground+%28Quality+Management%29/category

I used GET Method and got a response



ast java commented Apr 15 '16, 6:05 a.m.

Headers:
X-Jazz-CSRF-Prevent - 0000f3-2rBvym1_iEWvJF6CWDHA:38b80db6-47d5-4c8d-9ac8-ec8b9dd4f7fd
Content-Type - application/xml
Accept - application/xml

Body : Response from the URL : https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Playground+%28Quality+Management%29/category
 
Slug id cannot be created. 403 forbidden error


1
Donald Nong commented Apr 17 '16, 8:37 p.m.

Sounds like you have the incorrect request body. The request body should consist of a single category, not a list of categories.


ast java commented Apr 18 '16, 6:07 a.m.

Thank you so much Donald. I changed the request body to single category then it worked.

Your answer


Register or to post 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.