2012-11-07 8 views
16

Ho registrato il mio applicazioni sul mio Magento admin.Come ottenere token di accesso e token di accesso segreto da Magento 1.7 API REST

già ottenuto la chiave e il segreto dei consumatori.

ma non ho la fortuna di ottenere il token di accesso e l'accesso segreto token.

ha detto

oauth_problem = parameter_absent & oauth_parameters_absent = oauth_consumer_key

Simple REST API

sto testando basa su questo link

http://www.magentocommerce.com/api/rest/testing_rest_resources.html

cosa ho bisogno di sapere la risposta è

  1. cosa devo riempire di intestazione & campo di testo dei dati?
  2. come ottenere il token di accesso e di accesso segreto token (su Mozilla)?
  3. C'è un tutorial passo passo per testare qualsiasi API REST?
+4

hanno a trovare una soluzione per questa domanda – chanz

+2

sì ho trovato la soluzione Chanz –

+0

@ Josua Marcel Chrisano: puoi per favore inviami il link per la soluzione usando RESTClient –

risposta

6

0) Installare https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo al cromo

1) Ottenere uno strumento di client OAuth con il comando:

sudo gem install oauth 

2) Configurare il server di Magento

3) Ottieni i token oAuth

oauth \ 
    --verbose \ 
    --query-string \ 
    --consumer-key v484mnii2jyswedm6uo2cfcjay7uy49snws \ 
    --consumer-secret koay6845che7giy5lr17gnrhckkbhf8h5 \ 
    --access-token-url http://www.yourstore.com/magento/oauth/token \ 
    --authorize-url http://www.yourstore.com/magento/oauth/authorize \ 
    --request-token-url http://www.yourstore.com/magento/oauth/initiate \ 
    authorize 

rispondono:

Server appears to support OAuth 1.0a; enabling support. 
Please visit this url to authorize: 
http://www.yourstore.com/magento/oauth/authorize?oauth_token=ey6fokp0pbzwr1016eb528y5xw1ak5ji 

Please enter the verification code provided by the SP (oauth_verifier): 
YOUR_CODE_HERE 

Response: 
    oauth_token_secret: g9kyz8c7zv868d58eav1muih3gxvq763 
    oauth_token: aqvlfv9tuexn0mqiydgkaff4ixxg8743c 

4) effettuare la chiamata API

oauth \ 
    --consumer-key v484mnii2jyswedm6uo2cfcjay7uy49snws \ 
    --consumer-secret koay6845che7giy5lr17gnrhckkbhf8h5 \ 
    --token aqvlfv9tuexn0mqiydgkaff4ixxg8743c \ 
    --secret g9kyz8c7zv868d58eav1muih3gxvq763 \ 
    --uri http://www.yourstore.com/magento/api/rest/products \ 
    debug 

provare http://www.yourstore.com/magento/api/rest/products


trovato la soluzione

http://www.aschroder.com/2012/04/introduction-to-the-magento-rest-apis-with-oauth-in-version-1-7/

per PHP

https://gist.github.com/2469319