Public
Esteemed Contributor

How to hit the stage API without authentication?

Is there a way to use the stage API for an app --- for example, a Vue App, and use fetch('https://community-stage.mysite.com/restapi/v1/messages/id/12345?restapi.response_format=json') without using authentication?

  1. If I am logged into stage, I can put the url in a new tab and I get results there
  2. If I am logged into stage I can put a fetch query in the console and get results but only in the same tab that I'm logged into stage on
  3. We are running SSO 

When I was building the app, I had no problem hitting this URL. But now I get an error response, 

error: {code: 101, message: "No message with the specified uid."}

But the uid exists. 

Unsure if something changed or if there's a secret back door to hit the API or ...? 

I believe I was using a CORS workaround plugin but even that doesn't do it anymore. 

 

Thanks

6 Replies 6
Honored Contributor

@IanAtJMP ,

You can log support ticket to whitelist the IP from which you want to hit the stage url. Server IP which you share with the support will have the access to hit the API without htaccess

 

.......
Expecting your Kudos and Accepted Solution to my replies.
Esteemed Contributor

@Parshant Thanks. So for example, could they do it for "localhost:1234"? 

Honored Contributor

No, it can't be of localhost.

it should be of dedicated server.

.......
Expecting your Kudos and Accepted Solution to my replies.
Khoros Staff

Without authentication, you'll only be able to get public content. So if that message UID is in a private area that would otherwise require authentication, you won't be able to get it from the API without authentication.

-

Professional Services - Sr. Web Engineer

Esteemed Contributor

Is stage considered a public area? I am still unable to hit the API and get results despite making it public.

Hi @IanAtJMP,

 

There's 2 things you could try in this situation:

 

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.