rapidpro / rapidpro-python

Python client library for the RapidPro API
BSD 3-Clause "New" or "Revised" License
18 stars 27 forks source link

TembaBadRequestError exception with create_contact #62

Closed gravitz closed 4 years ago

gravitz commented 5 years ago

Hi Team,

For the past few days we have observed scripts we wrote and have used before, that use create_contact endpoint are now throwing a TembaBadRequestError exception and no further information.

image

Getter api functions appear to be working as expected.

Other than the homepage (https://rapidpro-python.readthedocs.io/en/latest/index.html), the api documentation pages appear to no longer have content.

Please advise.

Engel

rowanseymour commented 5 years ago

Hi @gravitz can you try making that request directly to the API (can use the API explorer page) and see what the response is? Need to know if there is any error message coming back from RapidPro at all.

norkans7 commented 5 years ago

@gravitz I think you are missing a + in the URN

norkans7 commented 5 years ago

@gravitz I double checked and saw the + is not required, however the phone number in the URN must be valid

norkans7 commented 5 years ago

You want to use a try/except to have more info on the exception raised

gravitz commented 5 years ago

Ni Norbert. What I shared is an excerpt from code that has behaved correctly in the past (the URN is made up but this is not the issue).

norkans7 commented 5 years ago

Are you sure you have the latest version? Try to use a try/except and get more info on the exception raised.

gravitz commented 5 years ago

Hi @norkans7

I was running v 2.4 and updated to 2.5.1 and tried it with a urn (with a + sign) which seemed to fix it.