Forum Discussion

santosh_csc's avatar
8 years ago

How to get role details by name which has space

When I call API https://community.lithium.com/restapi/vc/roles/name/Test Role or https://community.lithium.com/restapi/vc/roles/name/Test%20Role, the response is 

<response status="error">
<error code="101">
<message>No role with the specified id.</message>
</error>
</response>

How can I get Test Role details using role name instead of ID?

This error is there only when Role name has a space.
 

1 Reply

  • santosh_csc - It seems to be some other issue, either the role you are fetching is not present in the community or might be the spelling mistake.  Could you please verify. 

     

    Tried the same call and it worked fine on my side. 

    API:

    community-url/restapi/vc/roles/name/Test%20Role

    Response:

    <response status="success">
       <role type="role" href="/roles/id/531">
       <name type="string">Test Role</name>
       <id type="int">531</id>
       <node type="community"/>
       </role>
    </response>