How can I get inventory item quantity by calling NETSUITE REST API on postman - api

I am using Postman to testing NETSUITE API.
I have given
Consumer key
Consumer Secret
Access Token
Token Secret
in Authorization OAuth1.0 type.
I called the API "inventoryitem" with item id
**https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155**
and got inventory item details in response..
{
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155"
}
],
"assetAccount": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/216"
}
],
"id": "216",
"refName": "1420 Inventory Asset"
},
"atpmethod": "CUMULATIVE_ATP_WITH_LOOK_AHEAD",
"autoLeadTime": false,
"autoPreferredStockLevel": false,
"autoReorderPoint": false,
"averageCost": 25.5,
"billExchRateVarianceAcct": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/324"
}
],
"id": "324",
"refName": "5017 Bill exchange variance"
},
"billPriceVarianceAcct": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/323"
}
],
"id": "323",
"refName": "5016 Bill Price Variance"
},
"billQtyVarianceAcct": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/322"
}
],
"id": "322",
"refName": "5015 Bill Quantity Variance"
},
"binNumber": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/binNumber"
}
]
},
"class": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/classification/22"
}
],
"id": "22",
"refName": "Healthcare & Nutrition"
},
"cogsAccount": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/217"
}
],
"id": "217",
"refName": "5005 COGS : Cost of Goods Sold"
},
"copyDescription": false,
"cost": 13.4,
"costEstimateType": "AVGCOST",
"costingMethod": "FIFO",
"costingMethodDisplay": "Lot Numbered",
"costUnits": "per Box 12",
"createdDate": "2018-11-20T13:48:00Z",
"currency": {
"links": [],
"id": "British pound",
"refName": "British pound"
},
"custitem1": "511265",
"custitem3": 12,
"custitem_atlas_approved": false,
"custitem_nsts_ep_item_category": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/custitem_nsts_ep_item_category"
}
]
},
"custitem_wmsse_itemfamily": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/customrecord_wmsse_item_family/4"
}
],
"id": "4",
"refName": "Non-Refrigerated Item Family"
},
"custitem_wmsse_itemgroup": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/customrecord_wmsse_itemgroup/2"
}
],
"id": "2",
"refName": "Non-Refrigerated Item Group"
},
"custitem_wmsse_mix_item": true,
"custitem_wmsse_mix_lot": true,
"custitemcustcol4": "250ML",
"customForm": "139",
"custReturnVarianceAccount": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/326"
}
],
"id": "326",
"refName": "4045 CUSTOMER RETURN VARIANCE"
},
"displayName": "DETTOL 12X250ML",
"dontshowprice": false,
"enforceminqtyinternally": true,
"excludefromsitemap": false,
"froogleproductfeed": false,
"handlingCostUnits": "per Box 12",
"id": "155",
"includeChildren": true,
"incomeAccount": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/251"
}
],
"id": "251",
"refName": "4040 Sales : Income"
},
"internalid": 155,
"isdonationitem": false,
"isDropShipItem": false,
"isgcocompliant": false,
"isInactive": false,
"isonline": false,
"isSpecialOrderItem": false,
"itemId": "DETTOL 250ML",
"itemType": "InvtPart",
"itemVendor": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/itemVendor"
}
]
},
"lastModifiedDate": "2020-01-21T18:07:00Z",
"lastPurchasePrice": 24.53,
"locations": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/locations"
}
]
},
"matchBillToReceipt": true,
"minimumquantityUnits": "Box 12",
"nextagproductfeed": false,
"offerSupport": true,
"preferredLocation": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/location/20"
}
],
"id": "20",
"refName": "8905 Highway 50"
},
"productfeed": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/productfeed"
}
]
},
"purchaseDescription": "DETTOL 12X250ML",
"purchaseOrderAmount": 0.1,
"purchaseOrderQuantity": 0.1,
"purchaseUnit": "9",
"quantityReorderUnits": "Quantity On Hand, Reorder Point, Quantity On Order, and Quantity Committed are in Box 12",
"receiptAmount": 0.1,
"receiptQuantity": 0.1,
"salesDescription": "DETTOL 250ML",
"saleUnit": "9",
"seasonalDemand": false,
"shipIndividually": false,
"shippingCostUnits": "per Box 12",
"shoppingproductfeed": false,
"shopzillaproductfeed": false,
"showdefaultdonationamount": false,
"sitecategory": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/sitecategory"
}
]
},
"stockUnit": "9",
"Subsidiary": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventoryitem/155/Subsidiary"
}
]
},
"supplyReplenishmentMethod": "TIME_PHASED",
"taxSchedule": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/"
}
],
"id": "2",
"refName": "Taxable"
},
"totalValue": 3522.66,
"trackLandedCost": true,
"transferPriceUnits": "per Box 12",
"unitsType": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/unitstype/1"
}
],
"id": "1",
"refName": "Each"
},
"upcCode": "50158072",
"useBins": true,
"useMarginalRates": false,
"vendReturnVarianceAccount": {
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/account/325"
}
],
"id": "325",
"refName": "5020 VENDOR RETURN VARIANCE"
},
"weight": 3.0,
"weightUnit": "3",
"weightUnits": "per Box 12",
"yahooproductfeed": false
}
but the item quantity is missing in this detail. I just want to get item quantity and its availability status.
I have also called API "inventorystatus"
https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventorystatus/
and got this detail..
{
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventorystatus?limit=1000&offset=0"
}
],
"count": 2,
"hasMore": false,
"items": [
{
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventorystatus/2"
}
],
"id": "2"
},
{
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventorystatus/1"
}
],
"id": "1"
}
],
"offset": 0,
"totalResults": 2
}
I called API "inventorystatus" with specific item id
**https://1234567.suitetalk.api.netsuite.com/rest/platform/v1/record/inventorystatus/134**
and got this
{
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5",
"title": "Record does not exist.",
"status": 404,
"o:errorCode": "NONEXISTENT_ID"
}
but record is available.
Please anyone tell me which API I should have to use to get item availability status and its available quantity(base units).

