AltME: Web

Messages

Endo
I get "** User Error: Handshake Response does not contain Login URL" when I try etsy/as "username"

Chris
http://www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm
Is this the API you're trying to access?  Looks as if it uses OAuth 2.0 (Etsy and Twitter are 1.0) - I'm not fully aware what the differences are.  Note that even though Twitter and Etsy both use the same signing method (OAuth), they differ in how you get the user key - looks as if this one is different again...
Hmm, that came across as unreadable here : ) - here it is again:
http://www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm
Is this the API you're trying to access?  Looks as if it uses OAuth 2.0 (Etsy and Twitter are 1.0) - I'm not fully aware what the differences are.  Note that even though Twitter and Etsy both use the same signing method (OAuth), they differ in how you get the user key - looks as if this one is different again...
Kaj
They're quite different
Chris
Ok, in an effort to disentangle some of the OAuth code from specific implementations, here is an *experimental*, *largely untested* port scheme that does just that.
test-site: http://192.168.0.60.xip.io:8080/
probe-lowercase: func [str [string!]][
    lowercase copy str
]
read [
    scheme: 'oauth
    target: 'get
    url: test-site
    user-data: context [a: "Foo"] ; params
    key: make key [
        consumer-key: consumer-secret: "Your Keys Here"
    ]
    user: make user [token: secret: "Your User Keys Here"]
    awake: :probe-lowercase ; result processor, like :load-json
]
(obviously you'll need to change the test-site to your own test service)
I'm pretty sure this is a grevious abuse of R2's port system, but it does mean there is no new global words.
Chris
Yey! Works with Twitter!!
tm: read [
    scheme: 'oauth
    url: https://api.twitter.com/1/statuses/home_timeline.json
    target: 'get
    user-data: context [count: 10]
    key: make key [
        Consumer-Key: #consumer_key
        Consumer-Secret: #consumer_secret
    ]
    user: make user [
        token: #user_key
        secret: #user_secret
    ]
    awake: :load-json
]
Endo, I don't think this will help you with Salesforce, but breaking the OAuth part out should make it easier to adapt to OAuth 2.0.
Endo
Wow thanks a lot Chris! Thanks for separating OAuth port scheme, unfortunately I'm not familiar with OAuth but I'll try it with Salesforce. Thanks a lot!
Gabriele
Endo
I know, I already read it. But SF uses OAuth 2. :(
Endo
Is GET supported in read/custom ?
print read/custom http://localhost/test.rsp [get "a=b&c=d"]
Or should I use Graham's custom http?
GrahamC
Read is GET
Endo
I tried to change the method without changing the URL when switching POST and GET. Didn't work. Anyway, not a problem.
GrahamC
not sure why you want read/custom for unless you're altering the header contents
read/custom http://localhost.rsp?a=b&c=d [ header [ Cookie: "authtoken=anotherfoo" ]]

Last message posted 35 weeks ago.