How to request a list of artifacts in a project using Python REST API?
I am trying to access requirements using a Python API, and am having trouble with this query. Using the services query I got the baseURLs for requirement and folder queryCapability, and I've had success using the Folder Query Capability to browse folders and subfolders. However when I try the following request using the requirement queryCapability baseURL, I get a 403:Forbidden response.
self.headers = {'Content-type': 'application/x-www-form-urlencoded', 'OSLC-Core-Version': '2.0', 'Accept': 'application/rdf+xml'}
resp = requests.get('https://ServerName/rm/views?oslc.query=true&projectURL=https%3A%2F%2FServerName%2Frm%2Fprocess%2Fproject-areas%2F_1ipDAGUlEemksZVbt6XKiw',cookies=jar,verify=False,headers=self.headers)
Thank you in advance
One answer
403 indicates the authenticated user likely doesn't have privileges to do the operation. Did you try the request with Postman?
But the queryCapability service provides a queryBase URL that can be used with GET to do OSLC queries. I'm not sure what the GET that failed with 403 is trying to do, it doesn't contain an OSLC query.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 03 '20, 8:21 a.m.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 03 '20, 8:43 a.m.Allison Schwoboda
Dec 03 '20, 5:30 p.m.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 12 '21, 8:47 a.m.