Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Error Code: 403 (Permission Denied)

Prashant16
New Contributor III
New Contributor III

Hi Team,

We are trying to connect with Google Analytics using the API(https://analyticsadmin.googleapis.com/v1alpha/accounts/), but we are encountering the following error:

Error Code: 403 (Permission Denied) 

{
    "error": {
        "code": 403,
        "message": "The caller does not have permission",
        "status": "PERMISSION_DENIED"
    }
}

We have added all the necessary scopes required for the API. Could you please help us identify and fix the issue?

Thank you!

3 REPLIES 3

rushikeshvartak
All-Star
All-Star
  • Does it working for postman ?
  •  

    Troubleshooting Steps:

    1. Check OAuth Scopes:

    2. Check Service Account Permissions:

      • If you're using a service account to access the API, ensure that the service account has been granted appropriate permissions.
      • The service account email address should be granted permissions within the Google Analytics account you are trying to access.
    3. Verify Google Analytics Account Permissions:

      • Ensure that the Google account you are using has the necessary permissions for the Google Analytics account you are trying to access.
      • Typically, you need at least "Edit" permissions on the Google Analytics account.
    4. Verify API Access:

      • Check if the Google Analytics Admin API is enabled for your project in the Google Cloud Console.
      • Make sure the API is enabled and the project associated with your OAuth credentials is correctly set up.
    5. Verify User Impersonation:

      • If you are using a service account to impersonate a user, ensure that the service account is correctly impersonating the user with sufficient permissions.

    Steps to Fix:

    • Check Scopes: Make sure you have added the correct OAuth scopes in your authentication flow. If unsure, try adding broader scopes temporarily to see if it resolves the issue.
    • Check Permissions: Ensure that the user/service account has the necessary permissions within the Google Analytics account.
    • Enable API: Verify that the Google Analytics Admin API is enabled for your project.
    • Impersonation: If using a service account, ensure it is correctly impersonating a user with the necessary permissions.

    Example OAuth Scope Configuration:

     

     

    Next Steps:

    • Double-check your OAuth configuration and scopes.
    • Verify the permissions of the user or service account accessing the API.
    • Ensure the API is enabled in your Google Cloud project.

Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.

Prashant16
New Contributor III
New Contributor III

Hi @rushikeshvartak ,

Thanks for sharing the steps,Can you please share the document link to refer? 

There is no documentation link for same from saviynt


Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.