Search

Hi experts

I am trying to send Structured Objects in messages.

But I can find this documentation only https://rest-api.symphony.com/docs/objects#sending-structured-objects-in-messages

We want to pass our own Json data via message. message type we found so far are com.symphony.timer, com.symphony.menu and com.symphony.iframe.

Iframe is good for us, but my question is if we want to pass our own json data(myObj in example below) together with iframe, what is type in data? how to pass it?

An example of json we want to pass in is myObj = { "name":"John", "age":30, "car":null };

Iframe code below works fine. {

let streamId = '1111111'

let url = 'https://localhost:4000/ideas.html#'

let messageData = {
  "frame1": {
    type: 'com.symphony.iframe',
    version: '1.0',
    url: url
  }
}

messageData = JSON.stringify(messageData)

authRequestWithTokens.post({
  url: 'https://test.symphony.com/agent/v4' + '/stream/' + streamId + ' /message/create',
  formData: {
    message: '<messageML><div class="entity" data-entity-id="frame1">[anything]</div></messageML>',
    data: messageData
  }
}, (err, resp, body) => {
  if (err) {
    res.send(err)
  } else {
    res.send(body)
  }
})

}

Any documentation or sample are appreciated!

Thanks Hongliu

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details