Legacy Dev Forum Posts

 View Only

Sign Up

Platform Client SDKs - Get correlation-id

  • 1.  Platform Client SDKs - Get correlation-id

    Posted 06-05-2025 18:09

    FlorianM | 2023-11-05 14:14:12 UTC | #1

    Hello,

    I create an ODS and I would like save the inin-correlation-id to trace my datas. Can you help me ?

    apiclient = PureCloudPlatformClientV2.apiclient.ApiClient().getclientcredentialstoken(...) apiresponse = PureCloudPlatformClientV2.AuthorizationApi(apiclient).getauthorizationdivisions() inin-correlation-id = apiresponse.???

    Thanks for advance. Florian MONTAY


    charlie.conneely | 2023-11-07 11:21:42 UTC | #2

    Hi Florian

    You can add the following lines to your python code and grab the correlation ID from the log file.

    PureCloudPlatformClientV2.configuration.logger.log_level = PureCloudPlatformClientV2.logger.LogLevel.LTrace
    PureCloudPlatformClientV2.configuration.logger.log_format = PureCloudPlatformClientV2.logger.LogFormat.TEXT
    PureCloudPlatformClientV2.configuration.logger.log_to_console = False
    PureCloudPlatformClientV2.configuration.logger.log_file_path = "./pythonsdk.log"

    Also, this article describes how you can configure your default logging behaviour for the SDK - https://developer.genesys.cloud/devapps/sdk/python

    -Charlie


    FlorianM | 2023-11-08 10:59:07 UTC | #3

    Thanks a lot Charlie, I didn't have the good variable (PureCloudPlatformClientV2.configuration.configfilepath) Have a good day Florian


    system | 2023-12-09 10:59:17 UTC | #4

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