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.
and I am getting this error
{"Code":"-","Message":"Token is wrong."}
This is my code that i have tried this far.
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();
$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:".$token,
'content' => '[email protected]&password=1',
'ignore_errors' => true
)
);
$entriesPerPage=3;
$pageNumber=1;
// $filters='FieldCode:"GENERAL_INFO_STATUS"';
$sorting=[];
$fulfilmentCenter=00000000-0000-0000-0000-000000000000;
$additionalFilter= '';
$url = 'https://eu-ext.linnworks.net//api/Orders/GetOpenOrders?token=$token&entriesPerPage=$entriesPerPage&pageNumber=$pageNumber&sorting=$sorting&fulfilmentCenter=$fulfilmentCenter&$additionalFilter=$additionalFilter';
$context = stream_context_create($opts);
$result = file_get_contents($url, false, $context);
// $json = json_decode($result);
print_r($result);die;
}
@deepikaWeblegs02 This has nothing to do with Laravel Passport.
You are also leaking sensitive information to do with your Linnwork account. 👀 👀 👀
I suggest that you change your password at once!
Then why its giving me this error token is wrong.
Hi @deepikaWeblegs02
We have expired your current password in our system. Please use the password reset functionality to gain access back to your system. If you have any issues please do not hesitate to contact customer support.
Hi @deepikaWeblegs02 ,
To clarify your original question.
The reason you are most likely receiving this error is that your calling the incorrect API server and therefore the token won't be allowed to be used on the wrong server.
With any of the authorise calls on our API they return a "Server" field that should be used for any subsequent calls. The reason for this is that customers are in different regions / environments and are therefore separated by different balancers. This helps us improve security and route calls closer to the customers data thus allowing a faster API experience. Apps are also separated on "ext" endpoints such that they don't effect the main users calls.
Based upon the fact that you posted your user name and password for the main account I'd assume your using the endpoints that are used for customer login rather than apps. I'd suggest creating an app on https://developer.linnworks.com/ and using http://apps.linnworks.net/Api/Method/Auth-AuthorizeByApplication instead.
Regards
Linnworks
yes, I already created an app on https://developer.linnworks.com/ and from
this link, it returned "Application Id", "Application Secret", "Application
Type: System Integration","Installation URL" and after installation, it
returned "token". but I don't have any server information. I am using this
URL to call the API https://eu-ext.linnworks.net//api/Orders/GetOpenOrders
to get orders . and I also tried this link http://apps.linnworks.net/Api/
Method/Auth-AuthorizeByApplication and passed Application Id, Application
Secret, token" along with this url
https://eu-ext.linnworks.net//api/Auth/AuthorizeByApplication but its
giving this error
please guide me what i should do.
https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-4048-2-b&tag=d797b870-ac8a-495f-8991-d9e6f389f231
I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.
https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-4048-2-b&tag=d797b870-ac8a-495f-8991-d9e6f389f231
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Wed, Jul 18, 2018 at 8:01 PM, Linn Systems notifications@github.com
wrote:
Hi @deepikaWeblegs02 https://github.com/deepikaWeblegs02 ,
To clarify your original question.
The reason you are most likely receiving this error is that your calling
the incorrect API server and therefore the token won't be allowed to be
used on the wrong server.With any of the authorise calls on our API they return a "Server" field
that should be used for any subsequent calls. The reason for this is that
customers are in different regions / environments and are therefore
separated by different balancers. This helps us improve security and route
calls closer to the customers data thus allowing a faster API experience.
Apps are also separated on "ext" endpoints such that they don't effect the
main users calls.Based upon the fact that you posted your user name and password for the
main account I'd assume your using the endpoints that are used for customer
login rather than apps. I'd suggest creating an app on
https://developer.linnworks.com/ and using http://apps.linnworks.net/Api/
Method/Auth-AuthorizeByApplication instead.Regards
Linnworks—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/laravel/passport/issues/769#issuecomment-405951699,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AiP6ecQGHWSHsFydkRZPw0wffVT7aDlOks5uH0argaJpZM4VT_Az
.
--
Thanks,
Deepika
Hi,
Since this is a public platform can you raise a ticket through your account and we can assist further with this issue.
Most helpful comment
Hi @deepikaWeblegs02
We have expired your current password in our system. Please use the password reset functionality to gain access back to your system. If you have any issues please do not hesitate to contact customer support.