Reputation: 3773
This is my code:
string accessToken = "##";
string accessTokenSecret = "##"; string consumerKey = "##"; string consumerSecret = "##"; string appToken = "##"; string realmId = "##"; //company id in quickbooks online
OAuthRequestValidator oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret);
ServiceContext context = new ServiceContext(oauthValidator, appToken, realmId, IntuitServicesType.QBO);
I am receiving: InvalidTokenException was unhandled by user code - {"Unauthorized"} in the creating the new ServiceContext line. Not sure what the problem is.
Thanks for any help provided.
Upvotes: 0
Views: 386
Reputation: 27952
This error message:
InvalidTokenException was unhandled by user code - {"Unauthorized"}
Occurs when the OAuth tokens you're using are no longer valid.
I would double-check that:
Here is Intuit's documentation for setting up your own OAuth endpoint:
Upvotes: 2