Post a new review

Parameter Note
ratedUserId The User ID of the user receiving a review. Required
ratingUserId The User ID of the user giving a review. Required
reviewText The written review. Required
rateUserValues The numeric rating(s). Required
transactionId The ID of the transaction behind review. Optional
transactionPrice The price of the transaction behind review. Optional
transactionDate The date of the transaction behind review. Optional

To get the rating parameters and their ID refer to Get Rating Categories

C#


//use HttpClient to make the API calls
using (var httpclient = new HttpClient())
{
    httpclient.DefaultRequestHeaders.Accept.Clear();
    httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("amx", token);
    httpclient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
    httpclient.DefaultRequestHeaders.Add("User-Agent",".NET Test 0.1");
    // set post fields
    var postData = new Dictionary
    {
        { "ratedUserId", "The rated user id" },
        { "ratingUserId", "The rating user id" },
        { "reviewText", "The review text"},
        { "rateUserValues" : [
                {
                    "ratingCategoryId" : The rating category id number,
                    "rating" ": Rating value number
                }
        ]} // you can use the plainStringValues or rateuserValues option
    };
    var content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json");
    var response = await httpclient
    .PostAsync("https://portal.deemly.co/api/api/rate-user",content)
    .ConfigureAwait(false);
    var responseContent = await response.Content.ReadAsStringAsync();
    if (response.IsSuccessStatusCode)
    {
    // Do your magic
    }
}

Jens Farvig Thomsen

Co-Founder & CPO

Let's talk

Request free demo