Skip to content

Instantly share code, notes, and snippets.

@drewgillson
Last active December 29, 2015 20:59
Show Gist options
  • Save drewgillson/7727355 to your computer and use it in GitHub Desktop.
Save drewgillson/7727355 to your computer and use it in GitHub Desktop.
oauth \
--method PUT \
--consumer-key v3b7p1yn29q0378ybk9w5d7hrsmiifpf \
--consumer-secret q91boucyygushav4ce4x07sohvpsynlg \
--token abe2y68hu5y43qr9eghwyttyrf0yhowy \
--secret 6gbzpn4uiok1k5ml8963nkz43l67ynom \
--uri http://yourdomain.com/api/rest/products/522909 \
debug
Method: PUT
URI: http://yourdomain.com/api/rest/products/522909
Normalized params: oauth_consumer_key=v3b7p1yn29q0378ybk9w5d7hrsmiifpf&oauth_nonce=h6rzMDcXAQwKrthB2RyREcav6dwhg7hTjJVzmU9xVcs&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1385860961&oauth_token=abe2y68hu5y43qr9eghwyttyrf0yhowy&oauth_version=1.0
Signature base string: PUT&http%3A%2F%2Fyourdomain.com%2Fapi%2Frest%2Fproducts%2F522909&oauth_consumer_key%3Dv3b7p1yn29q0378ybk9w5d7hrsmiifpf%26oauth_nonce%3Dh6rzMDcXAQwKrthB2RyREcav6dwhg7hTjJVzmU9xVcs%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1385860961%26oauth_token%3Dabe2y68hu5y43qr9eghwyttyrf0yhowy%26oauth_version%3D1.0
OAuth Request URI: http://yourdomain.com/api/rest/products/522909?oauth_consumer_key=v3b7p1yn29q0378ybk9w5d7hrsmiifpf&oauth_nonce=h6rzMDcXAQwKrthB2RyREcav6dwhg7hTjJVzmU9xVcs&oauth_signature=tnfPO4Drfa4j2sY2rXYlPY%2FY%2Fzc%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1385860961&oauth_token=abe2y68hu5y43qr9eghwyttyrf0yhowy&oauth_version=1.0
Request URI: http://yourdomain.com/api/rest/products/522909?
Authorization header: OAuth oauth_consumer_key="v3b7p1yn29q0378ybk9w5d7hrsmiifpf", oauth_nonce="h6rzMDcXAQwKrthB2RyREcav6dwhg7hTjJVzmU9xVcs", oauth_timestamp="1385860961", oauth_token="abe2y68hu5y43qr9eghwyttyrf0yhowy", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_signature="tnfPO4Drfa4j2sY2rXYlPY%2FY%2Fzc%3D"
Signature: tnfPO4Drfa4j2sY2rXYlPY/Y/zc=
Escaped signature: tnfPO4Drfa4j2sY2rXYlPY%2FY%2Fzc%3D
curl \
-X PUT \
-d "{\"merchandise_priority\":25440}" \
-H "Accept: application/xml" \
-H "Content-Type: application/json" \
-H "Content_Type: application/json" \
-H "Authorization:OAuth realm=\"http://yourdomain.com/\",oauth_consumer_key=\"v3b7p1yn29q0378ybk9w5d7hrsmiifpf\",oauth_token=\"abe2y68hu5y43qr9eghwyttyrf0yhowy\",oauth_nonce=\"TuPuqOLR68o5nRL1u7k3352XZrU4iI8W0IrTG0fgBo4\",oauth_signature_method=\"HMAC-SHA1\",oauth_timestamp=\"1385859256\",oauth_version=\"1.0\",oauth_signature=\"KhvMTsx+Zxvy/xVRdz2nwCuQmdc=\"" \
"http://yourdomain.com/api/rest/products/522909"
@satishsojitra
Copy link

How to use this in magento ? Will I have to create external script and put above code? Please help me to how to use this in external script in magento.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment