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

Feature: Event Subscription API #263

Open
heakinakai opened this issue Mar 19, 2018 · 3 comments
Open

Feature: Event Subscription API #263

heakinakai opened this issue Mar 19, 2018 · 3 comments

Comments

@heakinakai
Copy link

Hi,

Can we have the Event Subscription API added to the class for us Node server users?

I would like to be able to use the workfront api class to register, list, remove event subscriptions.

I have already written this into a forked version of the repository, but not written any tests or Documentation for it yet. I didn't really go any further than writing it for my own use as I'm not sure you accept outside pull requests. Happy to contribute if you would like me to.

Please let me know if this is something you plan on adding.

@bhovhannes
Copy link
Member

bhovhannes commented Mar 19, 2018 via email

@heakinakai
Copy link
Author

heakinakai commented Mar 21, 2018

Thanks, I'm re-writing now to be more in line with the original style of the library.

Few questions.

As you may know, the Event Subscription API is laid out differently to the standard API.

  • It's not part of 9.0 api and has no object reference.
  • It's authorized using the API key with the Header "Authorisation"
  • it does not match any of your current post body methods in the request method
  • it does not return a data object, it returns json with no key

all the above means I have 2 options.

  1. make the request method more complaint with both API's
  2. Add a separate fetch method to my event method and bypass the global request method

Also above I mentioned Authentication. The user would have to use method 'getApiKey' before event method instead of login, as it requires a different level of authorization.

You can see my original version here https://github.com/heakinakai/workfront-api (still re-writing it properly)

At the moment it is as follows:

new Interface

interface IEventAction {
create: (objCode: string, event: string, url: string, authToken: string, objId?: string) => Promise<any>
list: () => Promise<any>
remove: (subscriptionId: string) => Promise<any>
get: (subscriptionId: string) => Promise<any>
}

new methods

workfront.getApiKey(user, password).then(() => {
    workfront.event.create()
    workfront.event.list()
    workfront.event.remove()
    workfront.event.get()
})

@bhovhannes
Copy link
Member

@heakinakai , unfortunately I am not super aware of what Event Subscription API is, however, taking into account the differences from standard API you've mentioned, I am thinking more about publishing a separate package which will deal with event subscriptions and has workfront-api as a dependency rather than modifying existing code.

@citizensas , any ideas on this?

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

2 participants