Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Linnworks API验证_Php_Api_Authentication - Fatal编程技术网

Php Linnworks API验证

Php Linnworks API验证,php,api,authentication,Php,Api,Authentication,我在使用LinnWorksAPI的Auth方法时遇到了问题,我似乎无法正确地向他们的服务器发出授权请求 我在文档中看到,有两种连接方式,一种是通过应用程序令牌,另一种是通过用户名和密码,如果您使用的是一次性应用程序(我就是这么做的) 通过在Google中查找,我在GitHub中找到了一个Linnworks PHP SDK,其中我看到基本用户名/密码身份验证的auth方法是auth/Authorize。不幸的是,他们的文档中没有提到这种方法 当我尝试使用我的帐户凭据使用他们的PHP SDK时,我遇

我在使用LinnWorksAPI的Auth方法时遇到了问题,我似乎无法正确地向他们的服务器发出授权请求

我在文档中看到,有两种连接方式,一种是通过应用程序令牌,另一种是通过用户名和密码,如果您使用的是一次性应用程序(我就是这么做的)

通过在Google中查找,我在GitHub中找到了一个Linnworks PHP SDK,其中我看到基本用户名/密码身份验证的auth方法是auth/Authorize。不幸的是,他们的文档中没有提到这种方法

当我尝试使用我的帐户凭据使用他们的PHP SDK时,我遇到以下错误:

Warning: file_get_contents(https://api.linnworks.net/api/Auth/Authorize): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request 
守则:

include 'Factory.php';
include 'Classes/Auth.php';

$auth = new AuthMethods();
$resp = $auth->Authorize('email', 'password', 'userid'); //hidden
$curl = new Curl();
$curl->post('https://api.linnworks.net/api/Auth/Authorize', array(
            'userName' => 'email',
            'password' => 'password',
            'userId'   => userid
));
我放弃了他们的PHP SDK

我在文档中看到,他们有一个名为Auth/GetServerUTCTime的测试方法,您可以在其中查看是否成功连接到他们的API。我试着打个电话给它,一切都很好,我得到了回应

当我更改url并尝试发出post请求以进行身份验证/授权时,我再次遇到相同的错误:

Error: 400: HTTP/1.1 400 Bad Request
守则:

include 'Factory.php';
include 'Classes/Auth.php';

$auth = new AuthMethods();
$resp = $auth->Authorize('email', 'password', 'userid'); //hidden
$curl = new Curl();
$curl->post('https://api.linnworks.net/api/Auth/Authorize', array(
            'userName' => 'email',
            'password' => 'password',
            'userId'   => userid
));

所以基本上我被授权卡住了。任何帮助都将不胜感激。

您是否设法解决了上述问题?您是否已自行解决,但未发布?您是否设法解决了上述问题?您是否已自行解决,但未发布?