NetSuite REST WS are using HATEOAS links to navigate through the resources.
These can be sublists and subrecords. (See NetSuite Help Center: REST Web Services Key Concepts and NetSuite Record Structure).
By default, these resources are not displayed in the request, but you can access them via HATEOAS links or with a query parameter expandSubResources=true.
To answer first part of your question:
If you want to see, for example, quantity in different locations on your Inventory Item, so can send this request:
GET .../v1/record/inventoryitem/155/locations/1
In your second request, so can see that there are two instances of Inventory Status record with IDs 1 and 2. Following request should display you all body fields on that record:
GET .../v1/record/inventorystatus/1

Related

Is it correct to see a different cabin value aside that passed in the get FlightOffers APi as travelerClass?

From the documentation of the Get Route for the flight offers Api, I can add travelerClass as a filter to make a request. If I add say travelerClass as ECONOMY?
I expect to see only offers with ECONOMY. However I see that within the fareDetailsBySegment section in the result, I see that some Offers have their cabin values as other than ECONOMY. I see some with value of BUSINESS while others as PREMIUM_ECONOMY.
Is this proper?
My Concern
I want to be able to get all bookings that where ECONOMY based only. So I need to be sure that the flight offers returned in the first place are strictly limited by the travelerClass.
I will appreciate any clarity on the this issue. Also if there is a better way to go about this concern above, it will be most appreciated.
An example of my request is below:
Amadeus.shopping.flightOffersSearch.get({
originLocationCode: 'SYD',
destinationLocationCode: 'BKK',
departureDate: '2022-11-01',
adults: '1',
travelClass: 'ECONOMY'
}).then(...)
Offer with BUSINESS instead of ECONOMY
{
"type": "flight-offer",
"id": "22",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"oneWay": false,
"lastTicketingDate": "2022-11-01",
"numberOfBookableSeats": 6,
"itineraries": [
{
"duration": "PT28H20M",
"segments": [
{
"departure": {
"iataCode": "SYD",
"terminal": "1",
"at": "2022-11-01T12:00:00"
},
"arrival": {
"iataCode": "PVG",
"terminal": "2",
"at": "2022-11-01T19:30:00"
},
"carrierCode": "MU",
"number": "562",
"aircraft": {
"code": "77W"
},
"operating": {
"carrierCode": "MU"
},
"duration": "PT10H30M",
"id": "13",
"numberOfStops": 0,
"blacklistedInEU": false
},
{
"departure": {
"iataCode": "PVG",
"terminal": "1",
"at": "2022-11-02T08:45:00"
},
"arrival": {
"iataCode": "BKK",
"at": "2022-11-02T12:20:00"
},
"carrierCode": "MU",
"number": "541",
"aircraft": {
"code": "320"
},
"operating": {
"carrierCode": "MU"
},
"duration": "PT4H35M",
"id": "14",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
}
],
"price": {
"currency": "EUR",
"total": "4048.84",
"base": "3858.00",
"fees": [
{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
}
],
"grandTotal": "4048.84"
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": true
},
"validatingAirlineCodes": [
"MU"
],
"travelerPricings": [
{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "EUR",
"total": "4048.84",
"base": "3858.00"
},
"fareDetailsBySegment": [
{
"segmentId": "13",
"cabin": "ECONOMY",
"fareBasis": "YSE0WDNQ",
"class": "Y",
"includedCheckedBags": {
"quantity": 2
}
},
{
"segmentId": "14",
"cabin": "BUSINESS",
"fareBasis": "QSE0WCNL",
"class": "Q",
"includedCheckedBags": {
"quantity": 2
}
}
]
}
]
}
in order to apply the filter for cabin class, I suggest you to try with POST method.
in POST method has more search criteria you can apply, below example is something that I have tried and it works: response only contains ECONOMY classes by updating values under cabinRestrictions.
details of the request model is available in API reference page
amadeus.shopping.flightOffersSearch.post(JSON.stringify({
"currencyCode": "USD",
"originDestinations": [
{
"id": "1",
"originLocationCode": "SYD",
"destinationLocationCode": "BKK",
"departureDateTimeRange": {
"date": "2022-11-01"
}
}
],
"travelers": [
{
"id": "1",
"travelerType": "ADULT"
}
],
"sources": [
"GDS"
],
"searchCriteria": {
"maxFlightOffers": 10,
"flightFilters": {
"cabinRestrictions": [
{
"cabin": "ECONOMY",
"coverage": "ALL_SEGMENTS",
"originDestinationIds": [
1
]
}
]
}
}
})).then(...)

Amadeus Flight Offers Different Prices

We're using flight offers search api and ready to move to prod. But when we search flights with ECONOMY class the prices are not even close to "amadeus.net" search engine results or TK (Turkish Airlines) web site prices. If we use BUSINESS class as a parameter the api results are closer to real prices. How can we solve this issue?
The sample query is: (IST - CGN 25th May ECONOMY and TK Opearated flight departures 16:05 )
/v2/shopping/flight-offers?originLocationCode=IST&destinationLocationCode=CGN&departureDate=2021-05-25&adults=1&travelClass=ECONOMY&includedAirlineCodes=TK&nonStop=true&max=250
The api result is: €206.55
TK Web Site: €121
Amadeus.net €103
Detailed API result:
{
"meta": {
"count": 2,
"links": {
"self": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=IST&destinationLocationCode=CGN&departureDate=2021-05-25&adults=1&travelClass=ECONOMY&includedAirlineCodes=TK&nonStop=true&max=250"
}
},
"data": [
{
"type": "flight-offer",
"id": "2",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"oneWay": false,
"lastTicketingDate": "2021-05-25",
"numberOfBookableSeats": 9,
"itineraries": [
{
"duration": "PT3H20M",
"segments": [
{
"departure": {
"iataCode": "IST",
"at": "2021-05-25T16:05:00"
},
"arrival": {
"iataCode": "CGN",
"terminal": "2",
"at": "2021-05-25T18:25:00"
},
"carrierCode": "TK",
"number": "1675",
"aircraft": {
"code": "321"
},
"operating": {
"carrierCode": "TK"
},
"duration": "PT3H20M",
"id": "2",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
}
],
"price": {
"currency": "EUR",
"total": "206.55",
"base": "134.00",
"fees": [
{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
}
],
"grandTotal": "206.55"
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": true
},
"validatingAirlineCodes": [
"TK"
],
"travelerPricings": [
{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "EUR",
"total": "206.55",
"base": "134.00"
},
"fareDetailsBySegment": [
{
"segmentId": "2",
"cabin": "ECONOMY",
"fareBasis": "QT2PXOW",
"class": "Q",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
}
]
}
]
}
],
"dictionaries": {
"locations": {
"SAW": {
"cityCode": "IST",
"countryCode": "TR"
},
"CGN": {
"cityCode": "CGN",
"countryCode": "DE"
},
"IST": {
"cityCode": "IST",
"countryCode": "TR"
}
},
"aircraft": {
"321": "AIRBUS A321",
"738": "BOEING 737-800"
},
"currencies": {
"EUR": "EURO"
},
"carriers": {
"TK": "TURKISH AIRLINES"
}
}
}
Thanks in advance
There are two reasons why you see different prices:
The Self-Service APIs return published airfares coming from the GDS and not any negotiated ones. That means the flights returned by the APIs can be more expensive than the ones you find in OTAs or airline websites.
In the test environment that you are using, you get access to cached flight data which might be different from the live prices.

extra bag information is missing in the flight offer price response

I'm testing self-service APIs. I wonder if this is a bug:
I make a search request, and the response contains the extra bag information in the flight-offer/price/additionalServices
Then I make the offer price request by adding include=bags parameter in the path of Flight Offers Price API.
However there is no any bags information in the response, neither in the offer/price/additionalServices, nor in the included/.
I still try to create order by adding the extra bag. So I use the extra bag information that I got at step 1 (search response). And the order is created successfully.
It seems that the extra bag information is missing in step 2 (response of flight offer price), is it a bug?
Here is an example of my test to reproduce the issue:
search request
{
"currencyCode": "EUR",
"originDestinations": [
{
"id": "1",
"originLocationCode": "PAR",
"destinationLocationCode": "NYC",
"departureDateTimeRange": {
"date": "2020-08-20",
"time": "10:00:00"
}
}
],
"travelers": [
{
"id": "1",
"travelerType": "ADULT"
}
],
"sources": [
"GDS"
],
"searchCriteria": {
"maxFlightOffers": 3
}
}
Then I select the second offer in the response to make a offer price request using include=bags parameter
{
"type": "flight-offer",
"id": "2",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"oneWay": false,
"lastTicketingDate": "2020-08-13",
"numberOfBookableSeats": 8,
"itineraries": [
{
"duration": "PT8H15M",
"segments": [
{
"departure": {
"iataCode": "ORY",
"terminal": "4",
"at": "2020-08-20T19:45:00"
},
"arrival": {
"iataCode": "EWR",
"terminal": "B",
"at": "2020-08-20T22:00:00"
},
"carrierCode": "TX",
"number": "6720",
"aircraft": {
"code": "359"
},
"operating": {
"carrierCode": "BF"
},
"duration": "PT8H15M",
"id": "3",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
}
],
"price": {
"currency": "EUR",
"total": "149.44",
"base": "41.00",
"fees": [
{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
}
],
"grandTotal": "149.44",
"additionalServices": [
{
"amount": "70.00",
"type": "CHECKED_BAGS"
}
]
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": false
},
"validatingAirlineCodes": [
"TX"
],
"travelerPricings": [
{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "EUR",
"total": "149.44",
"base": "41.00"
},
"fareDetailsBySegment": [
{
"segmentId": "3",
"cabin": "ECONOMY",
"fareBasis": "ULBCOWFR",
"brandedFare": "EBASIC",
"class": "U",
"includedCheckedBags": {
"quantity": 0
}
}
]
}
]
}
There is no extra bag in the response.
Thanks

Bot duplicates user messages when I use DirectLine channel

I am using bot framework v4. I have developed a chatbot using .Net Core. The bot is integrated with LUIS and Qna Maker. One issue I am facing is that the bot duplicates the message that comes from the user. Please look at the screenshot below:
The replies I get from the bot are perfectly fine. The flow of the bot is as intended. I just cannot figure out why the message from user is being duplicated. I am using DirectLine for this. I will share whatever code part is needed.
{
"activities": [
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000000",
"timestamp": "2019-12-02T19:41:57.1284328Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "https://i.imgur.com/ViaEUnA.png"
}
]
}
],
"horizontalAlignment": "Center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "Welcome to CIVIC Financial Services",
"wrap": true
},
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "I am S.U.E",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "I can help you answer your questions. Familiarize yourself with CIVIC Financial Services.",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "If you want to talk to a Customer Service Agent, just type \"I want to talk to a Customer Service Agent\".",
"wrap": true
}
],
"separator": true,
"horizontalAlignment": "Left"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"data": {
"action": "aboutCivic"
},
"title": "About CIVIC"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"actions": [
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "We are open from Monday through Friday from 8:00am to 6:00pm.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "When are you open?"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Image",
"size": "stretch",
"url": "https://i.imgur.com/gBVgI25.png",
"horizontalAlignment": "center"
},
{
"type": "TextBlock",
"text": "AZ, CA, CO, FL, GA, HI, NC, NV, OR, SC, TN, TX, UT, VA & WA",
"wrap": true
}
],
"style": "emphasis"
},
"title": "Do you have an office near me? "
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "8 to 10 days, it all depends on how it takes to get access to the property.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "How quickly can we close? "
}
],
"style": "emphasis"
},
"title": "FAQs"
}
]
}
}
],
"entities": [],
"replyToId": "8WGOnspSxN3"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000001",
"timestamp": "2019-12-02T19:43:39.96502Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"entities": [
{
"type": "ClientCapabilities",
"requiresBotState": true,
"supportsListening": true,
"supportsTts": true
}
],
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000002",
"timestamp": "2019-12-02T19:43:41.7278914Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000001"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000003",
"timestamp": "2019-12-02T20:00:25.784598Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "helo",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000004",
"timestamp": "2019-12-02T20:00:26.5739342Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000003"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000005",
"timestamp": "2019-12-02T20:00:27.3293896Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "hello",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000006",
"timestamp": "2019-12-02T20:00:27.6064185Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Hello",
"inputHint": "acceptingInput",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000005"
}
],
"watermark": "6"
}

