Serge, good suggestion! I removed that line, still 204.

I went into karaf.log and see a lot of these messages:

2018-10-15T22:05:01,912 | ERROR | Timer-4 |
ElasticSearchPersistenceServiceImpl | 168 -
org.apache.unomi.persistence-elasticsearch-core - 1.3.0.incubating | Error
while executing in class loaderjava.lang.Exception: Error loading
itemType=org.apache.unomi.api.PropertyType query={

2018-10-15T22:05:01,915 | ERROR | Timer-4 | ProfileServiceImpl | 179 -
org.apache.unomi.services - 1.3.0.incubating | Error loading property types
from persistence service

These seem to be happening every 10 seconds. I'm not sure if this is
related to the request I am making or not. Any advice? I'm trying to just
test out how the goals functionality works.


On Mon, Oct 15, 2018 at 4:47 AM Serge Huber <shu...@apache.org> wrote:

> Oh and just looking at your query, try removing the
> "propertyValuesDateExpr": [],
> line.
>
> Regards,
>   Serge...
> On Mon, Oct 15, 2018 at 10:45 AM Serge Huber <shu...@apache.org> wrote:
> >
> > Hello Michael,
> >
> > Did you check the Unomi logs in data/log/karaf.log ? Usually it should
> > tell you what's going on.
> >
> > I usually use the log:tail command in the the Karaf shell when working
> > on requests. And you could also set CXF to debug if it's rejecting
> > some malformed JSON.
> >
> > Regards,
> >   Serge...
> >
> > On Mon, Oct 15, 2018 at 4:28 AM Michael Ghen <m...@mikeghen.com> wrote:
> > >
> > > When I start using a new part of the API, I keep running into 204
> errors (no content). Sometimes I can resolve them by reformatting my JSON.
> > >
> > > After comparing my JSON request to the API docs line by line, I'm at a
> loss for how to create a goal.
> > >
> > > I'm trying to create a goal using this Python code, is something wrong
> with this JSON?
> > >
> > > import requests
> > > from pprint import pprint
> > > import json
> > >
> > > r = requests.post('http://x.x.x.x:8181/cxs/goals/',
> > >     auth=('karaf', 'karaf'),
> > >     json={
> > >         "itemId":"1",
> > >         "itemType":"goal",
> > >         "version": None,
> > >         "metadata": {
> > >             "readOnly": False,
> > >             "name": "Test Goal",
> > >             "id": "1",
> > >             "scope": "reach",
> > >             "enabled": True,
> > >             "tags":[],
> > >             "systemTags": [],
> > >             "description": "Triggered when someone turns 18.",
> > >             "missingPlugins": False,
> > >             "hidden": False
> > >         },
> > >         "startEvent": None,
> > >         "targetEvent": {
> > >             "type": "profilePropertyCondition",
> > >             "parameterValues": {
> > >                 "propertyValuesDateExpr": [],
> > >                 "propertyName": "properties.age",
> > >                 "comparisonOperator": "greaterThan",
> > >                 "propertyValueInteger": "18"
> > >             }
> > >         }
> > >     })
> > >
> > > pprint(r)
> > > pprint(r.content)
> > >
> > > Result:
> > >
> > > <Response [204]>
> > >
> > > b''
> > >
> > >
>

Reply via email to