Open canuckasaurus opened 1 year ago
Flight API
Static URL I had trouble implementing a dynamic URL
defmodule MilitaryFares_3 do require HTTPoison
def search(from, to, outdate1, outdate2) do params = [ method: "search", a: "militaryfares", curr: "USD", lang: "en", client_request: "militaryfares", T1: from, T2: to, T3: to, T4: from, outdate1: outdate1, outdate2: outdate2, D1: 1, D2: 0, D3: 0, D4: 0, D5: 0, cabin: cabin, trip: "round", format: "json", nogroup: 1, master: "militaryfares", owner: 1, curr: "USD" ]
response = HTTPoison.get(@endpoint, params)
case response do
{:ok, %{body: body}} ->
{:ok, Jason.decode(body)}
{:error, _} ->
{:error, "HTTP request failed"}
end
end end
result = MilitaryFares_3.search("BOM", "DXB", "2023-04-13", "2023-04-17")
Militaryfares_Integration_Flight_API_xml.pdf Militaryfares_Integration_Package_API_xml.pdf Militaryfares_Integration_Hotel_API_xml.pdf