Forum Discussion

b_poplin's avatar
b_poplin
Expert
11 years ago

api message reply message.body alternative

Hello,

 

I am currently running into URL size limit restrictions and encoding issues when attempting to post replies via the API.  I would like to submit the body of the reply as POST content, rather than message.body query parameter.

 

Is there an official alternative to 'message.body' query parameter that allows me to submit as POST content?

 

Thanks,

  • Hi Britt,

    I tried this using POSTMAN rest client where I posted a reply to a message with message.body passed in as form-data and it worked just fine. Hopefully you should be able to do something similar. Let me know if it doesn't work.

    Regards,
    Chhama

3 Replies

  • Hi Britt,

    I tried this using POSTMAN rest client where I posted a reply to a message with message.body passed in as form-data and it worked just fine. Hopefully you should be able to do something similar. Let me know if it doesn't work.

    Regards,
    Chhama
  • b_poplin's avatar
    b_poplin
    Expert
    11 years ago

    Yes, this was my mistake.  We are using AngularJS to create our web app, and we are using $http to POST the data.  Early in development we used "params" to submit message.subject and message.body to the reply.  This worked, but it was working differently than we intended.  It was actually creating a GET like URL, and Lithium API was allowing it.

     

    The problem came in testing, when it came to large data sets and some strange characters.  Since was not POST, was failing URL reasons.

     

    This stackoverflow discussion became the foundation for our solution:

    http://stackoverflow.com/questions/11442632/how-can-i-make-angular-js-post-data-as-form-data-instead-of-a-request-payload

     

    Thanks for your time and help.

  • b_poplin's avatar
    b_poplin
    Expert
    11 years ago

    Just to consolodate information for those with similar questions/problems, ChhamaJ provided the following information about reply body limitations to me on a private channel.  Thanks again ChhamaJ!

     

    Hi there,

     

    If I understand this correctly, you are talking about size limit on message body. If yes, then there is a size limit of 1,000,000 characters in the message body(see this reply ).

    Hope this helps, let me know if it doesn't or if I misunderstood this.

     

    Regards,
    Chhama