Forum Discussion
Thank you. Any thoughts on how I could create a link on a page with that script? I'm at a loss of where to use curl on a Community page. Component? Endpoint? Is it even valid in freemarker? Etc.
ian You can build more complex LiQL calls with this object: https://developer.khoros.com/khoroscommunitydevdocs/reference/restbuilder
- Inactive User5 years ago
Would this be correct, then?
<#assign messagePostCall = restBuilder() .method("POST") .path("/subscriptions") .body({ "type": "message", "board": { "id": "board-test" }, "target": { "type":"label", "id": "Jupiter" } }) .admin(true) /> <#assign resp = messagePostCall.call() />
- Inactive User5 years ago
MattV and or Tarun I'm completely at a loss here. Can you show me specifically what to do?
I'm happy to either do this in an endpoint or with JQuery, but I'm just not sure how to get the subscription part to work with an API call.
I can get the basic call to work in JQuery using Tarun's script but beyond that I'm unable to understand what's required beyond this:
<@liaAddScript> ;(function ($) { $.ajax({ type: "Get", url: "/api/2.0/search?q=SELECT * FROM users WHERE id='${user.id}'", success: function (data) { console.log('SubscribetoLabel', data) }, }); })(LITHIUM.jQuery); </@liaAddScript>
I don't understand how to include the rest that Tarun included.
Related Content
- 11 months ago
- 2 years ago