将JSON数据拉入PHP7(注意:尝试获取非对象的属性)

I am trying to pull the following JSON data into php variables.

{"links":[],"content":{"carrier":{"allowedToOperate":"Y","bipdInsuranceOnFile":"0","bipdInsuranceRequired":"N","bipdRequiredAmount":"0","bondInsuranceOnFile":"75","bondInsuranceRequired":"Y","brokerAuthorityStatus":"A","cargoInsuranceOnFile":"0","cargoInsuranceRequired":"N","carrierOperation":{"carrierOperationCode":"A","carrierOperationDesc":"Interstate"},"commonAuthorityStatus":"N","contractAuthorityStatus":"N","crashTotal":0,"dbaName":null,"dotNumber":2230336,"driverInsp":0,"driverOosInsp":0,"driverOosRate":0,"driverOosRateNationalAverage":"5.51","ein":null,"fatalCrash":0,"hazmatInsp":0,"hazmatOosInsp":0,"hazmatOosRate":0,"hazmatOosRateNationalAverage":"4.5","injCrash":0,"isPassengerCarrier":"N","issScore":null,"legalName":"BAY TRANSPORTATION SERVICES LLC","oosDate":null,"oosRateNationalAverageYear":"2009-2010","phone":"9897559445","phyCity":"AUBURN","phyCountry":"US","phyState":"MI","phyStreet":"4030 GARFIELD ROAD, SUITE 200","phyZipcode":"48611","reviewDate":null,"reviewType":null,"safetyRating":null,"safetyRatingDate":null,"safetyReviewDate":null,"safetyReviewType":null,"snapshotDate":"1464321600000","statusCode":"A","totalDrivers":0,"totalPowerUnits":0,"towawayCrash":0,"vehicleInsp":0,"vehicleOosInsp":0,"vehicleOosRate":0,"vehicleOosRateNationalAverage":"20.72"},"links":[{"rel":"basics","href":"http://mobile.fmcsa.dot.gov/qc/services/carriers/2230336/basics"},{"rel":"cargo carried","href":"http://mobile.fmcsa.dot.gov/qc/services/carriers/2230336/cargo-carried"},{"rel":"operation classification","href":"http://mobile.fmcsa.dot.gov/qc/services/carriers/2230336/operation-classification"},{"rel":"docket numbers","href":"http://mobile.fmcsa.dot.gov/qc/services/carriers/2230336/docket-numbers"},{"rel":"carrier active-For-hire authority","href":"http://mobile.fmcsa.dot.gov/qc/services/carriers/2230336/authority"},{"rel":"self","href":"http://mobile.fmcsa.dot.gov/qc/services/carriers/2230336"}]}}

This is the code im running minus the APIKEY

error_reporting(E_ALL);
ini_set('display_errors', 1);
$GETdotnum = $_GET["dot"];
function curl_request($sURL,$sQueryString=null)
{
    $cURL=curl_init();
    curl_setopt($cURL,CURLOPT_URL,$sURL.'?'.$sQueryString);
    curl_setopt($cURL,CURLOPT_RETURNTRANSFER, TRUE);
    $cResponse=trim(curl_exec($cURL));
    curl_close($cURL);
    return $cResponse;
}

$sResponse=curl_request('https://mobile.fmcsa.dot.gov/qc/services/carriers/' . $GETdotnum, 'webkey=APIKEY');
$oJSON=json_decode($sResponse);
if ($oJSON->content->carrier->allowedToOperate=='Y')
{
    $CarrierName=$oJSON->content->carrier->legalName;
    $CarrierAddress=$oJSON->content->carrier->phyStreet;
    $CarrierPhoneNumber=$oJSON->content->carrier->phone;
}
else
echo $oJSON;
echo "Error: Carrier Operate Status: " . $oJSON->content->carrier->allowedToOperate;

These are the errors im receiving

Notice: Trying to get property of non-object in /home/sirmikey/public_html/fmcsa.php on line 17

Notice: Trying to get property of non-object in /home/sirmikey/public_html/fmcsa.php on line 17

Catchable fatal error: Object of class stdClass could not be converted to string in /home/sirmikey/public_html/fmcsa.php on line 24