Forum Discussion

micha80's avatar
micha80
Expert
10 years ago

User Resource in API V2 - Error Code 301

Hello,

 

I want to make an API V2 call for a user resource in a custom component. It looks like this:

 

<#assign LiQL_User = "SELECT * FROM users WHERE id = '19'" />
<#assign author = restadmin("2.0","/search?q=" + LiQL_User?url) />

 

But I always get the error 301. Does anyone know what I am doing wrong?

 

Kind regards,

Michael

  • OlivierS's avatar
    OlivierS
    Lithium Alumni (Retired)

    micha80 where are you getting the error? This worked fine for me on our test instance:

     

    <#assign LiQL_User = "SELECT * FROM users WHERE id = '19'" />
    <#assign authors = restadmin("2.0","/search?q=" + LiQL_User?url).data.items![] />
    
      <#list authors as author>
    ${author.id} &nbsp; ${author.first_name}
    </#list>

     

    • micha80's avatar
      micha80
      Expert

      Hi Olivier,

       

      thanks for the reply. I'am getting this error when I use the custom component on a TkbCategoryPage. I am logged in as a administrator and I am working on the stage system.

       

      Should I make a support ticket with detailed info about how to get this on our stage system?

       

      Kind regards,

      Michael