Posting call quality feedback using the API

    This method lets you post feedback for calls. You can access call quality feedback information received through this API on the Call Debug UI, and view aggregated reports on the Call Insights Reporting dashboard.

    API Endpoint

    POST https://stats.plivo.com/v1/Call/{call_uuid}/Feedback/

    Arguments

    call_uuidRequiredThe call UUID of the call for which feedback is being posted.
    ratingRequired

    Quality rating for the call.

    Allowed values: float between [1,5]. PS: for integer values both ‘x’ or ‘x.`0’ are accepted.

    issuesRequired only if rating is <5List of issues observed on the call. One or more of the following:

    AUDIO_LAG, BROKEN_AUDIO, CALL_DROPPED, CALLERID_ISSUE, DIGITS_NOT_CAPTURED, ECHO, HIGH_CONNECT_TIME, LOW_AUDIO_LEVEL, ONE_WAY_AUDIO, OTHERS, ROBOTIC_AUDIO

    NotesOptional free text field that can be used to send descriptive feedback for the call.

    HTTP responses we send

    HTTP Status CodeMessage
    201Feedback has been posted
    401Authentication failed
    404Resource cannot be found*
    404Please check the Call UUID**
    405HTTP method not allowed
    422Rating has to be a float between 1 -5
    422Issues have to be an array of one or more than one of the following: AUDIO_LAG, BROKEN_AUDIO, CALL_DROPPPED, CALLERID_ISSUES, DIGITS_NOT_CAPTURED, ECHO, HIGH_CONNECT_TIME, LOW_AUDIO_LEVEL, ONE_WAY_AUDIO, OTHERS, ROBOTIC_AUDIO
    500Server error

    * Generic response indicating error in resource used in the Post API call

    ** Specific response indicating the error in call UUID used in Post API call

    Response attributes

    HTTP status codeHTTP status code from the list above
    api_idIdentifies the request
    errorIndicates there’s an error and provides information regarding the error
    messageProvides information regarding the feedback post

    Response

    HTTP Status Code: 201

    {
      "message": "Feedback has been posted",
      "api_id": "97ceeb52-58b6-11e1-86da-77300b68f8bb",
      "status": "success"
    }
    

    Example Request

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    #
    # Example for Call Feedback creation
    #
    import plivo
    
    client = plivo.RestClient('<auth_id>','<auth_token>')
    response = client.call_feedback.create(
        call_uuid="b38149eb-b8fe-45d5-85b2-78ee4424788f", 
        rating="4", 
        issues=["AUDIO_LAG"], 
        notes="Call quality was good")
    print(response)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    #
    # Example for Call Feedback creation
    #
    require 'rubygems'
    require 'plivo'
    
    include Plivo
    include Plivo::Exceptions
    
    api = RestClient.new("<auth_id>","<auth_token>")
    
    begin
      response = api.call_feedback.create('f28149eb-b8fe-45d5-85b2-78ee4424788f', 
          4, 
          ["AUDIO_LAG"], 
          "Call quality was good")
      puts response
    rescue PlivoRESTError => e
      puts 'Exception: ' + e.message
    end
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
    // Example for Call Feedback creation
    
    var plivo = require('plivo');
    
    (function main() {
        'use strict';
    
        var client = new plivo.Client("<auth_id>","<auth_token>");
        client.callFeedback.create('f18149eb-b8fe-45d5-85b2-78ee4424788f',
            4,
            issues = ["AUDIO_LAG"],
            notes = "Call quality was good").then(function (response) {
                console.log(response);
            }, function (err) {
                console.error(err);
            });
    })();
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    <?php
    /**
     * Example for Call Feedback creation
     */
    require 'vendor/autoload.php';
    use Plivo\RestClient;
    use Plivo\Exceptions\PlivoRestException;
    $client = new RestClient("<auth_id>","<auth_token>");
    try {
        $response = $client->callFeedback->create('f18149eb-b8fe-45d5-85b2-78ee4424788f', 
            4, 
            ["AUDIO_LAG"], 
            "Call quality was good");
        print_r($response);
    }
    catch (PlivoRestException $ex) {
        print_r($ex);
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    import com.plivo.api.Plivo;
    import com.plivo.api.exceptions.PlivoRestException;
    import com.plivo.api.models.callfeedback.CallFeedback;
    import com.plivo.api.models.callfeedback.CallFeedbackCreateResponse;
    
    import java.io.IOException;
    import java.util.Collections;
    
    /**
     * Example for Call Feedback creation
     */
    class CallFeedbackCreate {
        public static void main(String[] args) {
            Plivo.init("<auth_id>","<auth_token>");
            try {
                CallFeedbackCreateResponse response = CallFeedback
                        .creator("f18149eb-b8fe-45d5-85b2-78ee4424788f", (float) 4)
                        .issues(Collections.singletonList("AUDIO_LAG")).notes("Call quality was good").create();
    
                System.out.println(response);
            } catch (PlivoRestException | IOException e) {
                e.printStackTrace();
            }
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    
    /**
     * Example for Call Feedback Creation
     */
    using System;
    using System.Collections.Generic;
    using Plivo;
    using Plivo.Exception;
    
    namespace PlivoExamples
    {
        internal class Program
        {
            public static void Main(string[] args)
            {
                var api = new PlivoApi("<auth_id>","<auth_token>");
                try
                {
                    var response = api.CallFeedback.Create(
                        callUUID: "a18149eb-b8fe-45d5-85b2-78ee4424788f",
                        rating: 4,
                        issues: new List<string> { "AUDIO_LAG" },
                        notes: "Call quality was good");
                    Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                    Console.WriteLine("Exception: " + e.Message);
                }
            }
        }
    }
    
    1
    2
    3
    4
    
    curl -i --user AUTH_ID:AUTH_TOKEN \
        -H "Content-Type: application/json" \
        -d '{"issues": ["AUDIO_LAG"], "rating": "4", "notes": "Call quality was good"}' \
        https://stats.plivo.com/v1/Call/f6bf3c48-afdf-4e42-a30e-9e00fda351d/Feedback/
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    // Example for Call Feedback creation
    package main
    
    import "fmt"
    import "github.com/plivo/plivo-go"
    
    func main() {
    
    	client, err := plivo.NewClient("<auth_id>","<auth_token>", &plivo.ClientOptions{})
    	if err != nil {
    		panic(err)
    	}
      issuesArr := []string{**"AUDIO_LAG"**}
    	response, err := client.CallFeedback.Create(
      plivo.CallFeedbackParams{
      CallUUID: "f18149eb-b8fe-45d5-85b2-78ee442478", 
      Rating: "4", 
      Issues: issuesArr, 
      Notes: "Call quality was good"})
    	if err != nil {
    		panic(err)
    	}
    	fmt.Printf("Response: %#v\n", response)
    
    }