So, I'm working with wiki pages and adventure log posts. I understand that they are really the same thing, but it would be nice to have the option to filter the wiki's api to just return an array of one or the other.
/v1/campaigns/campagin_id/wikis.json?type=Post
I fear that for a large campaign, I would have to download and parse a lot of data I don't need if I am only interested in posts or pages. I would rather filter have the filter on the API end.
I'm trying to use signpost (http://code.google.com/p/oauth-signpost/) and their instruction indicate that I will need a 'verification code' that is provide by the call_back method but if I am a desktop application how do I obtain this verification code?
I may be clueless but when I go to http://sunrod.codeplex.com/
I don't see a download link for the .net libraries.
Where can I actually download the .dll files or the source code? I'm interested in playing around to see what sort of capabilities are available with these API's
I've been working on a command line app. I have the user paste the authorization_url into their browser. After they authorize the app, they'll get a web page with the verification code on it.They can paste that into the app and they'll be good to go.
If your desktop app has an embedded browser you may be able to scrape it directly from the page or handle it like a regular web app integration, but I haven't tried that yet.
I have the following java code using oauth-signpost (http://code.google.com/p/oauth-signpost/) and on the provider.retrieveRequestToken() line the program returns "Server returned HTTP response code: 401 for URL: https://www.obsidianportal.com/oauth/request_token". I'm stuck and don't know where the problem is here, any advice would be appreciated.
I don't know oauth-signpost and my java is rusty. What you have there looks OK, though. Do you hae MYKEY and MYSECRET correct? That seems the most likely culprit for a 401 error getting the request token.
Here is a Ruby snippit from my commandline app. Maybe that will help you. The important bit is that once I have a request token, that token has an authorize_url. This is the url for the user to go to authorize your app to access their OP account. Below, you can see that I have the user paste that into their browser. That will bring them to a page where they can click "Authorize" to authorize your app. After clicking authorize, they will go to a page with the verify token on it. The user can cut and paste that token into your app. That become your verificationCode.
This process is much cleaner for a web app, because the urls and redirection eliminate the need for all of the cut and paste.
if Configuration.auth_token && Configuration.auth_secret
begin
print "Chronicler has already been authorized. Do you want to authorize again?[Yn] "
auth_again = STDIN.readline.chomp
end until auth_again =~ /^[yYnN]?$/
return if auth_again =~ /^[nN]$/
end
puts "Put #{request_token.authorize_url} in your browser"
Since the OAuth verifier question has come up a lot, I've gone ahead and added it to the "OAuth Overview Page":http://help.obsidianportal.com/kb/api/api-authentication-oauth in the docs.
Comments
/v1/campaigns/campagin_id/wikis.json?type=Post
I fear that for a large campaign, I would have to download and parse a lot of data I don't need if I am only interested in posts or pages. I would rather filter have the filter on the API end.
Thanks,
Steve
Steve, I'll look into your request. Seems reasonable...
I don't see a download link for the .net libraries.
Where can I actually download the .dll files or the source code? I'm interested in playing around to see what sort of capabilities are available with these API's
If your desktop app has an embedded browser you may be able to scrape it directly from the page or handle it like a regular web app integration, but I haven't tried that yet.
Steve
OAuthConsumer consumer = new CommonsHttpOAuthConsumer(MYKEY, MYSECRET);
OAuthProvider provider = new DefaultOAuthProvider( "https://www.obsidianportal.com/oauth/request_token"
, "https://www.obsidianportal.com/oauth/access_token"
,"https://www.obsidianportal.com/oauth/authorize");
try
{
String url = provider.retrieveRequestToken(consumer, oauth.signpost.OAuth.OUT_OF_BAND);
} catch (Exception e) {
e.printStackTrace();
}
Steve
provider.retrieveAccessToken(consumer, verificationCode);
Where do I get the verificationCode?
This process is much cleaner for a web app, because the urls and redirection eliminate the need for all of the cut and paste.
bc.. def authorize
request_token = Configuration.client.consumer.get_request_token
if Configuration.auth_token && Configuration.auth_secret
begin
print "Chronicler has already been authorized. Do you want to authorize again?[Yn] "
auth_again = STDIN.readline.chomp
end until auth_again =~ /^[yYnN]?$/
return if auth_again =~ /^[nN]$/
end
puts "Put #{request_token.authorize_url} in your browser"
print "Enter the supplied pin (or verifier): "
pin = STDIN.readline.chomp
access_token = request_token.get_access_token(:oauth_verifier => pin)
Configuration.auth_token = access_token.token
Configuration.auth_secret = access_token.secret
# print "Enter token: "
# Configuration.auth_token = STDIN.readline.chomp
# print "Enter secret: "
# Configuration.auth_secret = STDIN.readline.chomp
Configuration.save!
puts "Saved authorization information." if Configuration.verbose
end
@