REST API calls from Google App Engine


(Afzal Farooqui) #1

Initially I tried using dwollaswagger but realized it is not going to work on GAE because it uses the request api.

Later I tried dwolla-python api but it seems very limited in functionality.

In the end I tried using urllib2 to send my own REST calls but I am getting “Method Not Allowed”.

Can someone kindly guide me what is the right way to use dwolla API on GAE to exploit all API features?

Thanks,
Afzal


(Afzal Farooqui) #2

Trying to understand why the following code doesn’t work:

        url = "https://api-uat.dwolla.com/customers/247B1BD8-F5A0-4B71-A898-F62F67B8AE1C/iav-token"
        req = urllib2.Request(url)
        req.add_header('Content-Type', 'application/vnd.dwolla.v1.hal+json')
        req.add_header('Accept', 'application/vnd.dwolla.v1.hal+json')
        req.add_header('Authorization', 'Bearer ' + dwollaswagger.configuration.access_token)
        body = urllib2.urlopen(req)
        token=json.loads(body)