Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve API usability #7

Open
Yann-P opened this issue Sep 3, 2021 · 2 comments
Open

Improve API usability #7

Yann-P opened this issue Sep 3, 2021 · 2 comments

Comments

@Yann-P
Copy link

Yann-P commented Sep 3, 2021

Some API functions accept a large number of optional arguments, like

public async applicationsList (xAccountToken: string, candidateId?: string, createdAfter?: Date, createdBefore?: Date, creditedToId?: string, currentStageId?: string, cursor?: string, expand?: 'candidate' | 'candidate,credited_to' | 'candidate,credited_to,current_stage' | 'candidate,credited_to,current_stage,reject_reason' | 'candidate,credited_to,reject_reason' | 'candidate,current_stage' | 'candidate,current_stage,reject_reason' | 'candidate,job' | 'candidate,job,credited_to' | 'candidate,job,credited_to,current_stage' | 'candidate,job,credited_to,current_stage,reject_reason' | 'candidate,job,credited_to,reject_reason' | 'candidate,job,current_stage' | 'candidate,job,current_stage,reject_reason' | 'candidate,job,reject_reason' | 'candidate,reject_reason' | 'credited_to' | 'credited_to,current_stage' | 'credited_to,current_stage,reject_reason' | 'credited_to,reject_reason' | 'current_stage' | 'current_stage,reject_reason' | 'job' | 'job,credited_to' | 'job,credited_to,current_stage' | 'job,credited_to,current_stage,reject_reason' | 'job,credited_to,reject_reason' | 'job,current_stage' | 'job,current_stage,reject_reason' | 'job,reject_reason' | 'reject_reason', includeRemoteData?: boolean, jobId?: string, modifiedAfter?: Date, modifiedBefore?: Date, pageSize?: number, rejectReasonId?: string, remoteId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PaginatedApplicationList;  }> 

(https://github.com/merge-api/merge-ats-node/blob/9a10a0fd8d230977ed5fac56bac5990c9fddbe15/api/applicationsApi.ts)

We need to filter by modifiedAfter so we have to use it like this:

await applicationsList(token, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, modifiedAfter)

It would be more practical to accept an object so we can simply call

await applicationsList({ xAccountToken, modifiedAfter }) or await applicationsList(xAccountToken, { modifiedAfter })

@justin-maki
Copy link

justin-maki commented Nov 10, 2021

Hello, we have the same issue. Can we improve this API please ?
cc: @Gallinaryoso

@brianbolnick
Copy link

Chipping in here as well. This is pretty annoying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants