Legacy Dev Forum Posts

 View Only

Sign Up

Getting Exception when trying to get Document Object using SDK code

  • 1.  Getting Exception when trying to get Document Object using SDK code

    Posted 06-05-2025 18:23

    Sidharth_Gera | 2022-09-08 07:47:21 UTC | #1

    Hi

    I am using the below code to get Document object which throws a general exception on line -> Document result = api.getContentmanagementDocument(documentId, expand);

    The document is valid and do exist.

    Code used-> ContentManagementApi api = new ContentManagementApi(); String documentId = rollbackRequest.getEntityId(); List<String> expand = new ArrayList<String>(); try { Document result = api.getContentmanagementDocument(documentId, expand); System.out.println(result); } catch(Exception e) { log.info("document with id-> "+rollbackRequest.getEntityId()+" does not exist"); response.setMessage("Failed"); e.printStackTrace(); }

    Exception-> com.mypurecloud.sdk.v2.ApiException: error at com.mypurecloud.sdk.v2.ApiClient.interpretConnectorResponse(ApiClient.java:706) at com.mypurecloud.sdk.v2.ApiClient.getAPIResponse(ApiClient.java:758) at com.mypurecloud.sdk.v2.ApiClient.refreshCodeAuthorization(ApiClient.java:359) at com.mypurecloud.sdk.v2.ApiClient.refreshCodeAuthorization(ApiClient.java:367) at com.mypurecloud.sdk.v2.ApiClient.handleExpiredAccessToken(ApiClient.java:714) at com.mypurecloud.sdk.v2.ApiClient.getAPIResponse(ApiClient.java:761) at com.mypurecloud.sdk.v2.ApiClient.invoke(ApiClient.java:869)

    Please if anyone can help..

    Thanks


    anon14299330 | 2022-09-19 12:46:45 UTC | #2

    Hi,

    Can you please make sure you are authorizing correctly with Genesys Cloud. It looks like you may have provided invalid credentials or none at all. Take a look at the Java SDK documentation for authorization for more info.

    Thanks,

    Mike


    system | 2022-10-13 10:23:33 UTC | #3

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