Error while creating namespace in Content metadata service

Hi team, I am trying to create namespace in cms using postman as well as swagger ui in portal, but getting error as below

{  "path": "https://us.api.opentext.com/cms/namespaces",  "title": "Internal Server Error",  "status": 500,  "details": "Current user could not be found; nested exception is java.lang.IllegalArgumentException: Current user could not be found",  "incident": "7f267753-c205-4c5b-b143-7d6cc8f36fe6"}

Can you please guide on how to proceed?

Answers

  • LazarescuA
    LazarescuA E Community Moderator

    Hello. While it is possible to create definitions such as namespaces using the API, we recommend using VSCode extensions and the modelers provided in order to simplify the deployment process and the reusability of your artifacts.

    However, you can certainly use postman and create it.

    Let's make sure everything is working fine. Can you do a GET to /cms/service and make sure you get a 200 response?

    Then, can you please paste the POST body for the above call that you are trying. The namespace creation should only be allowed to users that are in the ims_admin role, so you can also check in the Admin Center, in your Tenant, click on Apps → Your Application and then go to User management and check the ims_admin role. (or make sure your user is in the Admins area)

  • Mrudhula
    Mrudhula Member
    edited August 22 #3

    Hi @LazarescuA , yes am able to access the endpoint /cms/service with 200 response. For name space creation, under the Admins tab in the application which i created, the user is present with admin role. But am not able to see role ims_admin there.

    url = "https://us.api.opentext.com/cms/namespaces/"
    payload = json.dumps({ "prefix": "acmerd", "display_name": "R&D", "description": "Research and Development", "name": "acme_rd"}) headers = { 'Content-Type': 'application/json', 'Authorization': '••••••'}
    response = requests.request("POST", url, headers=headers, data=payload)

    For authorization am giving Bearer token. Can you please help further?

  • LazarescuA
    LazarescuA E Community Moderator

    In the Authorization header, you are sending the Bearer token with the word Bearer in front of the actual token, like so:

    'Authorization': 'Bearer eyJraWQiOiIyMTRmO………………………..'

    I have tried exactly your post above and for me it is succesfull. I will contact you on the email for a chat to further debug the issue.