Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RESTful service cannot parse complex JSON

bsamuelJun 25 2019 — edited Jul 1 2019

Dear Apex community,

Application Express 5.1.4.00.08

ORDS 17.4.1

Database 12c Standard Edition 12.2.0.1.0

We are trying to create a RESTful service via the Apex builder that is intended to be a webhook for our mailing platform that informs us of any bounces.  The issue we are facing is that it seems, by default, the service parses the received JSON and it is here that we are getting the following error:

400 Bad Request

Expected a value but got: START_OBJECT

I was reading somewhere that the parser can only handle simple JSON?  This was an old article, is this true for version 5.1.4?  I tried the exact same service setup under 19.1 on apex.oracle.com and it worked as expected.  Below is the sample JSON supplied by our mailing platform to test the webhook.  Is there anything we can do to successfully receive this (other than upgrade to 19.1 that is)?

{

  "event": "accepted",

  "id": "jxVuhYlhReaK3QsggHfFRA",

  "timestamp": 1529692198.641821,

  "log-level": "info",

  "method": "smtp",

  "flags": {

    "is-authenticated": false

  },

  "message": {

    "headers": {

      "to": "team@example.org",

      "message-id": "20180622182958.1.48906CB188F1A454@exmple.org",

      "from": "sender@example.org",

      "subject": "Test Subject"

    },

    "attachments": [],

    "recipients": [

      "team@example.org"

    ],

    "size": 586

  },

  "storage": {

    "url": "https://se.api.mailgun.net/v3/domains/example.org/messages/eyJwI...",

    "key": "eyJwI..."

  },

  "recipient": "team@example.org",

  "recipient-domain": "example.org",

  "campaigns": [],

  "tags": [],

  "user-variables": {}

}

This post has been answered by Pavel_p on Jun 26 2019
Jump to Answer
Comments
Post Details
Added on Jun 25 2019
12 comments
1,643 views