Skip to content

using two addons #12

Description

@ryankicks

For the Python example, I'm trying to use two addons with phoneid(), but it doesn't seem to be working. My code does the following:

response = phoneid.phoneid(phone_number, ucid, addons={'number_deactivation': {}, 'contact': {}})

When I execute, I only get number_deactivation back. When I only use contact, it will return contact information. When I only use number_deactivation, it will return number_deactivation information.

I wonder if it's related to this code in rest.py:

        if method_name in ['POST', 'PUT']:
            payload = {'data': url_encoded_fields}
        else:
            payload = {'params': url_encoded_fields}

I wonder if it's because it flattens the structure in the payload/API call, as such:

{u'data': 'addons=contact&addons=number_deactivation&ucid=ATCK'}

When I use CURL, passing two parameters works, as such:

curl --request POST https://rest-ww.telesign.com/v1/phoneid/SOMENUMBER --header "Content-Type: application/json" --data '{"addons":{"number_deactivation":{},"contact":{}}}' --user "TOKEN":"KEY"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions