Legacy Dev Forum Posts

 View Only

Sign Up

Permission for voicemail media api

  • 1.  Permission for voicemail media api

    Posted 06-05-2025 18:17

    Ajay_Mittal | 2020-06-22 06:40:57 UTC | #1

    I am trying to call the /api/v2/voicemail/messages/{messageId}/media end point. In the documentation, the permissions needed for it are shown as None , but the endpoint doesn't work and in the documentation it is no where written that it require user context and cannot work with client credentials. The error which I am getting is: "400: This request requires a user context. Client credentials cannot be used for requests to this resource. (code: not.a.user)",

    I tried adding the voicemail, voicemail:readonly scope and all the voicemail permission but it ends up giving the same error.

    Please suggest a workaround for this.


    anon11147534 | 2020-06-22 11:34:10 UTC | #2

    That's indeed a strange error to be getting for this endpoint. You can try sending the request using the api-explorer to see if you get the same error. If you think you are doing everything correctly and this is an issue with the API then please open a case with PureCloud Care to investigate.


    Ajay_Mittal | 2020-06-22 12:39:32 UTC | #3

    With api-explorer I am able to get the correct response. cause that will use the user credentials so there it won't give this error. But when I am calling it from the production service it is giving that 400 error


    anon11147534 | 2020-06-22 13:08:33 UTC | #4

    Sorry, my mistake. Looks like this endpoint is improperly documented. Please open a case with PureCloud Care to investigate.


    Ajay_Mittal | 2020-06-22 13:10:32 UTC | #5

    so what is your take it should work with client credentials or not?


    anon11147534 | 2020-06-22 13:27:20 UTC | #6

    I'm not that familiar with this particular endpoint but I can see from the documentation of the PUT, PATCH and DELETE requests to the same endpoint that a user context is required from the note:

    A user voicemail can only be modified by its associated user. A group voicemail can only be modified by a user that is a member of the group. A queue voicemail can only be modified by a participant of the conversation the voicemail is associated with.

    Looks like the most likely reason is this this endpoint requires a user context and the developers forgot to mark the GET request as requiring a user context. I reproduced your issue using Client Credentials. I also authenticated using Code Authorization and was successfully able to make requests.


    Ajay_Mittal | 2020-06-22 16:03:12 UTC | #7

    Then what api I can use to fetch the voicemail media uri given that I have the messageID and using CLIENT CREDENTIALS.


    anon11147534 | 2020-06-22 16:42:21 UTC | #8

    If I'm correct in assuming that API requires a user context then you will need to use something other than client credentials; Saml2 Bearer, Implicit Grant or Code Authorization are the 3 options. That API is your only option for that purpose.


    Ajay_Mittal | 2020-07-13 07:56:03 UTC | #9

    In my scenario, I am asking user to leave a voicemail. How can I fetch the voicemail part timeline (where user speaks) from get conversation.


    tim.smith | 2020-07-14 17:43:45 UTC | #10

    Ajay_Mittal, post:9, topic:8076
    How can I fetch the voicemail part timeline (where user speaks) from get conversation.

    When you retrieve the conversation detail from conversations or analytics APIs, participant data will contain this information.


    Ajay_Mittal | 2020-07-30 14:47:12 UTC | #11

    I tried with conversation api but can't see the timestamps which matches with duration of voicemail recordings.

    Can you please help me in identifying the exact fields which represnts the voicemail start and end timestamp.


    tim.smith | 2020-08-05 16:03:49 UTC | #12

    The example below is an analytics participant. Note the "purpose": "voicemail" property identifying this as the voicemail participant, which has timestamps for the interact segment.

    {
      "participantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "purpose": "voicemail",
      "sessions": [
        {
          "mediaType": "voice",
          "ani": "tel:1000",
          "direction": "inbound",
          "segments": [
            {
              "segmentStart": "2018-09-04T21:58:36.283Z",
              "segmentEnd": "2018-09-04T21:58:36.290Z",
              "segmentType": "system",
              "conference": false
            },
            {
              "segmentStart": "2018-09-04T21:58:36.290Z",
              "segmentEnd": "2018-09-04T21:58:57.639Z",
              "disconnectType": "peer",
              "segmentType": "interact",
              "conference": false
            }
          ],
          "metrics": [
            {
              "name": "tVoicemail",
              "value": 21349,
              "emitDate": "2018-09-04T21:58:57.639Z"
            }
          ]
        }
      ]
    }

    AlanDolan | 2020-08-17 15:14:05 UTC | #13

    Hello! I had the same problem. It's good that I came across your forum.


    Ajay_Mittal | 2020-08-31 12:36:59 UTC | #14

    Good to know that atelast the effort I have put in this post could save some time for you. :)


    system | 2020-10-01 12:37:02 UTC | #15

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