9 votes
Accepted

How can I quickly get an access token for personal use?

It's possible to authenticate yourself via the command line; there's no need to set up a website or so. Open the application page via https://stackapps.com/apps/oauth and make sure the option 'Enable ...
Glorfindel's user avatar
  • 6,762
6 votes
Accepted

Does a closed and/or deleted Stack Apps post still provide access to the API?

I've just done a couple of tests with my placeholder app. Even though the question is closed, I was able to generate a new access token (following the regular procedure) for my sockpuppet account, and ...
Glorfindel's user avatar
  • 6,762
4 votes
Accepted

Refresh expired acess token basics

Dealing with token expiration is pretty simple. When a token is/goes bad then, when you make an API call that uses the token, you will get a JSON response like this: { "error_id": 403, "...
Brock Adams's user avatar
  • 12.9k
3 votes
Accepted

Accessing the Stack Exchange API not on behalf of an user?

You only need to use OAuth if you are trying to add or modify data (including votes). If you want to do that, your app must log in as a user, no exceptions. If you just want to read or search data, ...
Brock Adams's user avatar
  • 12.9k
3 votes
Accepted

Cannot get redirect_uri to work

There have been no reported changes to the API, officially for many years, (unofficially since January). But, frankly that script's approach should have never worked. OAuth credentials are sent to: &...
Brock Adams's user avatar
  • 12.9k
3 votes
Accepted

Access token keeps being invalidated

Turns out this is completely my fault :/ I overlooked the expiry aspect of the access token which meant that I got the default 86399 seconds (~24 hours), which meant my users had to get a new access ...
ᔕᖺᘎᕊ's user avatar
  • 4,365
3 votes
Accepted

iOS Client for stackoverflow always throws redirect_uri not a valid uri

That error means either that you've misconfigured the app or that the authentication call is incorrect. Note that stackexchange.com/oauth/login_success is not a valid redirect_uri irregardless. You ...
Brock Adams's user avatar
  • 12.9k
2 votes
Accepted

Same access token between different fetch_token requests

Yes, each time you invoke stackexchange.com/oauth/ you will get a fresh access token, even though old ones may still be valid. For example: Go to /me/inboxLivedoc and hit Get Token twice, recording ...
Brock Adams's user avatar
  • 12.9k
2 votes

Application Key and AccessToken are not working for Stack Exchange API?

In my particular case, I somehow managed to append % character to the end of the access_token. There should be no % character at the end of the access_token.
Gajus's user avatar
  • 163
2 votes
Accepted

No 'Access-Control-Allow-Origin' for oauth/access_token

The question is not clear enough. You appear to be trying to use jQuery to do explicit OAuth from a web page. If so, this is not allowed. Explicit OAuth is for servers. You are not running that ...
Brock Adams's user avatar
  • 12.9k
2 votes
Accepted

I have created a lot of access_token with no_expiry scope while experimenting. How do I delete them?

This is what the /apps/{accessTokens}/de-authenticate route does. Passing valid access_tokens to this method causes the application that created them to be de-authorized by the user associated with ...
Brock Adams's user avatar
  • 12.9k
2 votes
Accepted

How to use /me to display my profile data in StackExchange API?

For read requests, you must send the token (and key) in the URL. For example: https://api.stackexchange.com/2.2/me?site=stackoverflow&key=dp55hR5Wr9UhOJReA6F2gg((&access_token=...
Brock Adams's user avatar
  • 12.9k
2 votes
Accepted

"Could not parse uri [redirect_uri]" when trying to authenticate

It's not explicitly mentioned in the documentation (perhaps because it uses the term URI, and says it must be 'under' a domain), but for the redirect URI I always use a 'full' address, including the ...
Glorfindel's user avatar
  • 6,762
2 votes
Accepted

Get access token for matrix bridge

Yes, you do. The only way to get access token is via authentication, and you need a registered application for that. What you don't need is a public post here to announce your application; that is ...
Glorfindel's user avatar
  • 6,762
1 vote

OAuth Domain can't satisfy redirect_uri AND Proxy url

What you need to do is to uncheck Disable Desktop Application OAuth Redirect Uri. This will allow your app to redirect to stackexchange.com without requiring it in the OAuth Domain. Your OAuth domain ...
Lakshya Raj's user avatar
1 vote
Accepted

If a client authenticates, will API requests be counted on their profile?

If you are using an access_token in a request to the SE API, then the quota which that request is counted against is the 10k requests/day for that user+application pair. Each user can have up to five ...
Makyen's user avatar
  • 1,615
1 vote
Accepted

Why is no_expiry "strongly advised against"?

It is a security best practice. Tokens should be short-lived. They should be so short-lived that once captured the damage caused/cost to restore by a compromised token should be minimal. This means ...
rene's user avatar
  • 2,492
1 vote

How do I add a comment to a post through the Stack Exchange API?

For posting comments, you need a request key for your application: Applications should be registered on Stack Apps to get a request key. Request keys grant more requests per day, and are necessary ...
Glorfindel's user avatar
  • 6,762
1 vote
Accepted

How can I the question detail page and add comments like the Stack Exchange app?

Can we get the list of data when clicking on the specific question and display the question detail page like the Stack Exchange app? Sure: use the /questions/{ids} method and apply the appropriate ...
Glorfindel's user avatar
  • 6,762
1 vote

Localhost test Stack App authentication: error 'redirect_uri' does not match

I get the reason: Do not use gem 'omniauth-stackexchange', '~> 0.2.1' ,but instead of gem 'omniauth-stackexchange', git: 'https://github.com/nashby/omniauth-stackexchange.git' The reason see this:...
sylor_huang's user avatar
1 vote
Accepted

The new implicit authentication dialog doesn't handle comma-delimited scopes

This appears to have been silently fixed, sometime in the last year. Now, both: https://stackexchange.com/oauth/dialog?client_id=1515&scope=read_inbox,write_access,private_info&redirect_uri=...
Brock Adams's user avatar
  • 12.9k
1 vote
Accepted

oauth 2.0 based on stackexchange api and fetch user details

You can do this using the /me endpoint or the /me/associated endpoint. /me Returns the user associated with the passed access_token. Use this if you want to get user info for a specific site (e.g....
Alex's user avatar
  • 126
1 vote

What token parameters to use for OAuth2 Authorizaton?

What software are you using? Anyway, for a Desktop app, you almost always use the "Implicit" (Client side) procedure. Configure your Stack app as shown in this answer. That dialog appears to be set ...
Brock Adams's user avatar
  • 12.9k
1 vote
Accepted

Is it okay to just send the API key (without implementing oauth-2 login)?

Yes, it is perfectly okay. You only need an access_token (OAuth/login) if you are trying to change data, or are accessing private information for a logged-in user. See the Authentication docs for ...
Brock Adams's user avatar
  • 12.9k
1 vote

DSS: Facilitating API authentication for desktop apps

I think, in the name of being cooperative, anybody using this should consider generating a key that is prefixed by their app's client ID, e.g. if your app ID is 3456: 3456-<uuid> Sticking to ...
Jason C's user avatar
  • 591
1 vote
Accepted

Stack Exchange login hangs on Windows 10 Mobile?

I had to change the structure of Authentication on my App. For windows 10, I use AuthenticationBroker but for Windows 10 Phone I used the old WebView Model and completed login implementation.
AVK's user avatar
  • 279
1 vote
Accepted

Authentication uses # instead of `?`?

Refer to the generic URI syntax, it is perfectly valid to have a fragment (The optional part of a URL that starts with an octothorpe #) without a preceding query (The optional part of a URL that ...
Brock Adams's user avatar
  • 12.9k
1 vote

Problem Implementing Socialite Stack exchange

You're providing the clientid as key, which is not correct. If you go to the page where you can manage your application you'll need to copy the key: Key Pass this as key when making requests against ...
rene's user avatar
  • 2,492

Only top scored, non community-wiki answers of a minimum length are eligible