使用CURL和Fastbill API的基本授权


Basic Authorization using CURL and Fastbill API

我很难授权用户登录,因为我不知道正确的语法。我想修改https://github.com/ZWEISCHNEIDER/fastbill以启用上述登录api。

当前报头位看起来像这样,并且工作

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                'header' => 'Authorization: Basic ' . base64_encode($this->email.':'.$this->apiKey)
                )
            );

有了这个,我可以连接到通用API并获得所有信息。在API的文档中,它要求我将以下附加信息放入头文件中(为了更好地理解,在那里留下-u行),以便仅接收用户绑定的信息。

-u {E-Mail-Address}:{API-Key} '
-H 'X-Username: {User-Emailaddress}''
-H 'X-Password: {User-Password}' ' 

我如何适应'header'内容字符串,以适应X-Username:$username和X-Password:$pwd在那里?

(api doc: https://www.fastbill.com/api/fastbill/en/fundamentals.html#authentification)

thanks in advance

好的,我很抱歉,这与我这边的畸形头请求没有任何关系——API根本不会让我像我计划的那样使用常规API密钥

访问