[ 
https://issues.apache.org/jira/browse/UNOMI-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16883102#comment-16883102
 ] 

Serge Huber edited comment on UNOMI-238 at 7/11/19 3:40 PM:
------------------------------------------------------------

Ok I executed the following request and it seems to work : 

{code}
curl -X POST http://localhost:8181/cxs/profiles \
 --user karaf:karaf \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
{
  "itemId": "3792347958023045",
  "properties": {
    "foo-bar": "67123012087946927342",
    "customer-id": "513687938109428376497",
    "alternate-customer-id": "62398472340290482",
    "status": "foo",
    "customer-type": "recurrent",
    "loyalty-points": 234,
    "loyalty-points-lastupdate": null,
    "createDate": null,
    "createUser": null,
    "lastUpdate": null,
    "lastUpdateUser": null,
    "birthDate": "1995-01-29",
    "gender": "male",
    "firstName": "Michele",
    "lastName": "Riva",
    "addresses": {
      "shippingAddress": {
        "address": "address-here",
        "city": "milan",
        "zip": "20100",
        "state": "it",
        "province": "mi"
      }
    },
    "phone": "0000000000",
    "email": "email-here",
   "some-service-id": "1623918700203123"
  },
  "consents": {
    "foo/policy": {
      "scope": "foo",
      "typeIdentifier": "policy",
      "status": "GRANTED",
      "statusDate": "2018-05-22T09:27:09Z",
      "revokeDate": "2020-05-21T09:27:09Z"
    },
    "foo/contacts": {
      "scope": "foo",
      "typeIdentifier": "contacts",
      "status": "GRANTED",
      "statusDate": "2018-05-22T09:27:09Z",
      "revokeDate": "2020-05-21T09:27:09Z"
    }
  }
}
EOF
{code}

Note that: 
- I removed the version
- I used double-quotes on all properties
- I had to provide proper dates for the statusDate or revokeDates, if the 
format was invalid they weren't accepted.

So it seems like this works and it is not a bug.

Regards,
  Serge Huber.


was (Author: shuber):
Ok I executed the following request and it seems to work : 

{code}
curl -X POST http://localhost:8181/cxs/profiles \
 --user karaf:karaf \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
{
  "itemId": "3792347958023045",
  "properties": {
    "foo-bar": "67123012087946927342",
    "customer-id": "513687938109428376497",
    "alternate-customer-id": "62398472340290482",
    "status": "foo",
    "customer-type": "recurrent",
    "loyalty-points": 234,
    "loyalty-points-lastupdate": null,
    "createDate": null,
    "createUser": null,
    "lastUpdate": null,
    "lastUpdateUser": null,
    "birthDate": "1995-01-29",
    "gender": "male",
    "firstName": "Michele",
    "lastName": "Riva",
    "addresses": {
      "shippingAddress": {
        "address": "address-here",
        "city": "milan",
        "zip": "20100",
        "state": "it",
        "province": "mi"
      }
    },
    "phone": "0000000000",
    "email": "email-here",
   "some-service-id": "1623918700203123"
  },
  "consents": {
    "foo/policy": {
      "scope": "foo",
      "typeIdentifier": "policy",
      "status": "GRANTED",
      "statusDate": "2018-05-22T09:27:09Z",
      "revokeDate": "2020-05-21T09:27:09Z"
    },
    "foo/contacts": {
      "scope": "foo",
      "typeIdentifier": "contacts",
      "status": "GRANTED",
      "statusDate": "2018-05-22T09:27:09Z",
      "revokeDate": "2020-05-21T09:27:09Z"
    }
  }
}
EOF
{code}

Note that: 
- I remove the version
- I used double-quotes on all properties
- I had to provide proper dates for the statusDate or revokeDates, if the 
format was invalid they weren't accepted.

So it seems like this works and it is not a bug.

Regards,
  Serge Huber.

> Unable to create profile with consent info
> ------------------------------------------
>
>                 Key: UNOMI-238
>                 URL: https://issues.apache.org/jira/browse/UNOMI-238
>             Project: Apache Unomi
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.4.0
>            Reporter: Michele Riva
>            Priority: Critical
>
> Hi,
> I'm not able to create a profile including its consents properties.
> If I try to add the "consents" property to the profile, Unomi returns a 500 
> status code. Looking at the docs, I've seen that the only way to add consents 
> is by posting an event on a given session.
> I currently have millions of profiles to be imported and adding their consent 
> during profile creation would be awesome.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to