These are chat archives for WP-API/node-wpapi

4th
Jul 2016
kkuhler
@kkuhler
Jul 04 2016 05:22
Hi I love the code so far... can you apply filters to custom endpoints?
something like this:
site.namespace( EE_JSON_EPNT ).tickets().filter('Datetime.Event.EVT_ID',parseInt(splitPath[2])).then(function(data){
K Adam White
@kadamwhite
Jul 04 2016 13:02
@l
@kkuhler you ought to be able to; if the endpoint properly declares that it accepts the filter parameter the filter mixin should automatically be applied. Are you seeing that to not be the case? If so, open an issue and we'll take a look! Being able to manually apply mixins is a todo we should capture anyway
kkuhler
@kkuhler
Jul 04 2016 19:21

hmmm. I am closer. It is a parameter of the get function not a filter per se. However, something is still not making sense... I am trying pull this data using the api
https://mysite.com/wp-json/ee/v4.8.36/tickets?where[Datetime.Event.EVT_ID]=5660'

'where' is defined as a parameter for the get method of the tickets endpoint.
how would I pass the parameter to get using the api?
site.namespace(ee/v4.8.36).tickets().get('include:TKT_name').then(...); or any other variants I try do not work

kkuhler
@kkuhler
Jul 04 2016 19:30
site.namespace(ee/v4.8.36).tickets().get('where[Datetime.Event.EVT_ID]=5660').then(...); sorry, I have tried this... the last one listed another parameter
kkuhler
@kkuhler
Jul 04 2016 20:41
One other question. I see the api supports basic authentication. You also mention OAuth1. Is there a way to use OAuth1 or is that entirely down the road
K Adam White
@kadamwhite
Jul 04 2016 23:46
OAuth is WIP from my standpoint, though I believe that others may have gotten it working. @kkuhler the .get method is solely for GETting the resource, and does not transform the request-- the .param method can be used to assign arbitrary request parameters however, so try .tickets().param( 'where[DateTime.Event.EVT_ID]', 5660 ).then(...; awkward, but should work
kkuhler
@kkuhler
Jul 04 2016 23:47
excellent will try it thanks