Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've searched all over (including here on Stackoverflow) for how to use the Magento REST API. I need help on getting an Unauthorized Request Token (the first step)

On the Magento setup I'm using the REST API is working for GET Products for Guests so I know that is not [the problem][1]

I have setup an OAuth Consumer for the above URL and have both the consumer key and secret. I can't figure out what URL to use for the Callback URL.

First, I'm stuck and don't know what I should use as the Callback URL when setting up the consumer. It is an optional field in Magento

I'm testing with the Firefox REST Client as per http://www.magentocommerce.com/api/rest/testing_rest_resources.html

Next with the Firefox REST client I can't get started by getting an Unauthorized Request Token. According the above URL I should have the oauth_callback URI in the header.

The following request parameters should be present in the Authorization header:

oauth_callback - an URI to which the Service Provider will redirect the resource owner (user) after the authorization is complete. oauth_consumer_key - the Consumer Key value, retrieved after the registration of the application. oauth_nonce - a random value, uniquely generated by the application. oauth_signature_method - name of the signature method used to sign the request. Can have one of the following values: HMAC-SHA1, RSA-SHA1, and PLAINTEXT. oauth_signature - a generated value (signature). oauth_timestamp - a positive integer, expressed in the number of seconds since January 1, 1970 00:00:00 GMT. oauth_version - OAuth version.

What is the oauth_callback URI when using the above URL?

When I try a POST to Endpoint: /oauth/initiate

I get:

oauth_problem=parameter_absent&oauth_parameters_absent=oauth_callback

I'm lost and don't know what else to try. I'm a novice programmer and new to the Magento REST API...so keep that mind. It may be that I'm just missing the obvious.
Anyone who is interested in helping me figure this out here are the Consumer key and the secret.

key: d2f4a7cc63715f98d12db2c6db63cfba

secrect: 8347474102cbf2d40b06f9d76f281e73

The URL is: http://temp.pramier.com

This is from a test install so I'm not worried about giving out the key and secrect

share|improve this question
1  
I think I have finally figured our what URL to use for the callback but now I get this message "oauth_problem=signature_invalid&debug_sbs=" Stuck again –  Gerhard Peters Dec 4 '13 at 3:00

1 Answer 1

I am not sure what programming language you are using, but the API lists the code for authenticating and retrieving products in php on the bottom.

I just started working on this in ruby using the code here.

@consumer=OAuth::Consumer.new auth["consumer_key"], 
                          auth["consumer_secret"], 
                          {:site=>"your-site-here"}

@request_token = @consumer.get_request_token

Let me know if I misunderstood your question or wasn't clear in my explanation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.