Sending array json body with arrays inside of it (Alamofire, Swift, iOS) - json

i want to send json body to my middleware. at first, it works well (note that the "tema" & "emailGroup" wasn't an array). but after some changes on my backend, i have to send this type of json
[{
"ID": "",
"Name": "Artikel BU CE - Visit HoB Topic",
"ChannelType": 0,
"PublishDate": "2018-09-21T01:00:00Z",
"Headline": null,
"Content": null,
"EmailSubject": null,
"EmailUrl": null,
"Mention": null,
"PostLink": null,
"ChannelActivityMobileId": null,
"HashTag": null,
"Tema": [
{
"Value": 6
}
],
"EmailGroup": [
{
"ID": "2c53ea1f-6ebe-e811-a977-000d3aa00fc2",
"Name": "TV Broadcast",
"List_EmailListModels": null
}
],
"ApprovalStatus": 0,
"ApprovalNote": null,
"EmployeeId": null,
"EmployeeLevel": 0
}]
here's my code
let parameters = [["ID" : "", SerializationKeys.channelMobileId : channel.mobileId, SerializationKeys.name : activity.activityName, "ApprovalStatus" : channel.channelStatus, SerializationKeys.channelType : channel.channelType, SerializationKeys.publish_date : channel.publishDate, SerializationKeys.content : channel.content, SerializationKeys.emailSubject : channel.emailSubject, SerializationKeys.emailURL : channel.emailURL, SerializationKeys.hashtag : channel.hastag, SerializationKeys.mention : channel.mention, SerializationKeys.note : channel.note, SerializationKeys.postLink : channel.postLink, SerializationKeys.tema : [tema]] as [[String : Any]]
where tema is
var tema = [String : Int]()
i got an error that says
[Any] is not convertible to '[[String : Any]]'; did you mean to use as! to force downcast?
and after i change "as" to "as!", it says
Excpected ";" separator
where the semicolon should put near "SerializationKeys.tema : [tema]". Please kindly help me. Thanks
EDIT

I think you mistakenly added ] near
, SerializationKeys.postLink : channel.postLink],
You may want this
let parameters:[[String:Any]] = [["ID" : "",
SerializationKeys.channelMobileId : channel.mobileId,
SerializationKeys.name : activity.activityName,
"ApprovalStatus" : channel.channelStatus,
SerializationKeys.channelType : channel.channelType,
SerializationKeys.publish_date : channel.publishDate,
SerializationKeys.content : channel.content,
SerializationKeys.emailSubject : channel.emailSubject,
SerializationKeys.emailURL : channel.emailURL,
SerializationKeys.hashtag : channel.hastag,
SerializationKeys.mention : channel.mention,
SerializationKeys.note : channel.note,
SerializationKeys.postLink : channel.postLink,
SerializationKeys.tema : [tema]
]]
Note: I heighly recommend using Codable with struct models for your case

Related

Transforming JSON data and child objects into rows within MSSQL

