Skip to main content
Question

Cannot use the API to List events (/events)

  • May 20, 2025
  • 10 replies
  • 47 views

michaelrandrup

We have a working API integration between the community and our other systems.

But when we use the API for the events end-point we consistently get this error 401:
{

    "message": "Unauthorized",

    "description": "No API token provided"

}

We ARE provided the OAuth bearer token, and the bearer token works with everything else except events.

Example: https://api2-eu-west-1.insided.com/v2/events/?moderatorId=XYZ

We have tried with and without a “moderatorId” but the response remains the same. We also tried with and without the base URL “v2”.

Can anybody help us as to how we successfully use the various /events end-points ?

10 replies

Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • May 20, 2025

Hi ​@michaelrandrup - I just tested some of the Events endpoints here myself and the regular authentication worked just fine, so I haven’t been able to replicate.  Which endpoint exactly are you working with?  I expect you’ve checked these things already, but just to double-check the basics - are you sure your moderatorID has the permissions, or are you by any chance also trying endpoints that require a ‘write’ scope?


michaelrandrup
  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

Hi Kenneth.

Thank you for a Fast reply. The exact endpoint I am using is this: https://api2-eu-west-1.insided.com/v2/events/?moderatorId=XYZ.

The “XYZ” is the user id of our community moderator who has access to events.

We have created an OAuth2 client (clientid+secret) and are using that Bearer token as credential on all API calls - which “regular authentication” are you referring to? OAauth2 is the only way we can access the API’s as I understand things.


Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • May 20, 2025

Yep by ‘regular authentication’ I just mean the same authentication method that we use for the other endpoints.  For that ‘list events’ endpoint, have you tried adding the Moderator ID as a header (X-USER-ID) instead?  


michaelrandrup
  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

Hi Kenneth, yes exact same error. Testing in Postman:

 

 


michaelrandrup
  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

Same Authentication - but /user endpoint works fine:
 

 


Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • May 20, 2025

Alright thanks ​@michaelrandrup - that is puzzling.  As I’m not able to replicate the issue (these endpoints work fine in Workato for me using the same connection/authentication I’m using for other endpoints) I’m afraid that I’m not going to be the most helpful resource for you in terms of figuring out exactly what’s happening, so I recommend you also create a ticket with our Support engineers (they REALLY know this stuff).  And in the meantime, someone else might chime-in here with more ideas.  


michaelrandrup
  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

Hmm.. Yes, very very strange Kenneth.

So just to be sure here:

  1. You are using /v2/events as your endpoint
  2. You are authenticating using an OAuth2 bearer token
  3. You can make it work both by using the query string moderatorId=XYZ AND the X-USER-ID?
  4. Can you make it work without specifying a moderatorId?

If that is so, it must be something with my moderatorId then? I have tried 3 different moderators who are community managers, so it seems really strange.

 

Also, I don’t see that return message in the documentation at all. Could be be ‘new’ to V2 and maybe we don’t have access to that version of the API or something? and who can check that for us?


 


michaelrandrup
  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

I have set every up according to the documentation here: Customer Communities API Documentation

The moderatorId is only needed if the “class” parameter is “all”. But in any case, it doesn’t work, so its not the moderatorId, or a wrong endpoint or a wrong authentication (at least the authentication works on every other endpoint).

So I guess my question is, who we can contact for an issue like this one? 

 


michaelrandrup
  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

Thanks for trying to help ​@Kenneth R - I decided to write support@insided.com - 🤞


FMEEvangelist
  • Helper ⭐️⭐️
  • May 22, 2025

I had this error when I mistakenly used the wrong base URL for the API. I was trying to use eu-west-1 when it should have been us-west-2.

Very frustrating because it’s so hard to spot the mistake. 

Of course, your error might be a different cause, but I wanted to mention it.