Legacy Dev Forum Posts

 View Only

Sign Up

Oauth Client Token Request Fails 400, invalid client

  • 1.  Oauth Client Token Request Fails 400, invalid client

    Posted 06-05-2025 19:19

    square_eyes | 2017-10-07 02:38:30 UTC | #1

    Using the code example in https://developer.mypurecloud.com/api/tutorials/oauth-client-credentials/#python

    ...with app ID and secret as generated by our dev PureCloud org /integrations/oauth panel

    I get:

    Failure: 400 - Bad Request Process finished with exit code 144 (interrupted by signal 16: SIGURG)

    Printing response.text gives me a little more info:

    {"error":"invalid_client","description":"authentication failed"}

    • Tried a few suggestions from very old posts like stripping out unused default headers to no avail.
    • Tried reformatting the client ID. No dice.
    • The credential has my user permissions (admin) - Do I need to assign anything else? I know I can't conduct user functions. But I'm building a devops tool to return phone numbers associated with an interaction ID.

    square_eyes | 2017-10-07 03:21:58 UTC | #2

    Seems I get a more descriptive error when I use .com.au instead of .com

    It would be great if the examples and doc specified nice and clearly that the correct zone is needed. Gah. Spent hours on this barking up the wrong tree because of the generic error code and agnostic doc.

    The new error is:

    {"error":"unauthorizedclient","description":"client is not authorized to use the clientcredential grant type"}

    I guess I need to add more roles. This can be resolved I suppose.


    tim.smith | 2017-10-09 16:13:42 UTC | #3

    There is a note about regions in the API docs here: https://developer.mypurecloud.com/api/rest/. As well as an example of setting your region in the python SDK docs: https://developer.mypurecloud.com/api/rest/client-libraries/python/. But now you know. :)

    When configuring your oauth client, you must configure it for client credentials:

    <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/2c03916023eb5822d55975003b43fb391c984c5c.png" width="273" height="291">


    system | 2017-11-09 16:13:53 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: 1918