Legacy Dev Forum Posts

 View Only

Sign Up

Need Guidance with creating code authorization client - Python SDK

  • 1.  Need Guidance with creating code authorization client - Python SDK

    Posted 06-05-2025 18:08

    psamvatsar | 2022-08-04 07:14:31 UTC | #1

    Hi , My End goal is to download bulk audio calls, using python SDK.

    For this, I created client with Grant Method as "Client Credentials". But with this method I am getting error "Forbidden". Got to understand , I need to create Oauth client with method as "code authorization".

    Need help with how do I create this client and what should be "redirect url" while creating client and what scope I need to mention to fulfil my end goal?


    Ebenezer_Osei | 2022-09-05 06:56:57 UTC | #2

    Hello,

    Client credentials should work if you have the required permissions. When creating a client with the Client Credentials OAuth method, assign a role granting permission to download bulk audio calls.

    Best


    psamvatsar | 2022-08-05 04:37:20 UTC | #3

    Hello @Ebenezer_Osei , I do have assigned the role, which has permission for recordings api.

    Even when I try to use the same api's, in developer tools , which is "https://developer.genesys.cloud/developer-tools/#/api-explorer"

    Those all API's works, but when I try to access api using the python SDK,

    I get error 403 -- Forbidden


    Ebenezer_Osei | 2022-08-08 13:28:05 UTC | #4

    Which endpoint are you using?


    anon14299330 | 2022-08-08 14:45:07 UTC | #5

    Hi,

    If you are trying to authorize with client credentials you will need to setup and OAuth Client and assign the role the required permissions. Take a look at the Client Credentials page for instructions on how to setup an OAuth Client. Then, take a look at the Python SDK documentation on how to authorize with client credentials. Alternatively, you can set the access token in the Python SDK like so:

    # Configure OAuth2 access token for authorization: PureCloud OAuth
    PureCloudPlatformClientV2.configuration.access_token = 'your_access_token'

    Thanks,

    Mike


    psamvatsar | 2022-09-05 06:56:53 UTC | #6

    Yes, I tried , it got fixed, It was missing required permissions.


    system | 2022-10-06 06:56:59 UTC | #7

    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: 15787