merge-api / merge-java-client

The JVM SDK for accessing various Merge Unified APIs
Other
3 stars 5 forks source link

Fetching a category agnostic link token #32

Open terratrue-daniel opened 7 months ago

terratrue-daniel commented 7 months ago

According to Merge's documentation, there is a way of fetching a category agnostic link token from this endpoint: https://api.merge.dev/api/integrations/create-link-token

In this SDK, it seems that you are forced to select a category specific client client (ats(), accounting(), etc.) in order to fetch a link token. E.g. From the README:

LinkToken linkToken = mergeClient.ats().linkToken().create(EndUserDetailsRequest.builder()
    .endUserEmailAddress("john.smith@gmail.com")
    .endUserOrganizationName("acme")
    .endUserOriginId("1234")
    .categories(List.of(CategoriesEnum.ATS))
    .build());

And that link token is fetched from a different endpoint: <base_url>api/ats/v1/link-token

Is there a way to fetch a category agnostic link token so that Merge Link can be powered? Otherwise we would have to create custom UI to figure out what category the user would like to create the link for, then fetch the link token for that category, then use that to power Merge Link.

Ideally we would fetch a link token that's not tied to a category, and use that to power the Merge Link UI component without going through the first step.

dsinghvi commented 6 months ago

@rmkonnur do you have any insight here -- it sounds like there should be a non-category specific endpoint for create-link-token ?