I'm trying to create a task from an app using the NodeJS library.
My v3 api calls are working great using an OAuth token, but as I understand it, there are no engagement API calls yet in v3, so I'm trying to use the ApiRequest as described in the Not Wrapped Endpoints section to make the call described in the v1 legacy docs under Create An Engagement endpoint.
I get an HTTP request failed error calling that endpoint url using this code:
The library reference says to use 'path', the legacy docs say to use 'url'. I have found that 'path' works in other places, so I used 'path' above.
The legacy docs do not go over using an oauth access token, but I believe this is wrapped by the nodejs library and the error says nothing about authorization. Do I need to include it as a qs paramater in options? With what parameter name?
The status needs to be NOT_STARTED, COMPLETED, IN_PROGRESS, WAITING, or DEFERRED.
When I carefully set Status using the literal "NOT_STARTED", the api call worked. So I have to be careful to only allow a status value from the pre-defined list.
More specifically, passing Status as an empty string causes the API call to fail. But note that passing Status as undefined appears to work.
Also note no access token is needed, so it appears the API takes care of that.
The status needs to be NOT_STARTED, COMPLETED, IN_PROGRESS, WAITING, or DEFERRED.
When I carefully set Status using the literal "NOT_STARTED", the api call worked. So I have to be careful to only allow a status value from the pre-defined list.
More specifically, passing Status as an empty string causes the API call to fail. But note that passing Status as undefined appears to work.
Also note no access token is needed, so it appears the API takes care of that.
Yes, I'm still working on this. I'm a weekend warrior on this project, but I try to keep up on my posts in between.
Still not solved, but perhaps more info. I discovered the nodejs sample apps have a call that creates a task here. But it creates it by getting an existing engagement, cloning it and doing a set on the payload for start and end times. I'm creating a new task reflecting an exterior action, so there is no existing engagement for me to clone like this. But this might indicate I need to set the full structure of the engagement, so I'll play with that.
I also found json that shows the oauth access token using the Bearer tag unde qs, but I don't recall where I saw this. So I'll play with that as well.