getting 403 when calling nodes/.../targets API

cancel
Showing results for 
Search instead for 
Did you mean: 
Member II

getting 403 when calling nodes/.../targets API

I am getting 403 when I used api nodes/.../sources and nodes/.../targets.  I have no problem calling other apis such as nodes/.../children and nodes/.../secondary-children

How should i get around it?

"error": {"errorKey": "framework.exception.ApiDefault","statusCode": 403,"briefSummary": "04252009 Access Denied. You do not have the appropriate permissions to perform this operation.","stackTrace": "For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL": "https://api-explorer.alfresco.com"}

5 Replies
Master

Re: getting 403 when calling nodes/.../targets API

Well - the message appears to tell you everything you should need. Whatever node you tried to run the operations on, it appears that the user that was authenticated does not have the necessary permissions to perform the changes requested.

Member II

Re: getting 403 when calling nodes/.../targets API

Thanks for the reply.  But if I am using the admin username and password, shouldn't I be granted with access to all the APIs?  cause it seems these are the only APIs I can't access.  

I also tried to use the "Manage Permission" option to add myself (admin) to the permission list to do "Read and File" for all the folders in the path above the node I am trying to manipulate through the APIs.  It didn't work either.  

As a brand new Alfresco user, can you tell me where I can make the permission changes to enable this access?

Master

Re: getting 403 when calling nodes/.../targets API

Are you sure you are authenticated correctly?

Technically speaking, "admin" is a super user given the "full control" permission. But it is still possible for specific API to not be accessible, e.g. due to lack of permission check definitions / specific custom code checking permissions. The public API endpoints should not be such APIs, so you should be able to assume "admin" to have all privileges.

Member II

Re: getting 403 when calling nodes/.../targets API

Thanks for the reply.  I was able to resolve the issue by using other APIs.  Maybe the APIs I tried are really not designed to work with "records".  I ended up using the API below to do the job that I was trying to do with other APIs, probably due to my lack of knowledge of what APIs to use

API links:

http://10.5.1.128:8080/alfresco/service/index/uri/

API to use: 

POST: alfresco/service/api/node/workspace/SpacesStore/085f4637-bbXXXXXX-74f350920c25/customreferences

Payload:
{
"nodeRef":"workspace://SpacesStore/085f46XXXXX920c25",
"refId":"e5f1f6aXXXX746e55",
"toNode":"workspace://SpacesStore/49a167f7XXXXXa-c751b570db77",
"nodeRefUrl":"workspace/SpacesStore/085f4637-bbe1XXXX4f350920c25",
"successMessage":"Successfully added relationship"
}

Master

Re: getting 403 when calling nodes/.../targets API

It would have been good to know you were dealing with Records Management related contents. Of course, Records Management is one area of the product where more aggressive permission checks are introduced for the content under RM control. Also, Records Managements has its own set of public v1 ReST APIs (with the newest/upcoming version on 5.2 only).