How to expand tree node without ajax request?

I am using Extjs tree, i got problem with click on nested node ajax request to server, i know this kind of lazy load but my tree is not big, around 35 items so i want request to server time only to collect all tree node and items.
Any idea?
View:
Ext.define('CRM.view.role.RoleTree' ,{
extend: 'Ext.tree.Panel',
alias: 'widget.roleTreeList',
id:'tree-role-panel',
split: false,
autoScroll: true,
lines: true,
singleExpand: false,
store: 'RoleList'
})
Store:
Ext.define('CRM.store.RoleList', {
extend: 'Ext.data.TreeStore',
storeId: 'RoleTreeStoreId',
//model: 'CRM.model.RoleList',
autoLoad: false,
proxy: {
type : 'ajax',
url : 'index.php/role/getRoleList',
async : false,
reader: {
type : 'json',
method : 'POST'
}
},
root:{
expanded:true,
text:"Organization",
leaf:'false',
id : '/',
}
})
Json return:
{
"text": "Organization",
"id": "role-1",
"children": [
{
"text": "Admin",
"id": "role-12",
"expanded": "true",
"children": [
{
"text": "MSD",
"id": "role-23",
"children": [
{
"text": "Customer Care Manager",
"id": "role-4",
"children": [
{
"text": "Customer Care Adviser",
"id": "role-5"
}
]
},
{
"text": "Solution Adviser",
"id": "role-7"
},
{
"text": "Sales Manager",
"id": "role-31",
"children": [
{
"text": "Solution Sales",
"id": "role-6"
},
{
"text": "Teritory 01 - Safy",
"id": "role-9",
"children": [
{
"text": "Sales Person 01",
"id": "role-10"
},
{
"text": "Sales Trainee 01",
"id": "role-26"
}
]
},
{
"text": "Teritory 3 - Sambo",
"id": "role-11",
"children": [
{
"text": "Sales Person 3",
"id": "role-13"
}
]
},
{
"text": "Teritory 4 - Narong",
"id": "role-14",
"children": [
{
"text": "Sales Team 4",
"id": "role-15",
"children": [
{
"text": "Sales Person 4",
"id": "role-25"
}
]
}
]
},
{
"text": "branch shv",
"id": "role-16",
"children": [
{
"text": "sales shv",
"id": "role-19"
}
]
},
{
"text": "branch btb",
"id": "role-17",
"children": [
{
"text": "sales btb",
"id": "role-20"
}
]
},
{
"text": "branch srp",
"id": "role-18",
"children": [
{
"text": "sales srp",
"id": "role-21",
"children": [
{
"text": "sales person srp",
"id": "role-28"
}
]
}
]
},
{
"text": "Retention Program",
"id": "role-22",
"children": [
{
"text": "Retention Program Analysist",
"id": "role-24"
}
]
},
{
"text": "Sales Trainee",
"id": "role-27"
},
{
"text": "Enterprise Sales Engineer",
"id": "role-29"
},
{
"text": "Meas Test",
"id": "role-30"
},
{
"text": "Teritory 02 - Kol",
"id": "role-32",
"children": [
{
"text": "Sales Person 02",
"id": "role-8"
}
]
}
]
}
]
},
{
"text": "CTO",
"id": "role-35",
"children": [
{
"text": "Support Manager",
"id": "role-2",
"children": [
{
"text": "Technical Support Adviser",
"id": "role-3"
}
]
},
{
"text": "IT BIlling Product Manager",
"id": "role-33",
"children": [
{
"text": "IT Staff",
"id": "role-34"
}
]
}
]
},
{
"text": "Business Consultant",
"id": "role-36"
}
]
}
]
}
You can still use asynchronous call, but only once. To make sure only one call is made, return all children in first call. Extjs will load all children provided.
I found my mistake with JSON, i should add property "leaf = true/false" according has child or hasn't.