I am calling a third party API and it is giving null in the response

61 views Asked by At

Hello everyone I had a problem while calling a Kiwi API in my API but I am facing a problem in URL part because my URL is not forming according to URL formed by The KIWI APP let me show you my code in which I am passing my parameters

public ApiResult<KiwiFlightDetails> GetKiwiFlightDetails()
{

    string endPoint = "/search";

    var flightResult = _httpService.Get<KiwiFlightDetails>(
    endPoint: endPoint,
    headers: new Dictionary<string, string>
    {
        {"apikey",_serviCeconfig.Kiwi_Key}
    },
    parameters: new Dictionary<string, string>
    {
        { "fly_from", "FRA"},
        { "fly_to", "PRG" },
        { "date_from", "05/10/2023" },
        { "date_to ", "07/10/2023" }  ,
        { "return_from", "08/10/2023"},
        { "return_to", "10/10/2023" },
        //{ "nights_in_dst_from", "2" },
        //{ "nights_in_dst_to", "3" },
        { "max_Fly_Duration", "20" },
        { "ret_From_Diff_City", "true"},
        { "ret_to_Diff_City"," true"},
        { "one_For_City", "0" },
        { "one_per_date","0"},
        { "adults", "2" },
        { "children", "2" },
        { "selected_Cabins", "C" },
        { "mix_With_Cabins", "M" },
        { "adult_hold_bag", "1,0" },
        { "adult_hand_bag", "1,1" },
        { "child_hold_bag", "2,1" },
        { "child_hand_bag", "1,0" },
        { "only_Working_Days", "false" },
        { "onlyWeekEnd", "false" },
        { "partner_Market", "us" },
        { "max_Stopovers", "2" },
        { "max_sector_stopovers", "2" },
        { "vehicle_Type", "aircraft"},
        { "limit", "500"},
        }
    );
    return flightResult;``your text``
}`
and this is my BaseURL which is located in Appsettings.json 

"KiwiServiceConfig": {
  "BaseUrl": "https://api.tequila.kiwi.com/v2",
  "Kiwi_Key": "l9F6FUSfV9To1MMd1wFyeZ9zxnMC9l5A"
}

from my service my endpoint="/search" is not appending in my baseurl can some one please help me Thanks

I had tried many things like placing search api keyword with my baseurl and is not working

0

There are 0 answers