My very first question after using this site for my own learning! Still a beginner so go easy on me :)
I am trying to format JSON data within MSSQL Server. I have a static JSON file which I can get to display via OPENROWSET, and populate a variable. This JSON file has a "header" and then one or more "child" rows, basically an order header and order detail lines. I can successfully separately display the header's columns as a table in a result-set. I'd like to do the same with just the detail lines - the aim being to then store the header in a table and it's details in a table within SQL server - this part I'll have no issue with.
Here is some mock-up JSON data that I'm working with. This is the exact format I need to use, so I don't have any room to manoeuvre with it but I've populated it with test data:
{
"InputParameters" : {
"P_IN_ORDER_SOURCE" : "The_Web",
"P_IN_ORIG_SYS_DOCUMENT_REF" : "Order666",
"P_IN_SOLD_TO_CUST_NUMBER" : "JOEB11",
"P_IN_CUST_ORDER_NUMBER" : "JoeB5556667",
"P_IN_REQUEST_DATE" : "2021-01-20 08:10:06",
"P_IN_ORDER_ENTRY_DATE" : "2021-01-20 08:10:06",
"P_IN_SHIPTO_NAME" : "The Testing Co.",
"P_IN_SHIPTO_ADDR" : "82 Annweir Crescent",
"P_IN_SHIPTO_ADDR_2" : null,
"P_IN_SHIPTO_CITY" : "Atlantis",
"P_IN_SHIPTO_STATE" : "WSX",
"P_IN_SHIPTO_ZIP" : "AT55 666",
"P_IN_SHIPTO_COUNTRY" : "GB",
"P_IN_OPERATION_CODE" : "CREATE",
"P_IN_BOOKED_FLAG" : "N",
"P_IN_OU_NAME" : "ATL UK OU",
"P_IN_SPECIAL_INSTRUCTIONS" : null,
"P_IN_QUOTE_NUMBER" : null,
"P_IN_PRICELIST_ID" : "8",
"P_IN_EMAIL" : "testemail#testemail.com",
"P_IN_SHIPTO_COUNTY" : null,
"P_IN_SHIPPING_METHOD" : "Pre 930",
"P_IN_SHIPPING_INSTRUCTIONS" : null,
"P_IN_ATTENTION_TO" : "Joe Bloggs",
"P_IN_FREIGHT_CARRIER_CODE" : null,
"P_IN_IS_RETURN" : null,
"P_IN_SALES_REP" : null,
"P_IN_LINE_DATA" : [ {
"P_IN_LINE_DATA_ITEM" : [ {
"ORIG_SYS_DOCUMENT_REF" : "Order666",
"ORIG_SYS_LINE_REF" : "1",
"CUSTOMER_LINE_NUMBER" : "1",
"ITEM_TYPE_CODE" : "STANDARD",
"ITEM_DESCRIPTION" : "SKU7776",
"USER_ITEM_DESCRIPTION" : "SKU7776",
"TOP_MODEL_LINE_REF" : null,
"LINK_TO_LINE_REF" : null,
"COMPONENT_CODE" : null,
"ORDERED_QUANTITY" : "6",
"ORDER_QUANTITY_UOM" : null,
"UNIT_LIST_PRICE" : "16.95",
"UNIT_SELLING_PRICE" : "16.95",
"CALCULATE_PRICE_FLAG" : "N",
"OPERATION_CODE" : "INSERT"
}, {
"ORIG_SYS_DOCUMENT_REF" : "Order666",
"ORIG_SYS_LINE_REF" : "2",
"CUSTOMER_LINE_NUMBER" : "2",
"ITEM_TYPE_CODE" : "STANDARD",
"ITEM_DESCRIPTION" : "SKU12345",
"USER_ITEM_DESCRIPTION" : "SKU12345",
"TOP_MODEL_LINE_REF" : null,
"LINK_TO_LINE_REF" : null,
"COMPONENT_CODE" : null,
"ORDERED_QUANTITY" : "6",
"ORDER_QUANTITY_UOM" : null,
"UNIT_LIST_PRICE" : "11.89",
"UNIT_SELLING_PRICE" : "11.89",
"CALCULATE_PRICE_FLAG" : "N",
"OPERATION_CODE" : "INSERT"
}, {
"ORIG_SYS_DOCUMENT_REF" : "Order666",
"ORIG_SYS_LINE_REF" : "3",
"CUSTOMER_LINE_NUMBER" : "3",
"ITEM_TYPE_CODE" : "STANDARD",
"ITEM_DESCRIPTION" : "SKU9999",
"USER_ITEM_DESCRIPTION" : "SKU9999",
"TOP_MODEL_LINE_REF" : null,
"LINK_TO_LINE_REF" : null,
"COMPONENT_CODE" : null,
"ORDERED_QUANTITY" : "8",
"ORDER_QUANTITY_UOM" : null,
"UNIT_LIST_PRICE" : "46.42",
"UNIT_SELLING_PRICE" : "46.42",
"CALCULATE_PRICE_FLAG" : "N",
"OPERATION_CODE" : "INSERT"
} ]
} ]
}
}
I've been trying to learn how to use this JSON with SQL server pretty much starting from today. I've explored the OPENJSON() function which like I've said, I can define the separate columns and path with the header information - but as soon as I try to do similar and path to the detail objects, I just get NULLs back in each column.
Any suggestions at all? Apologies if I've missed any key information out here! Many thanks!
Something like this:
declare #json nvarchar(max) = '
{
"InputParameters" : {
"P_IN_ORDER_SOURCE" : "The_Web",
"P_IN_ORIG_SYS_DOCUMENT_REF" : "Order666",
"P_IN_SOLD_TO_CUST_NUMBER" : "JOEB11",
"P_IN_CUST_ORDER_NUMBER" : "JoeB5556667",
"P_IN_REQUEST_DATE" : "2021-01-20 08:10:06",
"P_IN_ORDER_ENTRY_DATE" : "2021-01-20 08:10:06",
"P_IN_SHIPTO_NAME" : "The Testing Co.",
"P_IN_SHIPTO_ADDR" : "82 Annweir Crescent",
"P_IN_SHIPTO_ADDR_2" : null,
"P_IN_SHIPTO_CITY" : "Atlantis",
"P_IN_SHIPTO_STATE" : "WSX",
"P_IN_SHIPTO_ZIP" : "AT55 666",
"P_IN_SHIPTO_COUNTRY" : "GB",
"P_IN_OPERATION_CODE" : "CREATE",
"P_IN_BOOKED_FLAG" : "N",
"P_IN_OU_NAME" : "ATL UK OU",
"P_IN_SPECIAL_INSTRUCTIONS" : null,
"P_IN_QUOTE_NUMBER" : null,
"P_IN_PRICELIST_ID" : "8",
"P_IN_EMAIL" : "testemail#testemail.com",
"P_IN_SHIPTO_COUNTY" : null,
"P_IN_SHIPPING_METHOD" : "Pre 930",
"P_IN_SHIPPING_INSTRUCTIONS" : null,
"P_IN_ATTENTION_TO" : "Joe Bloggs",
"P_IN_FREIGHT_CARRIER_CODE" : null,
"P_IN_IS_RETURN" : null,
"P_IN_SALES_REP" : null,
"P_IN_LINE_DATA" : [ {
"P_IN_LINE_DATA_ITEM" : [ {
"ORIG_SYS_DOCUMENT_REF" : "Order666",
"ORIG_SYS_LINE_REF" : "1",
"CUSTOMER_LINE_NUMBER" : "1",
"ITEM_TYPE_CODE" : "STANDARD",
"ITEM_DESCRIPTION" : "SKU7776",
"USER_ITEM_DESCRIPTION" : "SKU7776",
"TOP_MODEL_LINE_REF" : null,
"LINK_TO_LINE_REF" : null,
"COMPONENT_CODE" : null,
"ORDERED_QUANTITY" : "6",
"ORDER_QUANTITY_UOM" : null,
"UNIT_LIST_PRICE" : "16.95",
"UNIT_SELLING_PRICE" : "16.95",
"CALCULATE_PRICE_FLAG" : "N",
"OPERATION_CODE" : "INSERT"
}, {
"ORIG_SYS_DOCUMENT_REF" : "Order666",
"ORIG_SYS_LINE_REF" : "2",
"CUSTOMER_LINE_NUMBER" : "2",
"ITEM_TYPE_CODE" : "STANDARD",
"ITEM_DESCRIPTION" : "SKU12345",
"USER_ITEM_DESCRIPTION" : "SKU12345",
"TOP_MODEL_LINE_REF" : null,
"LINK_TO_LINE_REF" : null,
"COMPONENT_CODE" : null,
"ORDERED_QUANTITY" : "6",
"ORDER_QUANTITY_UOM" : null,
"UNIT_LIST_PRICE" : "11.89",
"UNIT_SELLING_PRICE" : "11.89",
"CALCULATE_PRICE_FLAG" : "N",
"OPERATION_CODE" : "INSERT"
}, {
"ORIG_SYS_DOCUMENT_REF" : "Order666",
"ORIG_SYS_LINE_REF" : "3",
"CUSTOMER_LINE_NUMBER" : "3",
"ITEM_TYPE_CODE" : "STANDARD",
"ITEM_DESCRIPTION" : "SKU9999",
"USER_ITEM_DESCRIPTION" : "SKU9999",
"TOP_MODEL_LINE_REF" : null,
"LINK_TO_LINE_REF" : null,
"COMPONENT_CODE" : null,
"ORDERED_QUANTITY" : "8",
"ORDER_QUANTITY_UOM" : null,
"UNIT_LIST_PRICE" : "46.42",
"UNIT_SELLING_PRICE" : "46.42",
"CALCULATE_PRICE_FLAG" : "N",
"OPERATION_CODE" : "INSERT"
} ]
} ]
}
}
'
select *
from openjson(#json,'$.InputParameters.P_IN_LINE_DATA[0].P_IN_LINE_DATA_ITEM')
with
(
ORIG_SYS_DOCUMENT_REF varchar(200),
ORIG_SYS_LINE_REF int,
CUSTOMER_LINE_NUMBER int,
ITEM_TYPE_CODE varchar(200),
-- . . .
OPERATION_CODE varchar(200)
)

How to read Json file and convert it to dataframe

I was trying to read the JSON file and convert to JSON, but I am finding difficulties here as i dont have much knowledge on this.
from pandas.io.json import json_normalize
import pandas as pd
import json
Path = "NavigatorInstances.json"
with open(Path, 'r') as myfile:
data= myfile.read()
data = json.loads(data)
df = pd.DataFrame.from_dict(json_normalize(data))
I am getting error as: json.decoder.JSONDecodeError: Expecting value: line 2 column 13 (char 15)
My JSON Sample data looks like below
{
"_id" : ObjectId("5ecfe5a0f9fcb510c8ec51e5"),
"RNI_Corps" : {
"MetaData" : {
"TaxonomyName" : "RN.Corps",
"InstanceName" : "Ratings Navigator Instance Corps",
"ThisMongoObjectId" : "5ecfe5a0f9fcb510c8ec51e5",
"ThisObjectShortId" : "37187",
"ReplacedMongoObjectId" : "",
"ThreadIDs" : "5ecfe5a0f9fcb510c8ec51e5",
"CurrentWF_Activity" : "Drafted",
"CurrentWF_ActivityDate" : "2020-05-28 16:23:53",
"VersionID" : {
"Tool" : "RN",
"Group" : "Corps",
"Sector" : "GenCos",
"Version" : "2.8.1.1"
},
"Cart" : {
"Id" : null,
"Status" : null,
"StatusDate" : null,
"Locked" : null
},
"Effective" : {
"Date" : null,
"Reason" : null,
"Source" : {
"SystemName" : null,
"SystemId" : null,
"EventType" : null
}
},
"Criteria" : {
"Id" : "10123001",
"Name" : "Exposure Draft: Sector Navigators",
"Date" : "2020-05-20 00:00:00"
},
"InstanceFileInfo" : {
"MongoObjectId" : "5ecfe5a0f9fcb510c8ec51df",
"MD5CheckSum" : "2d28eabe1a046f76e17a58cca6c386f1",
"Name" : "RN_2_8_1_1_96781051_2020_05_28_1.xlsm",
"SavedDate" : "2020-05-28 16:24:00"
},
"EntityInfo" : {
"AgentID" : NumberInt(1507132),
"AgentName" : "AES Mexico Generation Holdings, S. de R.L. de C.V.",
"NicknameID" : null,
"Nickname" : null,
"IssuerID" : NumberInt(96781051),
"IssuerName" : "AES Mexico Generation Holdings, S. de R.L. de C.V.",
"Region" : "Emerging Markets - Americas",
"CountryName" : "Mexico",
"Sovereign_Agent_ID" : null,
"Sector" : "GenCos"
},
Please help me to understand how I can convert the JSON data into a readable format such as pandas dataframe
Your sample is not in the JSON standard(or it is only a sample?).
The word "ObjectId" is not a string or number.
I think you can try https://www.json.cn to verify your JSON file first. This error is about json not DataFrame.

Ideas how to store code snippets/objects (not json) in mongodb?

So let's say I am doing converting csv to json in node.js, and doing mapping between the fields found in the customer's input file and the object that my platform requires, such as:
var objInvoice = {
"id" : guid.create().value,
"financingType" : "scf",
"batchId" : batchId,
"recordTypeCode" : inv.kayittipi,
"buyerReference" : result[0].tedarikcireferans,
"supplierReference" : inv.tedarikcireferans,
"invoiceDate" : moment(inv.faturatarih +"-140000" , "YYMMDD-HHmmss").toISOString(),
"certifiedInvoiceAmount" : inv.odenecekfaturatutar,
"currencyCode" : inv.parabirimi,
"maturityDate" : moment(inv.orjvadetarihi +"-140000" , "YYMMDD-HHmmss").toISOString(),
"correctedMaturityDate" : moment(inv.orjvadetarihi +"-140000" , "YYMMDD-HHmmss").toISOString(),
"originalInvoiceAmount" : inv.orjfaturatutar,
"invoiceNo" : inv.faturano,
"invoiceSerialNo" : inv.faturaserino,
"noterizedDocNo" : inv.belgenoteryevmiyeno,
"hashCode" : inv.hashCode,
"forecastDate" : inv.fiilivadetarihi,
"supplierTaxId" : inv.tedarikcivkn,
"supplierName" : inv.tedarikciadi,
"invoiceType" : inv.faturatipi,
"buyerAccountNumber" : inv.aliciiban,
"buyerTaxId" : inv.alicivkn,
"fiReference" : inv. bankakodu,
"bankBranchCode" : inv.bankasubeno,
"invoiceUploadStatus" : inv.dosyakayitstatu,
"gwCode" : "111110000000",
"gwCodeExplanation" : "",
"invoiceDiscountDate" : null,
"additionalInformation1" : inv.aciklama1,
"additionalInformation2" : inv.aciklama2,
"additionalInformation3" : inv.aciklama3,
"lastModificationDate" : null,
"newInvoiceId" : "00000000-0000-0000-0000-000000000000",
"oldInvoiceId" : "00000000-0000-0000-0000-000000000000",
"supplierIban" : "",
"supplierBankName" : "",
"customUniqueId" : "",
"deductionReason" : "",
"paymentObligationNo" : null,
"deductionAmount" : "",
"sellAmount" : "",
"invoiceAmountWithoutVat" : "",
"uploadDate" : now.toISOString(),
}
but a customer2 may have a different positioned fields,or even different headers in file - such as:
var objInvoice = {
"id" : guid.create().value,
"financingType" : "scf",
"batchId" : batchId,
"recordTypeCode" : inv.element1,
"buyerReference" : result[0].element2,
"supplierReference" : inv.element2,
"invoiceDate" : moment(inv.element3 +"-140000" , "YYMMDD-HHmmss").toISOString(),
"certifiedInvoiceAmount" : inv.element4,
"currencyCode" : inv.element5,
"maturityDate" : moment(inv.element6 +"-140000" , "YYMMDD-HHmmss").toISOString(),
"correctedMaturityDate" : moment(inv.element6 +"-140000" , "YYMMDD-HHmmss").toISOString(),
"originalInvoiceAmount" : inv.element7,
"invoiceNo" : inv.element8,
"invoiceSerialNo" : inv.element9,
"noterizedDocNo" : inv.element10,
"hashCode" : inv.element11,
"forecastDate" : inv.element12,
"supplierTaxId" : inv.element13,
"supplierName" : inv.element14,
"invoiceType" : inv.element15,
"buyerAccountNumber" : inv.element16,
"buyerTaxId" : inv.element17,
"fiReference" : inv. element18,
"bankBranchCode" : inv.element19,
"invoiceUploadStatus" : inv.element20,
"gwCode" : "111110000000",
"gwCodeExplanation" : "",
"invoiceDiscountDate" : null,
"additionalInformation1" : inv.element21,
"additionalInformation2" : inv.element22,
"additionalInformation3" : inv.element23,
"lastModificationDate" : null,
"newInvoiceId" : "00000000-0000-0000-0000-000000000000",
"oldInvoiceId" : "00000000-0000-0000-0000-000000000000",
"supplierIban" : "",
"supplierBankName" : "",
"customUniqueId" : "",
"deductionReason" : "",
"paymentObligationNo" : null,
"deductionAmount" : "",
"sellAmount" : "",
"invoiceAmountWithoutVat" : "",
"uploadDate" : now.toISOString(),
}
so I was thinking if it's possible to store each 'mapping' per customer in mongodb? and pulls the correct objInvoice via customer reference?
The issue is, objInvoice cannot be stored as a json document since it contains variables such as inv.element1.
I've also tried to store as a one big string (I tried with {} and without {} ), I was able to store it fine but when I pulled it from the code and unstringnified it the vars didn't get processed as expected.
Any ideas fellow good programmers?
Or the only way is to store those in seperate js files per customer?
Unfortunately, your data is not even valid Javascript Objects or JSON.
An idea is to convert values, like moment(inv.orjvadetarihi +"-140000" , "YYMMDD-HHmmss").toISOString() which are not valid, into strings (escaping correctly). As a result you will be able to JSON.stringify and JSON.parse. The strings can then be evaluated in your code.
Preprocessing your data to escape non-string values into strings certainly works. You may use regexes.

How to get a JSON node that contains a specific value?

Below is the JSON file I am trying to read nodes from. I am trying to perform contains operation. I do not want to use equals option in my json path like this - $.[?(#.name=="College Graduate - Ford")]
Could you please help me in meeting my requirement?
[
{
"incentiveId" : 123,
"autoApplied" : "false",
"name" : "College Graduate - Ford",
"amount" : 750,
"expirationDate" : "2018-12-31",
"minimumTerm" : null,
"maximumTerm" : null,
"groupAffiliation" : "College/Student",
"previousOwnership" : null
},
{
"incentiveId" : 456,
"autoApplied" : "false",
"name" : "Lease Loyalty - Ford",
"amount" : 500,
"expirationDate" : "2018-07-09",
"groupAffiliation" : null,
"previousOwnership" : "Lease Loyalty"
},
{
"incentiveId" : 789,
"autoApplied" : "false",
"name" : "Customer Cash - Ford",
"amount" : 1000,
"expirationDate" : "2018-06-04",
"groupAffiliation" : null,
"previousOwnership" : null
},
{
"incentiveId" : 222,
"autoApplied" : "false",
"name" : "Military - Ford",
"amount" : 1000,
"expirationDate" : "2018-12-31",
"groupAffiliation" : "Military",
"previousOwnership" : null
}
]
$.[?(/College/.test(#.name))]
Here I am using the test the RegExp test( ) method (which JSONPath evals behind the scenes) . This will perform the contains operation.
you can use filter to get array from array which elements satisfy the condition.
colleagues = json.filter(node => node.name.match("College"))
result:
[
{
"incentiveId": 123,
"autoApplied": "false",
"name": "College Graduate - Ford",
"amount": 750,
"expirationDate": "2018-12-31",
"minimumTerm": null,
"maximumTerm": null,
"groupAffiliation": "College/Student",
"previousOwnership": null
}
]

Extract JSON value using Jmeter

I have this JSON:
{
"totalMemory" : 12206567424,
"totalProcessors" : 4,
"version" : "0.4.1",
"agent" : {
"reconnectRetrySec" : 5,
"agentName" : "1001",
"checkRecovery" : false,
"backPressure" : 10000,
"throttler" : 100
},
"logPath" : "/eq/equalum/eqagent-0.4.1.0-SNAPSHOT/logs",
"startTime" : 1494837249902,
"status" : {
"current" : "active",
"currentMessage" : null,
"previous" : "pending",
"previousMessage" : "Recovery:Starting pipelines"
},
"autoStart" : false,
"recovery" : {
"agentName" : "1001",
"partitionInfo" : { },
"topicToInitialCapturePosition" : { }
},
"sources" : [ {
"dataSource" : "oracle",
"name" : "oracle_source",
"captureType" : "directOverApi",
"streams" : [ ],
"idlePollingFreqMs" : 100,
"status" : {
"current" : "active",
"currentMessage" : null,
"previous" : "pending",
"previousMessage" : "Trying to init storage"
},
"host" : "192.168.191.5",
"metricsType" : { },
"bulkSize" : 10000,
"user" : "STACK",
"password" : "********",
"port" : 1521,
"service" : "equalum",
"heartbeatPeriodInMillis" : 1000,
"lagObjective" : 1,
"dataSource" : "oracle"
} ],
"upTime" : "157 min, 0 sec",
"build" : "0-SNAPSHOT",
"target" : {
"targetType" : "equalum",
"agentID" : 1001,
"engineServers" : "192.168.56.100:9000",
"kafkaOptions" : null,
"eventsServers" : "192.168.56.100:9999",
"jaasConfigurationPath" : null,
"securityProtocol" : "PLAINTEXT",
"stateMonitorTopic" : "_state_change",
"targetType" : "equalum",
"status" : {
"current" : "active",
"currentMessage" : null,
"previous" : "pending",
"previousMessage" : "Recovery:Starting pipelines"
},
"serializationFormat" : "avroBinary"
}
}
I trying using Jmeter to extract out the value of agentID, how can I do that using Jmeter, what would be better ? using extractor or json extractor?
what I am trying to do is to extract agentID value in order to use it on another http request sample, but first I have to extract it from this request.
thanks!
I believe using JSON Extractor is the best way to get this agentID value, the relevant JsonPath query will be as simple as $..agentID
Demo:
See the following reference material:
JsonPath - Getting Started - for initial information regarding JsonPath language, functions, operators, etc.
JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios - for more complex scenarios.