Giter Club home page Giter Club logo

pytrium's People

Contributors

phantomxc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pytrium's Issues

"bad request" even though payload is structure just like in documentation

Issues encountered:

  1. Instruction has a typo. Missing a comma after a key:value (happens to me all the time! haha)
  2. Institution search doesn't return GUID anymore. Looks like API switched to instution_code instead. Fixed this for my code but still having issues.
  3. Tried adding user with "meta" field but got "bad request". Request only worked when i removed meta.
  4. Request to create member also responded with "bad request". This was the call:
member = api.createMember(user['guid'], payload={
    ...:             "institution_code": institution['code'],
    ...:             "credentials": [
    ...:                 {
    ...:                     "credential_guid": creds[0]['guid'],
    ...:                     "value": "USERNAME"
    ...:                 },
    ...:                 {
    ...:                     "credential_guid": creds[1]['guid'],
    ...:                     "value": "PASSWORD"
    ...:                 }
    ...:             ]
    ...:         })

Where payload is:
{'member': {'credentials': [{'credential_guid': 'CRD-af37bbfa-7fc7-f607-692c-2d2592fb25a3', 'value': 'USERNAME'}, {'credential_guid': 'CRD-2045d3f6-206a-b0ef-c42d-6ebc8835f898', 'value': 'PASSWORD'}], 'institution_code': 'wells_fargo'}}

Which is structured the same way as per the docs. I'm using the development endpoint: https://vestibule.mx.com/

Traceback:

BadRequestError                           Traceback (most recent call last)
<ipython-input-47-35544a6019f8> in <module>()
      8                 {
      9                     "credential_guid": creds[1]['guid'],
---> 10                     "value": "..."
     11                 }
     12             ]

/usr/local/lib/python3.5/site-packages/atrium/utils.py in anotherWrapper(*args, **kwargs)
     11                 kwargs['payload'] = new_data
     12             # Unpack using the same key
---> 13             res = func(*args, **kwargs)[key]
     14 
     15             # storigify them

/usr/local/lib/python3.5/site-packages/atrium/api.py in createMember(self, userGuid, payload)
    196         url = "users/{}/members".format(userGuid)
    197 
--> 198         return self._makeRequest(url, "POST", payload=payload)
    199 
    200     @cleanData('member')

/usr/local/lib/python3.5/site-packages/atrium/api.py in _makeRequest(self, endpoint, method, payload)
     58         status = r.status_code
     59         if status == 400:
---> 60             raise BadRequestError(payload)
     61         elif status == 401:
     62             raise `UnauthorizedError()`

Could this be the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.