I am trying to get the orders from Linnwork API. But I am not able to get anything. I am using laravel framework to do this task and here the error I am getting.
EDIT:
No it's not a duplicate question file_get_content is not the main issue for getting the result I can use curl but the problem is linnwork API format its also giving error like "token is wrong". and I have checked the linnwork API documentation to see what's the mandatory fields to pass but there is no luck.
public function getLinnworkOrders()
{
date_default_timezone_set('Europe/London');
$userId = Auth::id();
$tag = Tag::where('user_id', $userId)->where('market', 'Linnwork')->orderBy('created_at', 'desc')->first();
$url = 'https://eu1.linnworks.net/api/Orders/GetOpenOrders';
$token = $tag->token;
$opts = array(
'http'=>array(
'method'=>"POST",
'header'=> "Content-Type: application/x-www-form-urlencoded",
"Accept: application/json",
"url: https://eu-ext.linnworks.net//api/Orders/GetOpenOrders HTTP/1.1",
"Host: eu-ext.linnworks.net",
"Connection: keep-alive",
"Origin: https://www.linnworks.net",
"Accept-Language: en",
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36",
"Referer: https://www.linnworks.net/",
"Accept-Encoding: gzip, deflate",
"Authorization: e2673790a8d866ae30968ea189add96a",
'content' => '',
'ignore_errors' => true
)
);
$count_json = file_get_contents($opts);
$count_json = json_decode($count_json);
print_r($count_json);die;
}
And its the error i am getting
"file_get_contents() expects parameter 1 to be a valid path, array given"