cancel
Showing results for 
Search instead for 
Did you mean: 

Subscribe to notification is json format

former_member182670
Contributor
0 Kudos

Hi,

Is it possible to subscribe to notifications with json request?

I know it's possible to receive json which is controlled by 'accept' header I'm interested in the first part.

All examples for subscribing are using xml atom format like here or here

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Tomasz,

Add below Header ->

Content Type -  application/json

Create JSON payload as below -> Sample

{

    "ID": "50001444",

    "Name": "John"

}

Regards,

Ashwin

former_member182670
Contributor
0 Kudos

Hi,

I know how to update 'normal' entities with JSON and what header & payload has to be provided.

This however doesn't seem to work for SubscriptionCollection.

I'm getting 500 Internal Server Error and

<code>

CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406

</code>

<message xml:lang="en">

Error while parsing an XML stream

</message>

in response
former_member182670
Contributor
0 Kudos

Turned out to be an issue with the payload.

I managed to get it working with following data:

headers:

accept: application/json

x-csrf-token: my_token

payload:

{

"deliveryAddress": "http://xyz:8000",

"persistNotifications": false,

"collection": "MyCollection"

}

Now I see new entries in table /IWBEP/D_MGW_SUB

Answers (0)