Legacy Dev Forum Posts

 View Only

Sign Up

Get Token for Authorization Code

  • 1.  Get Token for Authorization Code

    Posted 06-05-2025 18:23

    MHuseinNasution | 2022-09-22 12:21:45 UTC | #1

    Hi

    I am try to call this api https://api.mypurecloud.jp/api/v2/conversations/calls from postman, when i using Client Credential postman can get the token, but appear an error

    {

    "message": "This request requires a user context. Client credentials cannot be used for requests to this resource.",

    "code": "not.a.user",

    "status": 400,

    "contextId": "47ca00a4-8604-4da5-b573-9f835ee8661f",

    "details": [],

    "errors": []

    }

    But when I change the get token to Authorization Code always failed to get token, when i am using postman in my local laptop what is the value for Authorized redirect URIs (one per line) in the OAuth type Code Authorization,

    Please advise

    Husein


    tim.smith | 2022-09-22 13:23:00 UTC | #2

    Please verify your configuration in Postman, you have configured something incorrectly. There's a similar thread here: https://developer.genesys.cloud/forum/t/cant-get-passed-api-security/16163/2?u=tim.smith


    MHuseinNasution | 2022-09-22 13:45:01 UTC | #3

    Hi Tim

    Thank you for the update, i have try like link you share its working for this Api => https://api.mypurecloud.jp/api/v2/users , but still failed for this API POST => https://api.mypurecloud.jp/api/v2/conversations/calls, the error appear still same , Is it I cannot use Client Credentials for this API => https://api.mypurecloud.jp/api/v2/conversations/calls

    {

    "message": "This request requires a user context. Client credentials cannot be used for requests to this resource.",

    "code": "not.a.user",

    "status": 400,

    "contextId": "37dc3127-55ab-40f4-8ccc-7d9bd4fad0cd",

    "details": [],

    "errors": []

    }


    tim.smith | 2022-09-22 13:47:41 UTC | #4

    MHuseinNasution, post:3, topic:16399
    I cannot use Client Credentials for this API => https://api.mypurecloud.jp/api/v2/conversations/calls

    That's correct. The error is accurate that you must use user-based authorization to use that endpoint. I was referring to your configuration of Postman for using an auth code grant. Something about your configuration in Postman isn't set up correctly to use the auth code grant. It does work when configured correctly.


    MHuseinNasution | 2022-09-22 13:55:12 UTC | #5

    Hi Tim

    Which OAuth Grant Types I must use for this API https://api.mypurecloud.jp/api/v2/conversations/calls,

    Is it using Code Authorization ? If Yes what value must put in Authorized redirect URIs (one per line) for access API from Postman , Please advise


    tim.smith | 2022-09-22 14:02:54 UTC | #6

    MHuseinNasution, post:5, topic:16399
    Which OAuth Grant Types I must use for this API https://api.mypurecloud.jp/api/v2/conversations/calls,

    Literally any of the supported grants except client credentials.

    MHuseinNasution, post:5, topic:16399
    what value must put in Authorized redirect URIs

    the same value you use when configuring postman


    MHuseinNasution | 2022-09-22 14:30:53 UTC | #7

    Just try use postman from browser, but still failed to get the , could please advise

    Below the image from the configuration postman

    OAuth Genesys


    tim.smith | 2022-09-22 20:41:34 UTC | #8

    Auth url is wrong. Please refer to the documentation for correct values: https://developer.genesys.cloud/platform/api/postman#enable-authorization


    MHuseinNasution | 2022-09-22 14:48:57 UTC | #9

    Hi Tim

    Its working now, thank you so much for the detail guidance


    system | 2022-10-23 14:49:37 UTC | #10

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