Legacy Dev Forum Posts

 View Only

Sign Up

Upload Document to workspace - Unauthorized Error (Client Credential Flow)

  • 1.  Upload Document to workspace - Unauthorized Error (Client Credential Flow)

    Posted 06-05-2025 18:06

    MattO | 2020-08-01 01:09:10 UTC | #1

    Following the directions here: https://developer.mypurecloud.com/api/rest/v2/contentmanagement/uploaddocuments.html

    I am able to interact with other API area's just fine (US West endpoint).

    However, when I used my Client ID + Auth Key (Client Credential Auth flow as this is an unattended server side application that will periodically upload PDF's to a workspace on genesys).

    Getting this error when trying to call the POST /api/v2/contentmanagement/documents

    {"message":"Create document metadata: Cannot find user ID: 3c10afc0-5e20-4119-ac7f-73ec130d4998","code":"bad.request","status":400,"messageParams":{},"contextId":"5567e671-67ec-4459-a2d3-9c661bbe09f8","details":[],"errors":[]}

    The user ID in question is the client id of my client credential auth flow account that works for other API actions.

    I went to the work space to see if I could add my OAuth User that corresponds to that GUID above (3c10afc0-5e20-4119-ac7f-73ec130d4998) but it can't find it.

    How do you upload documents?


    Jerome.Saint-Marc | 2020-08-03 13:34:26 UTC | #2

    Hello,

    Given the error status you receive (400) and the comment in this page, that mentions "In addition, the user must have access to the workspace the document will be added to.", it means that the POST /api/v2/contentmanagement/documents can't be used with client credentials.

    You can use this API endpoint, as long as it is done in the context of a user. It means you need to get your access token with: Implicit Grant or with Authorization Code Grant.

    You can open a case with Genesys Care (Support) to ask if this error could be reported with a more precise reason. Maybe something like "400: This request requires a user context. Client credentials cannot be used for requests to this resource. (code: not.a.user)"

    Regards,


    MattO | 2020-08-03 13:48:38 UTC | #3

    How do I upload PDF documents to a workspace from an unattended / windows service application if it requires user interaction to authenticate???


    Jerome.Saint-Marc | 2020-08-03 13:51:44 UTC | #4

    Hello,

    As far as I know, there is no available method/endpoint for this. This requires a user context (user to authenticate).

    Regards,


    MattO | 2020-08-06 12:39:18 UTC | #5

    OK, can you please put in a product suggestion to allow the assignment of an OAuth credential flow account to a workspace? That seems like a much more flexible solution versus not being able to do it at all.

    We will have to look at an alternative automated faxing solution such as eFax or Twilio's Faxing API's at this point since we won't be able to upload a .PDF file to a workspace so we can send it as a fax to our customers.


    Jerome.Saint-Marc | 2020-08-03 13:55:22 UTC | #6

    Hello,

    You can request new features and share your use case at https://purecloud.ideas.aha.io/ideas

    Regard,


    MattO | 2020-08-06 12:40:15 UTC | #7

    How do you submit feature requests?

    I signed up with that link but get this:

    Sorry, you can't access Aha PureCloud because you are not assigned this app in Okta.

    If you're wondering why this is happening, please contact your administrator.

    If it's any consolation, we can take you to your Okta home page.


    Jerome.Saint-Marc | 2020-08-06 14:22:24 UTC | #8

    Hello,

    You need a login for Partners or Customers. The Ideas lab is accessible via the Genesys Community site. And might also be available via the Genesys Knowledge Network.

    As a customer or partner, you can request a login to access these sites. From the Knowledge Network Site, on Signin/Singnup and Get Started: https://know.genesys.com/KnowCommunityLogin#getstarted You have one link for Customer registration or Partner registration.

    Regards,


    system | 2020-09-06 14:22:26 UTC | #9

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