Forum Discussion
Hi Inactive User ,
Yes, this should work in the endpoints., i.e. you can call a custom endpoint on link click, or you can also look to create a complete ajax call with jquery(convert the curl command to javascript code) if you are not comfortable with Freemarker. But the use of the freemarker object is good as it will not expose the API and Data.
Documentation to use Jquery in the community
https://developer.khoros.com/khoroscommunitydevdocs/reference/liaaddscript
Please Give Kudos if you find this post useful and also mark this as Accepted Solution if this is the required solution.
Regards
Tarun Kumar
I'm very confused here; trying to do it in FM but the feedback is so limited. How can I know the structure of the call response (resp) so I can work with what's returned? I try it as a list and get nothing I recognize, plus errors. Also, how do I generate A session key?
<#assign messagePostCall = restBuilder()
.method("POST")
.path("/subscriptions")
.body({
"type": "message",
"board": {
"id": "angular-test"
},
"target": {
"type":"label",
"id": "Jupiter"
}
})
.admin(true) />
<#assign resp = messagePostCall.call() />
<#list resp as k ,v>
k: ${k}
</#list>
This is what I get from that <#list>. Looks like a list of properties but nothing I can use, until we get to an error.
k: getClass k: validTemplateModelObject k: toSerializedString k: isValidTemplateModelObject k: hashCode k: equals k: get k: toString
Attempt to use a type that is not allowed: java.lang.Class
Related Content
- 11 months ago
- 2 years ago