Not all JSON data showing in data tree

I have a json file. Using json datasource. connects fine but does not show all the data. It stops at flightSegment. Does not show “departure”, “arrival” downward. I am just using a repeat region.

below is the json.

{
“data”: [
{
“type”: “flight-offer”,
“id”: “1579455803870-1217474879”,
“offerItems”: [
{
“services”: [
{
“segments”: [
{
“flightSegment”: {
“departure”: {
“iataCode”: “EWR”,
“terminal”: “B”,
“at”: “2020-04-20T20:45:00-04:00”
},
“arrival”: {
“iataCode”: “MCO”,
“at”: “2020-04-20T23:38:00-04:00”
},
“carrierCode”: “NK”,
“number”: “1159”,
“aircraft”: {
“code”: “32B”
},
“operating”: {
“carrierCode”: “NK”,
“number”: “1159”
},
“duration”: “0DT2H53M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “Y”,
“availability”: 4,
“fareBasis”: “YHO”
}
},
{
“flightSegment”: {
“departure”: {
“iataCode”: “MCO”,
“at”: “2020-04-21T06:00:00-04:00”
},
“arrival”: {
“iataCode”: “ORD”,
“terminal”: “3”,
“at”: “2020-04-21T08:09:00-05:00”
},
“carrierCode”: “NK”,
“number”: “910”,
“aircraft”: {
“code”: “32A”
},
“operating”: {
“carrierCode”: “NK”,
“number”: “910”
},
“duration”: “0DT3H9M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “K”,
“availability”: 4,
“fareBasis”: “KA7NR”
}
}
]
}
],
“price”: {
“total”: “509.64”,
“totalTaxes”: “59.64”
},
“pricePerAdult”: {
“total”: “509.64”,
“totalTaxes”: “59.64”
}
}
]
},
{
“type”: “flight-offer”,
“id”: “1579455803870–1050833299”,
“offerItems”: [
{
“services”: [
{
“segments”: [
{
“flightSegment”: {
“departure”: {
“iataCode”: “EWR”,
“terminal”: “A”,
“at”: “2020-04-20T18:56:00-04:00”
},
“arrival”: {
“iataCode”: “BOS”,
“terminal”: “C”,
“at”: “2020-04-20T20:14:00-04:00”
},
“carrierCode”: “B6”,
“number”: “2680”,
“aircraft”: {
“code”: “E90”
},
“operating”: {
“carrierCode”: “B6”,
“number”: “2680”
},
“duration”: “0DT1H18M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “L”,
“availability”: 9,
“fareBasis”: “PL2AUEL1”
}
},
{
“flightSegment”: {
“departure”: {
“iataCode”: “BOS”,
“terminal”: “C”,
“at”: “2020-04-20T21:49:00-04:00”
},
“arrival”: {
“iataCode”: “ORD”,
“terminal”: “2”,
“at”: “2020-04-20T23:38:00-05:00”
},
“carrierCode”: “B6”,
“number”: “211”,
“aircraft”: {
“code”: “E90”
},
“operating”: {
“carrierCode”: “B6”,
“number”: “211”
},
“duration”: “0DT2H49M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “L”,
“availability”: 9,
“fareBasis”: “PL2AUEL1”
}
}
]
}
],
“price”: {
“total”: “93.97”,
“totalTaxes”: “25.97”
},
“pricePerAdult”: {
“total”: “93.97”,
“totalTaxes”: “25.97”
}
}
]
},
{
“type”: “flight-offer”,
“id”: “1579455803870–613040172”,
“offerItems”: [
{
“services”: [
{
“segments”: [
{
“flightSegment”: {
“departure”: {
“iataCode”: “EWR”,
“terminal”: “C”,
“at”: “2020-04-20T05:30:00-04:00”
},
“arrival”: {
“iataCode”: “ORD”,
“terminal”: “1”,
“at”: “2020-04-20T07:02:00-05:00”
},
“carrierCode”: “UA”,
“number”: “580”,
“aircraft”: {
“code”: “73G”
},
“operating”: {
“carrierCode”: “UA”,
“number”: “580”
},
“duration”: “0DT2H32M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “G”,
“availability”: 9,
“fareBasis”: “GAA4JHDN”
}
}
]
}
],
“price”: {
“total”: “111.81”,
“totalTaxes”: “19.81”
},
“pricePerAdult”: {
“total”: “111.81”,
“totalTaxes”: “19.81”
}
}
]
},
{
“type”: “flight-offer”,
“id”: “1579455803870-1867567722”,
“offerItems”: [
{
“services”: [
{
“segments”: [
{
“flightSegment”: {
“departure”: {
“iataCode”: “EWR”,
“terminal”: “C”,
“at”: “2020-04-20T06:30:00-04:00”
},
“arrival”: {
“iataCode”: “ORD”,
“terminal”: “1”,
“at”: “2020-04-20T08:05:00-05:00”
},
“carrierCode”: “UA”,
“number”: “1071”,
“aircraft”: {
“code”: “739”
},
“operating”: {
“carrierCode”: “UA”,
“number”: “1071”
},
“duration”: “0DT2H35M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “G”,
“availability”: 9,
“fareBasis”: “GAA4JHDN”
}
}
]
}
],
“price”: {
“total”: “111.81”,
“totalTaxes”: “19.81”
},
“pricePerAdult”: {
“total”: “111.81”,
“totalTaxes”: “19.81”
}
}
]
},
{
“type”: “flight-offer”,
“id”: “1579455803870-363282806”,
“offerItems”: [
{
“services”: [
{
“segments”: [
{
“flightSegment”: {
“departure”: {
“iataCode”: “EWR”,
“terminal”: “A”,
“at”: “2020-04-20T14:34:00-04:00”
},
“arrival”: {
“iataCode”: “BOS”,
“terminal”: “C”,
“at”: “2020-04-20T15:48:00-04:00”
},
“carrierCode”: “B6”,
“number”: “918”,
“aircraft”: {
“code”: “E90”
},
“operating”: {
“carrierCode”: “B6”,
“number”: “918”
},
“duration”: “0DT1H14M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “L”,
“availability”: 9,
“fareBasis”: “PL2AUEL1”
}
},
{
“flightSegment”: {
“departure”: {
“iataCode”: “BOS”,
“terminal”: “C”,
“at”: “2020-04-20T18:56:00-04:00”
},
“arrival”: {
“iataCode”: “ORD”,
“terminal”: “2”,
“at”: “2020-04-20T20:57:00-05:00”
},
“carrierCode”: “B6”,
“number”: “1011”,
“aircraft”: {
“code”: “E90”
},
“operating”: {
“carrierCode”: “B6”,
“number”: “1011”
},
“duration”: “0DT3H1M”
},
“pricingDetailPerAdult”: {
“travelClass”: “ECONOMY”,
“fareClass”: “L”,
“availability”: 9,
“fareBasis”: “PL2AUEL1”
}
}
]
}
],
“price”: {
“total”: “93.97”,
“totalTaxes”: “25.97”
},
“pricePerAdult”: {
“total”: “93.97”,
“totalTaxes”: “25.97”
}
}
]
}
],
“dictionaries”: {
“carriers”: {
“B6”: “JETBLUE AIRWAYS”,
“UA”: “UNITED AIRLINES”,
“NK”: “SPIRIT AIRLINES”
},
“currencies”: {
“EUR”: “EURO”
},
“aircraft”: {
“739”: “BOEING 737-900”,
“32A”: “AIRBUS INDUSTRIE A320 SHARKLETS”,
“32B”: “AIRBUS INDUSTRIE A321 SHARKLETS”,
“73G”: “BOEING 737-700”,
“E90”: “EMBRAER 190”
},
“locations”: {
“ORD”: {
“subType”: “AIRPORT”,
“detailedName”: “O HARE INTERNATIONAL”
},
“EWR”: {
“subType”: “AIRPORT”,
“detailedName”: “NEWARK LIBERTY INTL”
},
“BOS”: {
“subType”: “AIRPORT”,
“detailedName”: “EDWARD L LOGAN INTL”
},
“MCO”: {
“subType”: “AIRPORT”,
“detailedName”: “ORLANDO INTL”
}
}
},
“meta”: {
“links”: {
“self”: “https://test.api.amadeus.com/v1/shopping/flight-offers?origin=EWR&destination=ord&departureDate=2020-04-20&adults=1&nonStop=false&max=5
},
“currency”: “EUR”,
“defaults”: {
“nonStop”: false,
“adults”: 1
}
}
}

