0

I am trying to implement an Approval Flow using Adaptive Cards and building an RESTful API in Java to use for Actions in Adaptive Cards.

I was able to validate the token from the Adaptive Card using this.

But in order for my API to send a Refresh Card as a response, i need to author and render the Adaptive Card.

There is an SDK for Android but not for specifically for Java.I have tried to work with adaptivecards-android-1.2.5 jar, but just unable to load the classes.

Is there any SDK for Java or any other way how we can utilize the Android SDK?

kakabali
  • 3,824
  • 2
  • 29
  • 58
AhmedVali
  • 185
  • 2
  • 16
  • Unfortunately there is no plain-Java SDK available at this time. The source code is available here, hopefully you would be able to pull out the parts you need: https://github.com/microsoft/AdaptiveCards/tree/master/source/android – Matt Hidinger Jan 31 '20 at 18:55

2 Answers2

0

At the end of the day, although it sounds fancy, an "Adaptive Card" is actually just a JSON string. As a result, even without a good strongly-typed library, you can just create the raw JSON yourself to send, do your own string/token replacements, and send it to the end destination. Just as an example, have a look at this question and the 2nd option in my answer: Display number in adaptive card

As a further suggestion, once it's all working, perhaps you can contribute to a Java version of Adaptive Cards - it is an open source project, after all :-)

Hilton Giesenow
  • 9,809
  • 2
  • 10
  • 24
0

You could see how we did this in the Spring Bot project, which uses Graalvm Polyglot to render from within the JVM. Check out the JavascriptSubstitution class

Rob Moffat
  • 465
  • 5
  • 11