merge-api / merge-sdk-python

The Python SDK for accessing various Merge Unified APIs
Other
0 stars 1 forks source link

Error in link_token_create #40

Open ahmontero opened 1 year ago

ahmontero commented 1 year ago

This code:

from MergePythonSDK.hris.model.end_user_details_request import EndUserDetailsRequest
from MergePythonSDK.shared.model.categories_enum import CategoriesEnum

 end_user_details_request = EndUserDetailsRequest(
    end_user_email_address=email,
    end_user_organization_name=company_name,
    end_user_origin_id=str(user_id),
    categories=CategoriesEnum("ATS"),
)

seems to work now, but then if I use end_user_details_request to create a token:

# client is configured properly
token_api = LinkTokenApi(client)
token_api.link_token_create(end_user_details_request)

I get the error:

Status Code: 400
Reason: Bad Request
HTTP response body: {"categories":{"0":["\"{'value': 'ats'}\" is not a valid choice."]}}

I am using the latest library version: 2.3.0

ankitd33 commented 1 year ago

Hi! Could you try switching the line that says categories=Categories("ATS") to just categories=["ats"] and see if that works?

ahmontero commented 1 year ago

Hi! I have the same error

ankitd33 commented 1 year ago

hmm interesting i tried the same thing and it worked - can you make sure you are using the newest version (2.3.0) and then send me the same code snippet and error you sent before please!

ahmontero commented 1 year ago

Hi again. I tested it again and now it seems to be working using ["ats"]. Anyway, if I use CategoriesEnum("ATS") it fails.