I have implemented a simple UCMA 3.0 application on my Lync server machine, which creates an application endpoint and establishes IM calls to Lync users. When I start the application, everything is registered ok, and a toast message is received on Lync clients with an initial message. I can send messages from the UCMA application, but when I type in some text and send it back to UCMA app, there is an error that displays in conversation window:
When contacting your support team, reference error ID 504 (source ID 239).
Troubleshooting information is available online, including best practices for using Lync.