Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8881973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:27:40+00:00 2026-06-14T20:27:40+00:00

I’m having a very strange issue with AppEngine and the Context.IO API. I’m using

  • 0

I’m having a very strange issue with AppEngine and the Context.IO API.

I’m using a the contextIO2 library, which uses python-oauth2.

When I try out the library (contextIO2) via the terminal, I get no problems (or at least, not yet. But I’ve tried it several dozen times across a couple of days without problem).

But when running code on AppEngine, I sometimes get a 401 Authorization Invalid consumer key error. I’m not sure what causes it, since one minute the request goes fine, then when I try the request again I get the 401, then after a while it will be fine, then not fine again, so on.

I emailed Context.IO support, and he said that when he tries the url of my app and got the error, “oauth_consumer_key doesn’t seem to be correctly transmitted”. What could be causing this? AppEngine messing up the request? pythoan-oauth2 bug? contextIO2 bug?

Here’s one of my handlers’ code:

class ReceiveConnectTokenHandler(webapp2.RequestHandler):
    def get(self):
        contextio_token = self.request.get('contextio_token')
        cio = ContextIO(API_KEY, API_SECRET)
        # get token's associated email
        try:
            token = cio.get_connect_token(contextio_token)
        except RequestError, e:
            if e.status_code == 404:
                self.response.write(
                    'Token %s not found. ' % contextio_token)
                return
            raise e
        account = token.account
        if not account or not account.email_addresses:
            self.response.write(
                'Token %s has no email associated with it yet.' % contextio_token)
            return
        email = account.email_addresses[0]
        # clear email's memcache
        memcache.delete_multi(['accounts', 'no_account'], namespace=email)
        self.response.write(
            '''%s is now connected with Context.IO. Please verify in the
            gadget that you have granted access. You can close this window.''' % email
        )

It’s just a simple GET on https://api.context.io/2.0/connect_tokens/{{token}}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:27:41+00:00Added an answer on June 14, 2026 at 8:27 pm

    Posting answer as per Greg’s suggestion.

    The issue was that the contextIO2 library defined it’s request_uri method by:

    def request_uri(uri, method='GET', params={}, headers={}):
    

    which is a common Python pitfall (#5 in this list). I’ve notified Context.IO support and have sent a pull request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.