I have a problem whit call an API with Laravel.
I wont to call an api with a request like this (this is an example of json request):
{
"costCenterCode":"CDC-00070964",
"paperless":"false",
"shipmentDate":"2020-11-26T08:02:20.986+0000",
"waybills":[
{
"clientReferenceId":"12312312341",
"printFormat":"A4",
"product":"APT000901",
"data":{
"declared":[
{
"weight":"10",
"height":"10",
"length":"30",
"width":"25"
}
],
}
}
]
}
This is my post code:
$insert = Http::withHeaders([
'POSTE_clientID' => '4815fd18-xxxx-xxxx-xxxx-d1a1edbd7a12',
'Authorization' => $auth,
])->post('https://apiw.gp.posteitaliane.it/gp/internet/postalandlogistics/parcel/waybill', [
"costCenterCode" => "CDC-00051975",
"paperless" => "false",
"shipmentDate" => "2024-06-29T08=>02=>20.986+0000",
"waybills" => [
"clientReferenceId" => "1404343485",
"printFormat" => "A4",
"product" => "APT000901",
"data" => [
"declared" => [
"weight" => "0",
"height" => "44",
"length" => "30",
"width" => "25"
],
]
]
])->json();
What i wrong? There is an array of object, i dont’t now.
Can you help me?
New contributor
giuseppe pesce is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.