Legacy Dev Forum Posts

 View Only

Sign Up

Error "client not found" while generating client credential token

  • 1.  Error "client not found" while generating client credential token

    Posted 06-05-2025 18:29

    shamss | 2023-12-06 12:42:40 UTC | #1

    Hi Team,

    We are new to Genesys world. When we try to generate a client credential token with 'purecloud-platform-client-v2' , the below error is throwing. We double checked the client id and client secret but it is correct. So, please help us to identify what we missed here

    data: {
          error: 'invalid_client',
          description: 'client not found',
          error_description: 'client not found'
        }

    The javascript code we are using is

    const platformClient = require('purecloud-platform-client-v2');
    const client = platformClient.ApiClient.instance;
    // Create API instance
    var authorizationApi = new platformClient.AuthorizationApi();
    client.loginClientCredentialsGrant("client_id","client_secret")
    .then(() => {
        // Make request to GET /api/v2/authorization/permissions
        return authorizationApi.getAuthorizationPermissions();
      })
      .then((permissions) => {
        // Handle successful result
        console.log(permissions);
      })
      .catch((err) => {
        // Handle failure response
        console.log(err);
      });

    Declan_ginty | 2023-12-06 12:53:27 UTC | #2

    Hi,

    You will need to specify the region of the org that the credentials are for. For example to set your region to us-east-1 you would write:

    client.setEnvironment(platformClient.PureCloudRegionHosts.us_east_1); 

    Regards, Declan


    shamss | 2024-01-10 13:53:05 UTC | #3

    Thanks for the details.

    How to identify this region from a Genesys account available in https://apps.usw2.pure.cloud/


    Declan_ginty | 2023-12-06 13:20:58 UTC | #4

    That is us-west-2


    shamss | 2023-12-06 13:24:59 UTC | #5

    Thanks, it worked.


    system | 2024-01-06 13:25:15 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 23549