ajoshi84
14 years agoContributor
REST API Question - Using Java Client
Hello All,
I am using JAVA client to get connected. I am using the follwing code
URL categoryUrl = newURL("http://forums.mycompany.com/.../restapi/vc/categories/nested");
BASE64Encoder encoder = new BASE64Encoder();
String encodedCredential = encoder.encode( (userId + ":" + password).getBytes() );
httpUrlConnection.setRequestProperty("Authorization", "BASIC " + encodedCredential);
I am able to hit the URL correctly but the response i get is
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="error">
<error code="303">
<message>UserRef[id=-1] does not have access to RequiredPermissions[(allow_restapi_call_read)] on CommunityByDisplayIdRef[nodeType=StandardNodeType[nodeClass=interface lithium.coreapi.community.ICommunity,entityTypeKey=EntityTypeKey[community],entityTypeUid=4,nodeTypeUid=1,hashCode=-390137648],displayId=stx]</message>
</error>
</response>
Any Idea what am I missing here.