magento api不为客户工作 [英] magento api not working for customers

查看:155
本文介绍了magento api不为客户工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用firefox的rest client插件将以下标题信息传递到网址 localhost / magento / api / rest / customers



我是通过以下标题信息:

 消费键:olnnqgwm7gm75rtbft8w1wac4kp4vwig 
消费者的秘密:u9v6bdlpuopdlryc6vx0yjnslkj4vllo
访问令牌:null
访问令牌密钥:null

/ p>

 < magento_api> 
< messages>
< error>
< data_item>
< code> 401< / code>
< message>
oauth_problem = parameter_absent& oauth_parameters_absent = oauth_token
< / message>
< / data_item>
< / error>
< / messages>
< / magento_api>

所以这里我想获得访问令牌

$

 访问令牌:null 
访问令牌密钥:null

这是通过REST Api获取客户详细信息的必填项。您必须配置的认证过程,这里定义,请通过


  1. 获取未授权请求令牌




URI localhost / magento / oauth / initiate



发表



返回:样本响应:的oauth_token = 4cqw0r7vo0s5goyyqnjb72sqj3vxwr0h&安培; oauth_token_secret = rig3x3j5a9z5j6d4ubjwyf9f1l21itrr&安培; oauth_callback_confirmed =真


2.使用者授权


:localhost / magento / oauth / authorize



方法:取得



示例响应: /回调组oauth_token = tz2kmxyf3lagl3o95xnox9ia15k6mpt3&安培; oauth_verifier = cbwwh03alr5huiz5c76wi4l21zf05eb0



注意:?认证的第二个步骤。在此步骤中没有用户授权,您的应用程序不可能向
获取访问令牌。


访问令牌




乌里:本地主机/ Magento的/的OAuth /令牌



方法:发表



样品响应:的oauth_token = 0lnuajnuzeei2o8xcddii5us77xnb6v0&安培; oauth_token_secret = 1c6d2hycnir5ygf39fycs6zhtaagx8pd


如果您完成上述所有步骤,您将获得可用于获取客户回复的访问令牌和密码


i am passing following header information using "rest client" plugin of firefox to the url "localhost/magento/api/rest/customers",

i am pass following header information:

Consumer key :olnnqgwm7gm75rtbft8w1wac4kp4vwig
 Consumer secret:u9v6bdlpuopdlryc6vx0yjnslkj4vllo
 Access token : null
 Access token secret : null

i will give following response:

<magento_api>
<messages>
<error>
<data_item>
<code>401</code>
<message>
oauth_problem=parameter_absent&oauth_parameters_absent=oauth_token
</message>
</data_item>
</error>
</messages>
</magento_api>

so here i want to get Access token and Access token secret how to get it?

解决方案

Access token : null
Access token secret : null 

This is mandatory for getting the details of customer through REST Api. You have to configure the authentication process as defined here, please go through the article and you will get your answer.

  1. Getting an Unauthorized Request Token

URI localhost/magento/oauth/initiate

Method: POST

Return: Sample Response: oauth_token=4cqw0r7vo0s5goyyqnjb72sqj3vxwr0h&oauth_token_secret=rig3x3j5a9z5j6d4ubjwyf9f1l21itrr&oauth_callback_confirmed=true

2.User Authorization

Uri: localhost/magento/oauth/authorize

Method: Get

Sample Response: /callback?oauth_token=tz2kmxyf3lagl3o95xnox9ia15k6mpt3&oauth_verifier=cbwwh03alr5huiz5c76wi4l21zf05eb0

NOTE:The second step of authentication. Without the user authorization in this step, it is impossible for your application to obtain an Access Token.

3.Getting an Access Token

Uri: localhost/magento/oauth/token

Method: POST

Sample Response: oauth_token=0lnuajnuzeei2o8xcddii5us77xnb6v0&oauth_token_secret=1c6d2hycnir5ygf39fycs6zhtaagx8pd

If you complete all the above steps you will get the Access token and secret which can be used for getting customer response

这篇关于magento api不为客户工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