I am developing external component in Sitecore Content Hub 4.X. I want to call REST API as a current logged user. Custom component expose some options, for example options.api but it is only text...


but how to call for example options.api.entities using credentials of already logged user?


The call will be authenticated based on the Content Hub cookies you have. So it will use the logged in user to make the call.

You can use jQuery to make the call, the library is already loaded.

   url: `${options.api.entities.href}&skip=0&take=10`,
   contentType: 'application/json',
   type: 'get',
   success: (data) => {
  • this works for get, but doesn't for post :/ I am api user and I assigned myself to all groups and still 403 is returned. May 21 at 8:11
  • you will need X-Auth-Token in header for POST
    – josedbaez
    Jul 7 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.