Common App Access token Errors

Bettermode allows apps to perform actions on behalf of a bot account or a specific member of the site using API. Bot accounts can perform all actions that a site admin can perform.

Here are some of the most common errors that you might encounter when you’re trying to generate an access token to perform actions through the App:

“Forbidden” Error:

If you’re trying to make an API call using an app that is not published OR installed on that specific site, the Forbidden error is returned.

How to Resolve the Issue?

  • Please ensure that the site is Published within the App. To check this, please go to the Developers Portal, log in and Open the App. Inside App, check if you see ‘Unpublished’ right next to the name of the Site. Please see the example below. As you can see in the screenshot below, right next to CJ’s Site, you can see a red-colored ‘Unpublished' button. That confirms that this App is distributed to the correct Site.

  • Please go to your Profile Picture on the top right→ Administration→ Apps and check if the newly created App is installed or not. For example, an app was created called “Webhooks Testing” and this App is visible in the ‘Apps’ section.

If you’re still facing issues, please post about the issue in Support Space on the Bettermode Site with the following Information:

  • Name of the App created and used to generate an App Access token.

  • URL of the site for which the App is Published

  • Screenshots of the call they’re making.

  • Screenshots of the Developer Portal confirming that the App is published. To access the Developers Portal, please follow the steps in Point 1 above.

‘Unauthorized’ Error

If you are receiving the Unauthorized Error, it means that the call doesn’t have the correct format.

How to resolve the Issue?

Here’s where you can learn more about how to properly call the endpoint to generate the token: App Access Token

An access token needs the following Information:

  • networkId- To get the correct networkID of the site, go to Developers Portal, log in and open one of the Apps. On the left side, go to Test & Publish, and you will be able to see the networkID of the site right below its URL. Here’s an example:

  • entityId- It’s the same as NetworkID.

  • impersonateMemberId- ID of the members or the bot that needs to be impersonated. To find the ID of a member, go to Profile→ Administration→ Members and you will see the id for all members.

  • clientId & clientSecret- - Go to App(inside Developers Portal)→ Credentials

If you’re still facing issues, please post about the issue in Support Space in the Bettermode Site with the following Information:

  • Name of the App created and used to generate an App Access token.

  • The Site URL for which the App is Published

  • Screenshot of the call they’re making.

The app {AppID} cannot access the network {networkID}

This error means that the App is not installed on the correct Site.

How to resolve this issue?

We need to make sure that the newly created app is published in the correct Site. Please go to Developers Portal, log in and open the App in question. On the left side, go to Test & Publish and you will be able to see the networkID of the site right below its URL. You can confirm if the networkID is correct. Here’s an example:

Most likely, this is the reason behind the Issue. If you’re still facing issues, please post about the issue in Support Space in the Campfire Site with the following Information:

  • Name of the App created and used to generate an App Access token.

  • URL of the site for which the App is Published

  • Screenshot of the call they’re making.

  • Screenshot of the Developer Portal confirming that the App is published. To access the Developers Portal, please visit this URL: Developers Portal

The app {AppID} cannot impersonate member{memberID}

This error suggests that either the memberID is wrong or the member belongs to a different site, and we’re using an incorrect AppID.

How to Resolve the Issue?

We need to make sure that the member exists on the site where we’ve installed the app. To check that, please go to Developers Portal, log in and open the App in question. On the left side, go to Test & Publish and you will be able to see the name and networkID of the site right below its URL. You can go to that site using the URL and search if the member exists. Most likely, the member won’t exist. If you’re still facing issues, please post about the issue in Support Space in the Campfire Site with the following Information:

  • Name of the App created and used to generate an App Access token.

  • The site URL for which the App is Published

  • Screenshot of the call they’re making.

  • Id of the member.

  • Screenshot of the Developer Portal confirming that the App is published. To access the Developers Portal, please visit this URL: Developers Portal

Contact Us

Do you still need help? Learn how to get in touch with the Bettermode Team.