hellosign / hellosign-python-sdk

A Python SDK for HelloSign's API
MIT License
29 stars 48 forks source link

get_template_edit_url returning incorrect edit_url for editing embedded templates #86

Open JoshAllenJones opened 3 years ago

JoshAllenJones commented 3 years ago

When trying to edit an embedded template, get_template_edit_url() returns an edit_url. It is able to be used to open the iFrame on the client side, however, upon making any changes, an error is thrown via the iFrame. The error number is js409b72b56. While trying to find a solution, I opted to use the requests library and was able to successfully edit an embedded template. For reference, here is the call being done by the requests library:

        post_data = {
            "test_mode": 1,
        }
        edit_obj = requests.post(f'https://{current_app.config.get("HS_API_KEY")}:@api.hellosign.com/v3/embedded/edit_url/{template_record.template_id}', data=post_data)
        resp_dict = edit_obj.json()
        print(edit_obj.json())
        edit_url = edit_obj.json()["embedded"]["edit_url"]
        print(edit_url)

This allows you to edit and save changes via the iFrame.

gpopoteur commented 3 years ago

Thanks for reporting this issue @JoshAllenJones , we will investigate this further.