Hey Steven,

I copied your json over, and replaced the smart quotes with regular double quotes and it loads fine into Wappler. If you haven’t replaced the smart quotes, you might give that a try.

–Ken

My problem is this is how it returns from the api. Also I just replace with smart quotes and still doesn’t show departures and arrivals. Can you post what you are using?

Well if it truly has smart quotes, that would be unusual. If you want to dm me how to connect the api, I can try it out myself.

I’m just loading it in via file json data source

<!doctype html>
<html><head>
<script src="dmxAppConnect/dmxAppConnect.js"></script>
<meta charset="UTF-8">
<title>Untitled Document</title>
<!-- New Wappler Page -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
</head>
<body is="dmx-app" id="index">
<div class="container">
<div class="row" is="dmx-repeat" id="repeat1"></div>
</div>
<dmx-json-datasource id="jsonDS1" is="dmx-serverconnect" url="../../Desktop/test.json"></dmx-json-datasource>

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body></html>

thank you, but I was referring to the json data.

{
"data": [
{
"type": "flight-offer",
"id": "1579455803870-1217474879",
"offerItems": [
{
"services": [
{
"segments": [
{
"flightSegment": {
"departure": {
"iataCode": "EWR",
"terminal": "B",
"at": "2020-04-20T20:45:00-04:00"
},
"arrival": {
"iataCode": "MCO",
"at": "2020-04-20T23:38:00-04:00"
},
"carrierCode": "NK",
"number": "1159",
"aircraft": {
"code": "32B"
},
"operating": {
"carrierCode": "NK",
"number": "1159"
},
"duration": "0DT2H53M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "Y",
"availability": 4,
"fareBasis": "YHO"
}
},
{
"flightSegment": {
"departure": {
"iataCode": "MCO",
"at": "2020-04-21T06:00:00-04:00"
},
"arrival": {
"iataCode": "ORD",
"terminal": "3",
"at": "2020-04-21T08:09:00-05:00"
},
"carrierCode": "NK",
"number": "910",
"aircraft": {
"code": "32A"
},
"operating": {
"carrierCode": "NK",
"number": "910"
},
"duration": "0DT3H9M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "K",
"availability": 4,
"fareBasis": "KA7NR"
}
}
]
}
],
"price": {
"total": "509.64",
"totalTaxes": "59.64"
},
"pricePerAdult": {
"total": "509.64",
"totalTaxes": "59.64"
}
}
]
},
{
"type": "flight-offer",
"id": "1579455803870–1050833299",
"offerItems": [
{
"services": [
{
"segments": [
{
"flightSegment": {
"departure": {
"iataCode": "EWR",
"terminal": "A",
"at": "2020-04-20T18:56:00-04:00"
},
"arrival": {
"iataCode": "BOS",
"terminal": "C",
"at": "2020-04-20T20:14:00-04:00"
},
"carrierCode": "B6",
"number": "2680",
"aircraft": {
"code": "E90"
},
"operating": {
"carrierCode": "B6",
"number": "2680"
},
"duration": "0DT1H18M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "L",
"availability": 9,
"fareBasis": "PL2AUEL1"
}
},
{
"flightSegment": {
"departure": {
"iataCode": "BOS",
"terminal": "C",
"at": "2020-04-20T21:49:00-04:00"
},
"arrival": {
"iataCode": "ORD",
"terminal": "2",
"at": "2020-04-20T23:38:00-05:00"
},
"carrierCode": "B6",
"number": "211",
"aircraft": {
"code": "E90"
},
"operating": {
"carrierCode": "B6",
"number": "211"
},
"duration": "0DT2H49M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "L",
"availability": 9,
"fareBasis": "PL2AUEL1"
}
}
]
}
],
"price": {
"total": "93.97",
"totalTaxes": "25.97"
},
"pricePerAdult": {
"total": "93.97",
"totalTaxes": "25.97"
}
}
]
},
{
"type": "flight-offer",
"id": "1579455803870–613040172",
"offerItems": [
{
"services": [
{
"segments": [
{
"flightSegment": {
"departure": {
"iataCode": "EWR",
"terminal": "C",
"at": "2020-04-20T05:30:00-04:00"
},
"arrival": {
"iataCode": "ORD",
"terminal": "1",
"at": "2020-04-20T07:02:00-05:00"
},
"carrierCode": "UA",
"number": "580",
"aircraft": {
"code": "73G"
},
"operating": {
"carrierCode": "UA",
"number": "580"
},
"duration": "0DT2H32M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "G",
"availability": 9,
"fareBasis": "GAA4JHDN"
}
}
]
}
],
"price": {
"total": "111.81",
"totalTaxes": "19.81"
},
"pricePerAdult": {
"total": "111.81",
"totalTaxes": "19.81"
}
}
]
},
{
"type": "flight-offer",
"id": "1579455803870-1867567722",
"offerItems": [
{
"services": [
{
"segments": [
{
"flightSegment": {
"departure": {
"iataCode": "EWR",
"terminal": "C",
"at": "2020-04-20T06:30:00-04:00"
},
"arrival": {
"iataCode": "ORD",
"terminal": "1",
"at": "2020-04-20T08:05:00-05:00"
},
"carrierCode": "UA",
"number": "1071",
"aircraft": {
"code": "739"
},
"operating": {
"carrierCode": "UA",
"number": "1071"
},
"duration": "0DT2H35M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "G",
"availability": 9,
"fareBasis": "GAA4JHDN"
}
}
]
}
],
"price": {
"total": "111.81",
"totalTaxes": "19.81"
},
"pricePerAdult": {
"total": "111.81",
"totalTaxes": "19.81"
}
}
]
},
{
"type": "flight-offer",
"id": "1579455803870-363282806",
"offerItems": [
{
"services": [
{
"segments": [
{
"flightSegment": {
"departure": {
"iataCode": "EWR",
"terminal": "A",
"at": "2020-04-20T14:34:00-04:00"
},
"arrival": {
"iataCode": "BOS",
"terminal": "C",
"at": "2020-04-20T15:48:00-04:00"
},
"carrierCode": "B6",
"number": "918",
"aircraft": {
"code": "E90"
},
"operating": {
"carrierCode": "B6",
"number": "918"
},
"duration": "0DT1H14M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "L",
"availability": 9,
"fareBasis": "PL2AUEL1"
}
},
{
"flightSegment": {
"departure": {
"iataCode": "BOS",
"terminal": "C",
"at": "2020-04-20T18:56:00-04:00"
},
"arrival": {
"iataCode": "ORD",
"terminal": "2",
"at": "2020-04-20T20:57:00-05:00"
},
"carrierCode": "B6",
"number": "1011",
"aircraft": {
"code": "E90"
},
"operating": {
"carrierCode": "B6",
"number": "1011"
},
"duration": "0DT3H1M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "L",
"availability": 9,
"fareBasis": "PL2AUEL1"
}
}
]
}
],
"price": {
"total": "93.97",
"totalTaxes": "25.97"
},
"pricePerAdult": {
"total": "93.97",
"totalTaxes": "25.97"
}
}
]
}
],
"dictionaries": {
"carriers": {
"B6": "JETBLUE AIRWAYS",
"UA": "UNITED AIRLINES",
"NK": "SPIRIT AIRLINES"
},
"currencies": {
"EUR": "EURO"
},
"aircraft": {
"739": "BOEING 737-900",
"32A": "AIRBUS INDUSTRIE A320 SHARKLETS",
"32B": "AIRBUS INDUSTRIE A321 SHARKLETS",
"73G": "BOEING 737-700",
"E90": "EMBRAER 190"
},
"locations": {
"ORD": {
"subType": "AIRPORT",
"detailedName": "O HARE INTERNATIONAL"
},
"EWR": {
"subType": "AIRPORT",
"detailedName": "NEWARK LIBERTY INTL"
},
"BOS": {
"subType": "AIRPORT",
"detailedName": "EDWARD L LOGAN INTL"
},
"MCO": {
"subType": "AIRPORT",
"detailedName": "ORLANDO INTL"
}
}
},
"meta": {
"links": {
"self": "https://test.api.amadeus.com/v1/shopping/flight-offers?origin=EWR&destination=ord&departureDate=2020-04-20&adults=1&nonStop=false&max=5"
},
"currency": "EUR",
"defaults": {
"nonStop": false,
"adults": 1
}
}
}

OK that works thanks. Is there any way Wappler can convert the data or some sort of workaround?

You could do a string replacement, but I’d still be really surprised if those smart quotes are being sent over in the api.

I am actually pulling it from a php using curl page as I cannot figure out how to get the oauth working with Wappler. That would be my ultimate goal to have the Oauth working but have given up.

Is there a way to send a private message to send my php script? seems to work fine with other json validation/testing solutions. The smart quotes only see to happen when I paste them into this page. Uploading the file. still not working. Not sure what you did besides the quotes if anything. 1.zip (1.8 KB)

The quotes are not the problem, they are converted here in the forum. You should paste them between ``` to format it as code, then it doesn’t convert the quotes.

Did you define the API Schema, without it Wappler doesn’t know what the API returns and you see no data in the data picker.

It gets the schema. Most of it shows up. I cannot get the api to work with the connector. I found this post which is helpful for getting the token, but cannot get the data back after that. There is limited documentation on the api and oauth.

How to get an Amadeus Access token for API use

Any guidance on this would be greatly appreciated. I get error Server returned code: 0 Error: error. in the Parse error on line 1. Expecting 'String, ‘Number’, ‘Null’, ‘True’, ‘False’, ‘{’, ‘[’, got ‘EOF’.

I signed up for an account and was able to create the following server api action that uses a token previously received since you seem to have that pieces.

This was for the flight offers endpoint:

Each endpoint will have its own parameters, but this should give you a starting point on how to access things.

Thanks for this. I do get data back when I manually put in the Authorization, but when I put it in dynamically it does not work. Bearer token. Not sure how to dynamically add the token that is returned without an error. Any ideas?

thanks

If you use the “Define API Schema” on the api action that retrieves the token, then you will be able to grab it using the data picker. If using /v1/security/oauth2/token then it will be:

Bearer {{myaccesstoken.data.access_token}}

Keep in mind that you don’t want to be retrieving a new token on every api call, so once you get this working you will want to securely store the token and only get a new one when it has expired.

1 Like

When I put in Bearer {{myaccesstoken.data.access_token}} I get back

{
“error”: “invalid_request”,
“error_description”: “Mandatory grant_type form parameter missing”,
“code”: 38187,
“title”: “Invalid parameters”
}

grant_type is in there, and again works when I manually put in the token.

Try using my exact example.

I am accessing a different flight search which I need to make work. If I follow your example it works putting the token in manually like you do. The problem I am having is getting the token to return dynamically. It really doesn’t help if I have to enter the token in manually every time I do a query. Does it work for you dynamically? Am I doing the server connect correctly putting the token post first then the search query? Your example does not show the steps. I can also try your query, but the url is truncated for the endpoint. Cannot seem to find that on Amadeus.

Sorry but really have spent a ton of time trying to get this to work. If I do a curl request it works fine.

Attached is a file that works with a dynamic token.

Just put in your client id and client secret on the first action, and then run it.

amadeus.php.zip (2.3 KB)

1 Like