Status: Open
Status: Answered
Status: Closed
Status: Duplicate

Notifications

0
Posted Apr 09 by Brian Richardson.
Updated Apr 10 by Werner De Jong.

I tried following the following tutorial:
https://developer.opentext.com/webaccess/#url=%2Fawd%2Fresources%2Farticles%2F8545%2Fappworks%2Bnotifications

but i was unable to get the notifications feature working, i am having trouble structuring the request properly.

Here is an example of what i am trying to submit, following the convention of the tutorial:

key="c8d64af189bdb292e62cc6fb99b339930e4b4f60001d63d1"  
users="otag","otag@otag"  
message= 
{  
  "type":"testIt",  
  "displayType":"show",     
  "body":"this is a test, this is only a test",     
  "header":"this is a test"   
}

I have tried several combination of using quotes and without - no difference, same error

This is the error i receive:

HTTP Status 400 -

type Status report

message

description The request sent by the client was syntactically incorrect.

It would make things a lot easier if the entire payload used the JSON structure.

{
    "key": "someKey",
    "users": ["usr1","usr2","usr3"],
    "message": {}
}

Can someone post a sample of what the POST payload should look like.

Any help would be appreciated.

Cheers,
Brian

2 Answers

0
BEST ANSWER: As chosen by the author.

Hi Brian,

Many thanks for your post. I have asked for assistance from the product team.

Regards,

Werner


1
BEST ANSWER: As chosen by the author.

Code might be clearest:

$.ajax({
 url: '...',
 type: 'POST',
 data: {
  key: key,
  users: 'user1,user2,user3'
  message: JSON.stringify({displayType: 'show', body: 'test'});
 }
});

I agree with your point about the all-JSON payload. The appworks convention to date has been to use urlencoded params rather than an application/json entity. For some uses (particularly in strongly-typed languages), this is simpler than building JSON structures. In this case, likely not.


 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.

Statistics

Related categories

Related tags

Your answer

To leave an answer, please sign in.