Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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

 

.......
Do you know we work with Kudos and Accepted Solution.
Highlighted
Esteemed Contributor

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

Highlighted
Honored Contributor

No, it can't be of localhost.

it should be of dedicated server.

.......
Do you know we work with Kudos and Accepted Solution.
Highlighted
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 - Web Engineer

Highlighted
Esteemed Contributor

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

Highlighted

Hi @IanAtJMP,

 

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