unomi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Huber <shu...@apache.org>
Subject Re: Troubleshooting 204 errors
Date Mon, 15 Oct 2018 08:45:51 GMT
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 <mike@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''
>
>

Mime
View raw message