Language Scoring

פרמיום
Verified
על ידי Twinword API | מְעוּדכָּן 5 days ago | Text Analysis
פּוֹפּוּלָרִיוּת

9 / 10

חֶבִיוֹן

691ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

C# request sample given on the documentation does not work.

Rapid account: Fatbb 999
fatbb999
6 years ago

It simply just returned no response!

My code looks like this, please help!

public static string GetJasonFromAPI(string querytext)
{

        unirest_net.http.HttpResponse<MyClass.RootObject> jsonResponse = Unirest.get("https://twinword-language-scoring.p.mashape.com/text/?text=" + querytext)
        .header("X-Mashape-Key", "6eeAh2lHw7mshDvcFf3ZkKBeqIBBp1fZgVcjsnSsZBzNg5RjSz")
        .header("Accept", "application/json").asJson<MyClass.RootObject>();


        var myBody = jsonResponse.Body;

        return myBody.ToString();
    }

    public class MyClass
    {
        public class Result
        {
            public string ten_degree { get; set; }
            public string value { get; set; }
            public string version { get; set; }
            public string author { get; set; }
            public string email { get; set; }
            public string result_code { get; set; }
            public string result_msg { get; set; }
        }

        public class RootObject
        {
            public List<Result> results { get; set; }
        }
    }

Rapid account: Twinword
twinword Commented 6 years ago

Hi fatbb999,

FIRST, PLEASE EDIT YOUR MESSAGE AND REMOVE YOUR API-KEY. Otherwise someone can steal it and start making calls with it and the overage charges will be charged to your account.

Now, this question I think is best suited for StackOverflow as there will be more C# experts there to look at your code. We don’t have a C# person right now to look at it so your quickest way is to post on that community site with links to this API documentation you are referencing.

REMEMBER, replace api key with XXXXXXXXXX or something.

Good luck.

Team Twinword

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות