List of All Tags Used on a Board or Blog, Regardless of Activity
I can get a list of the tags receiving activity in a node for a chosen date range, but management would like a list of all the tags applied, regardless of whether they were clicked. Community Analytics will give me the activity report, but I'm not looking for activity, just existence. Any ideas? PS I'm not great at writing queries from the browser address line, but I figure that's where this will end.229Views1like0CommentsChat function like Slack?
Does anyone have experience with adding a chat function to Lithium? Is it even possible? I'm finding Lithium and creating an open source developer community may not be possible with a developer audience (b2b). We have users of our products & solutions and then we have developers creating their own solutions on top of our products. very different use cases. I'd appreciate any thoughts on the topic as well. Thanks!!!Solved479Views0likes10CommentsSetting to change the display of message feed component
Hi Team, The message feed component in "View Profile Page" is displaying more posts and pagination is happening after 30-35 posts, we want to limit it to 5-10 posts. Is there any admin setting/ xml parameter that can control the posts display number? Appreciate your help in advance!satya4 years agoExpert252Views0likes0CommentsRetrieving Session Key
Hello everyone, The overview: I want to create message to a forum from custom components using js ajax request. so in order to do this I must addLi-Api-Session-Key. The question: How can I retrieve the existingsession key and send it with the request ? Thanks in advance, SheryPerihanKamel392Views0likes1Commenthtml entity decode
Hi, We all know that freemarker can encode special html characters( &, quotes, < > and more), eg. & => & But I need to way to decode it. eg. & => & I have looked around. It looks like there is no such method built-in to freemarker? PeterSolvedpeterlu4 years agoChampion2.5KViews0likes10CommentsLatest activity not displaying
Hi everyone, Our community has a custom component that displays the trending topics, latest topics, and top liked topics on various tabs. I duplicated the component and scoped it to only display the blog posts for a new category. However, only the trending tab is displaying any content. The latest and top liked tab only shows the spinning loading icon. Here is a snippet of the code for the latest tab. I'm unsure of what more needs to change to get the content to display. <#-- recent --> <section class="custom-tab-content messages_recent" id="custom-community-activity-recent" aria-labelledby="custom-community-activity-recent-label" type="recent" target=".recent-message-list" offset="${messages_to_show}" style="display: none;"> <div class="recent-message-list tabbed-message-list"> <#-- Lazy load the results if the user clicks on the tab. --> </div> <#if messages_all_count gt messages_to_show> <#-- lia view all --> <div class="lia-view-all"> <a href="#" class="load-more-button lia-link-navigation">${text.format("custom-general.load-more")}</a> </div> <#--/lia view all --> </#if> </section> <#--/recent --> Any pointers would be appreciated. Thank you!732Views0likes1CommentHow can we make calls as admin in javascript?
Hello everyone, Question: Some APIs are called using FreeMarker by restadmin or restbuilder using .admin(true) so how can we achieve the same functionality using javascript? Background: We want to create message using javascript for saving user comments to a forum. However, the user doesn't usually have the permission to add message to the forum. Thanks in advance, Perihan KamelPerihanKamel4 years agoContributor388Views0likes1CommentAPI for Email Notification settings of a user
Hi Team, Is there any API available to fetch or set the Email Notification settings of a user? We are looking to get the value of “New topics or articles posted in boards I subscribe to” which is a field in User Subscription and Notification settings. Please see the attached image below for reference(the required setting is highlighted in red).satya4 years agoExpert475Views1like3CommentsRegEx only partially working
Hi folks. Question. I have pretty standard regex in place to filter emails, but it only works sometimes. Say I want to filter bonomi @spotify.com. These are my results: Submitted Post: bonomi @ spotify.com bonomi @ spotify.com Result: *bleep* *bleep* Submitted post: bonomi @ spotify.com bonomi@spotify.com Result: *bleep* *bleep* Submitted post: bonomi@spotify.com bonomi@anything.random bonomi @ spotify.com anyone@anydomain.net Result: **bleep**spotify.com **bleep**anything.random bonomi @ spotify.com **bleep** And therein lies the problem. Why is the same email filtered out on line 1 in previous posts, but not on line 3 in the last one? Do I need some kind of check for paragraph? I'd expect that not to matter? The RegEx I'm using: [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*(\s)*(@|(\s@\s)+)+(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?((\s)*\.(\s)*))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?443Views0likes5CommentsPrivate/Visibility logo overlay in Atlas
I've been admiring this new overlay in Atlas, indicating the "visible" scope of the current page. Sure, I could reverse engineer and adapt something similar for our own community...but I wonder if the Atlas folks wouldn't mind sharing the component assets? ChrisSolvedcjdinger4 years agoLeader3KViews0likes3CommentsHow to subscribe to a label using a custom link, expecially in a Forum?
Is there a way to subscribe to a label using a custom link? I see that in the Subscribe to Label link in TKBs, there is a url and a token. (See code below) Is there a way to do this without the token? Or how does one generate a token? I have a custom listing page I want to use, and want to add a subscribe to label link on it... <a class="lia-link-navigation subscribe-to-label-link lia-link-ticket-post-action" data-lia-action-token="q-rlUVWyJprfXFSJi-OCeZNSAFKk7xQH-6zDhiPg3sI." rel="nofollow" id="link_7" href="https://yoursite.com/t5/tkb/v2/page.filteredbylabelname.subscribetolabelname.link:subscribeaction/label-name/Analytical%20Application%20Development/board-id/add-ins/subscribed/false?t:ac=blog-id/add-ins/label-name/analytical%20application%20development">Subscribe</a>Inactive User4 years ago803Views0likes12CommentsCustom Badges - badge criteria for date events
Hi everyone! We are creating some new custom badges to improve our gamification and we have found out with an issue. I hope that someone can help us to find a workaround or to report it as a bug. We want to create a badge with this criteria: If the user logs into the community on a specified day of the year, the user gains the badge. Examples: pi day, programmers day, Christmas... To achieve this, the criteria I was using was: example: cake day badge: signin_date >= '2021-2-17' But I can see here a problem because if I go live with this badge, I won't be able to update the formula because live badges are unable to perform this action. So this badge won't be possible to win in 2022. Looking through the documentation I can't find a solution to match login date by day and month but not for a year. https://community.khoros.com/t5/Badges/About-badge-rules-and-supported-badge-criteria/ta-p/117227 How can I achieve this action? Do someone has this type of gamification? How did you achieve this? ThanksSolved2.8KViews0likes8CommentsAnyone actually querying a TKB by Product Category Successfully?
In my staging environment, I am trying to write a component that processes the following LIQL query: SELECT subject,view_href FROM messages WHERE board.id = 'MyBoard@tkb' AND product_category.id = 'MyCategory' AND products.includes = true ORDER by metrics.views DESC LIMIT 5 This example isdirectly from the documentation, with my goal to get the top viewed assets in a given product category. This query, however, returns zero results. If I query for messages for a specific product like the following, I get results: SELECT subject,view_href FROM messages WHERE board.id = 'MyBoard@tkb' AND products.id = 'TheProduct' ORDER by metrics.views DESC LIMIT 5 If I query the products in the product category ID 'MyCategory' I get the expected list of products. SELECT id FROM products WHERE product_categories.id = 'MyCategory' Anyone else doing this successfully? Unfortunately, I've had a support ticket on this open for a few months with no movement or resolution.phoneboy4 years agoDirector743Views0likes2CommentsAPI request to Approve/Deny request to join a Group Hub Doesn't Seem to Work
I'm writing a component that will automatically approve a request to join a closed Group Hub. This will be included in the relevant page quilt and is intended to replicate the functionality of legacy Groups where a group was Open but you had to explicitly join it before you saw content. Looking at the relevant API documentation, it seems like it would be a relatively straightforward thing to implement. The component looks like the following: <#import "khoros-user-utils.ftl" as userUtils /> <#if user.registered > <#assign uid = user.id?c /> <#assign node = coreNode.id /> <#assign messagePostBody = { "type": "membership_request", "approve_request": true, "user_id": uid } /> <#assign url = "/nodes/grouphub:${node}/membership_requests" /> <#assign resp = restadmin("2.0",url,"PUT",messagePostBody) /> </#if> The API always returns "Membership Request not found" even though there is definitely a membership request for the relevant user in the relevant Group Hub: { "status" : "success", "message" : "", "http_code" : 200, "data" : { "type" : "membership_requests", "list_item_type" : "membership_request", "size" : 1, "items" : [ { "type" : "membership_request", "user" : { "type" : "user", "id" : "226", "href" : "/users/226", "view_href" : "/t5/user/viewprofilepage/user-id/226", "login" : "Doug" }, "request_to_join_date" : "2020-09-18T00:56:56.885+02:00" } ] }, "metadata" : { } } Is there a bug with the API call or am I calling it incorrectly?phoneboy4 years agoDirector786Views0likes3CommentsPOST Parameters
We are testing a bot-detection tool on our community and see false positives being triggered on some of the pages, which we suspect is a result of the the autosave behavior that happens every 30 seconds. We are trying to determine if there is any difference in terms of POST arguments, HTTP headers, or query strings that will distinguish an autosave POST from the final submit one. Based on our testing, we see the POST parameter “autosave: true” that is being used by the app when message is saved, and the final POST for message submissions does not use this parameter. Can anyone confirm that the distinction between the POST arguments is correct or if there are any other differences we could use to distinguish between autosave and the final post?Inactive User5 years ago466Views0likes2CommentsForce/trigger a SASS precompile at Stage?
When I use the Lithium SDK to submit-plugin to Stage, any *.scss file changes will trigger a SASS compile to build a big CSS for use on the site. Sometimes this compile step is delayed...by minutes, or hours, or longer. Is there a way to trigger it? If I publish before it compiles (and Studio often allows this) then my CSS is out of sync with any other changes. ChrisSolvedcjdinger5 years agoLeader2.3KViews0likes2CommentsCommunity API v2 Documentation is Getting a Refresh
Hello everyone, We're excited to share some news about our Community API v2 documentation! We've brought the API spec and object indexes to our Developer Portal at https://developer.khoros.com. Here is a blog post explaining more:https://community.khoros.com/t5/Khoros-Community-Blog/Community-API-v2-Refresh/ba-p/606472 Have questions? Feel free to leave a comment and let us know! Change is hard! If you get lost with the new structure, here is the link to the old experience. It will be live for another couple of weeks as we evaluate feedback.RyanPi5 years agoKhoros Staff616Views1like0CommentsRegEx to block an email and its variations
Hi folks, figure this might be a good place to ask. Now, realizing nothing is 100% fool- or troll proof, I was wondering if anyone here ever experimented with regex to try and block as many variations of a certain email address as possible. Thanks.Solved2.2KViews2likes5Commentsbest practice for scripts in head tag
Hello Everyone, Please I want to ask about the best practice to avoid jquery and scripts conflicts. The situation is: I have multiple components and they will be nested together in one custom page. The components have jquery, bootstrap and many other cdns and jQuery plugins. Is there an options to avoid scripts versions collisions?Solved426Views1like1CommentHow to solve the conflict between litium jquery and the jquery that I use ?
Hello everyone, How to solve conflict between lithium jquery and the jquery that I use ? The scenario is as follows: I need to have the on document ready function inside the liaAddScript however if I add a script for jquery I get error in the liaAddSCript content and If I didn't add a jquery script I get an error for all the $ is not a function. Ps. this is what I mean by jquery script <script src="/html/assets/jquery.min.js"></script> <@liaAddScript> ;(function($){ $(document).ready(function() { $('table.generic').DataTable(); } ); })(LITHIUM.jQuery); </@liaAddScript> <script> var setTablesFilters = (attrName, tableId, attrIndex) => { var table = $('#'+tableId).DataTable(); let uniqueFilterList = table.column(attrIndex).data().unique().toArray(); return uniqueFilterList.map((val)=>{ return {'name':val, 'checked': false}}); } </script> Thanks in Advance, Shery647Views0likes5CommentsAPI Access issue with / without SSO
Hi Everyone, I am migrating discussions from another platform to a board here. Initially we created an account that was not using SSO, so I was able to create a script that would login with user.login and user.password. That worked all fine, however I think company admin script has likely cleaned up accounts that were not linked to an SSO account, so I am unable to proceed. To get around that we created a new SSO account, and linked that to the API account we used earlier. However this also means I have to get the token from the SSO client, rather than directly through username password. I was told that I could use the LISESSIONID that is generated through a browser login and stored in a cookie, and use that. Since this is more or less a one-time exercise, that would solve my issue, however I am running in some problems. The error message I get is that I am not authorized to make this request. {"status":"error","message":"You are not authorized to make this request","data":{"type":"error_data","code":203,"developer_message":"","more_info":""},"metadata":{}} The account does have API privileges, so not sure what is happening... Any help is appreciated. Thanks, Richard Korffkorffr5 years agoContributor647Views0likes2CommentsSub Menus
Hello Everyone, Before reading my post, please bare with me as I'm very new to HTML, CSS and Java Script, so while you're making questions quite complicated, I'm here to ask something more simple (to you)! I'm learning more and more every day! So I wanted to ask you if it's possible to have a sub menu, inside an already menu, like the image drafted below: I know it involves CSS but could you perhaps tell me where? And how do I do it? I want Financials, Payroll and Logistics to appear only when I hover Business world. Does it make sense? Thank you! Best regards, Adriana Community4Uadriana4u5 years agoMaven600Views0likes5CommentsHow to enable Yoast SEO plugin ?
Hi All, Is there a way to enable Yoast SEO plugin on Khoros website?Solvedjyothikm5 years agoContributor2KViews0likes1CommentPage jumps after the images load
Hey! Are there any ways to lazy load images, so that when the images load the whole page won't jump? The current behavior brakes all the anchor links, as there is more content loading after the anchor navigates to the specific part of the thread/article.pepitaK5 years agoAdept450Views0likes3CommentsUnable to invoke a custom endpoint from another custom endpoint
Hi Everyone, Since Khoros migrated to AWS from their private data center, I started seeing an issue with one of our existing functionality. We are actually invoking a custom end point from another custom endpoint using http.client.request After migration, this started giving us "401 Authorization Required" HTML response. Below is the call which is having the issue: <#assign pointValueResp= http.client.request(lithium_endpoint_url + "/get_message_point_value?postId=${parentPostId}").get()/> where lithium_endpoint_url is communitystage url (https://communitystage.help.ea.com/ea/plugins/custom/electronicarts/ea), get_message_point_value is a custom endpoint and parentPostId is a parameter. As a workaround, I am able to fix this issue on stage by adding a Authorization header to this call as below: <#assign pointValueResp= http.client.request(lithium_endpoint_url + "/get_message_point_value?postId=${parentPostId}").header("Authorization","Basic " + lithium_auth_token).get()/> How can this be fixed with whitelisting instead of adding a header? Thanks and Regards, Sunil MethraSolvedashinde5 years agoGuide1.4KViews0likes3CommentsAPIv2 Subscriptions Troubleshooting
Hi all, I have been banging my head against a brick wall for about an hour now and it's either me (likely) or the Subscriptions API doesnt work. I am trying to use a call like this: Select count(*) from subscriptions where node.id = 'board:Boardid' The goal is to find out how many people have subscribed to that board or any of its children but it doesn't matter what I do I always get a 0 resultunlessI also pass in subscriber.id = '<userid>' what am I doing wrong here, surely I do not need to iterate through all of our users to find out how many subscribed?Solved1.5KViews1like2CommentsCommunity API v1: filter registered users to get real numbers
Hi everyone!! I was playing with v1 of the Community API to create some custom components and I was trying to display the total members registered. I found out that the queryhttps://COMMUNITY/restapi/vc/users/registered/count returns me a bigger number than the one I see in my metrics in the Studio zone. I was thinking if there is a way to filter this by registered and not erased members, to get the current total registered members. I know I also have some SSO members that haven't finished the registration so I also would like to not count them as full registered members. I have not found in the documentation a way to get more specific counts so I was hoping to know if anyone has any ideas about this.Solved1.3KViews0likes4CommentsHow to read XML file content?
Hello, Please I want to read an XML file content which exists in the assets in studio? <#assign doc= ${asset.get('/html/assets/companyProducts.xml')}/> ${doc} my intention is to pass this doc to macro to view each product. so how can I achieve this? because for doc is empty I cant view the products PS. I also tried this one and its not working Map root = new HashMap(); root.put( "doc", freemarker.ext.dom.NodeModel.parse(new File(${asset.get("/html/assets/the.xml")}))); RaniaWaelSolved2.2KViews0likes5CommentsUpload file using http.client.request
Hello, How can I upload a file by making a POST request through http.client.request("") In other words, how can I set the request body with form data as my API is expecting multipart/form-data MIME type. In JavaScript I do it like this: var files = document.getElementById("file-input").files; var formData = new FormData(); formData.append('"file",files[0]); $.ajax({ url : '${endpoint_url}', type : 'POST', data : formData, processData: false, // tell jQuery not to process the data contentType: false, // tell jQuery not to set contentType success : function(data) { console.log(JSON.stringify(data)); } }); Thank you for your help in advance, YoussefYoussefEhab5 years agoContributor678Views0likes1CommentHow to find total number of topics in a particular board
Hi, I am not very technical but can make basic RestAPI calls. I know to get the total number of topics in the community i can usehttp://community-name/restapi/vc/topics/count Similarly how can i find the total number of overall topics in a particular board using the board id.Parvez_AL5 years agoAdvisor625Views0likes4CommentsRemove sensitive roles from inactive users
Saw this idea and couldn't remember if I shared this already. Basically an endpoint that gets called every day and Loops through a list of roles Finds users with those roles Checks that they're not special accounts, e.g. API user accounts Removes the sensitive roles Per affected user it lists the roles that were removed and the roles that remain Optionally sends a PM to the user to notify them Comments inline. I use Google Apps Script to schedule a daily run, but of course there are other options. Disclaimer: I'm not a trained programmer <#-- Automatically remove roles with permissions from users who haven't logged in for a while --> <#assign user_limit = http.request.parameters.name.get("user_limit", "100")?string /> <#-- How many days must the user have been inactive --> <#assign days_staff = http.request.parameters.name.get("", "50")?number /> <#assign days_mod = http.request.parameters.name.get("", "30")?number /> <#assign send_pm = http.request.parameters.name.get("pm", "false")?boolean /> <#-- Roles to remove from the users we find --> <#assign user_roles_remove = [ "Administrator", "LSI", "Level Two Moderator", "Lithium", "Moderator" ]/> <#-- Some users, like API accounts should be skipped, these are their IDs --> <#assign staff_exceptions = [ 123, 456, 789 ]/> </#if> <#assign users_pm_ids = []/> <#-- Spinning up a sequnce to store the IDs of users we may want to PM about their removed access --> <#assign today_long = .now?date?long/> <#assign prev_long_staff = today_long - days_staff * 1000 * 60 * 60 * 24/> <#assign prev_long_mod = today_long - days_mod * 1000 * 60 * 60 * 24/> <#-- convert the user's last visit date string to the long format for calculation --> <#function fnLVD(lvd)> <#assign lvd_show = lvd?datetime?string["yyyy-MM-dd"]/> <#assign lvd_long = lvd?datetime?long/> <#return lvd_long/> </#function> <xml> <users> <#-- Mods --> <#assign query_mod = restadmin("2.0","/search?q=" + "SELECT id,login,last_visit_time FROM users WHERE roles.name IN('Moderator','Level Two Moderator') LIMIT ${user_limit}"?url)/> <#list query_mod.data.items?sort_by("last_visit_time") as u> <#assign lvd_long = fnLVD(u.last_visit_time)/> <#if (lvd_long < prev_long_mod)> <#assign user_id = u.id/> <#assign user_login = u.login/> <#assign query_user_roles = restadmin("2.0","/search?q=" + "SELECT name FROM roles WHERE users.id = '${user_id}' LIMIT 500"?url)/> <#assign user_roles_before = []/> <#list query_user_roles.data.items as r> <#assign role_name = r.name/> <#assign user_roles_before = user_roles_before + [role_name]/> </#list> <#list user_roles_remove as r> <#if (user_roles_before?seq_index_of(r) >= 0)> <#assign result = restadmin("/roles/name/" + r?url + "/users/remove?role.user=id/" + user_id)/> </#if> </#list> <#assign query_user_roles = restadmin("2.0","/search?q=" + "SELECT name FROM roles WHERE users.id = '${user_id}' LIMIT 500"?url)/> <#assign user_roles_after = []/> <#list query_user_roles.data.items as r> <#assign role_name = r.name/> <#assign user_roles_after = user_roles_after + [role_name]/> </#list> <user> <login>${user_login}</login> <id>${user_id}</id> <user_type>Moderator</user_type> <roles_removed> <#list user_roles_before as r> <#if (user_roles_after?seq_index_of(r) < 0) && user_roles_remove?seq_index_of(r) >= 0)> <#if (users_pm_ids?seq_index_of(user_id) < 0)> <#assign users_pm_ids = users_pm_ids + [user_id]/> </#if> <role_name>${r}</role_name> </#if> </#list> </roles_removed> <roles_not_removed> <#list roles_remove as r> <#if (user_roles_after?seq_index_of(r) >= 0)> <role_name>${r}</role_name> </#if> </#list> </roles_not_removed> </user> </#if> </#list> <#-- --> <#-- Staff --> <#assign staff_users = []/> <#assign query_staff = restadmin("2.0","/search?q=" + "SELECT id,login,last_visit_time FROM users WHERE roles.name IN('Staff','Administrator','LSI','Lithium') LIMIT ${user_limit}"?url)/> <#list query_staff.data.items?sort_by("last_visit_time") as u> <#assign lvd_long = fnLVD(u.last_visit_time)/> <#if (lvd_long < prev_long_mod)> <#assign user_id = u.id/> <#assign user_login = u.login/> <#assign user_exception = false/> <#list staff_exceptions as s> <#if s?number == user_id?number> <#assign user_exception = true/> <#break> </#if> </#list> <#if user_exception == false> <#assign query_user_roles = restadmin("2.0","/search?q=" + "SELECT name FROM roles WHERE users.id = '${user_id}' LIMIT 500"?url)/> <#assign user_roles_before = []/> <#list query_user_roles.data.items as r> <#assign role_name = r.name/> <#assign user_roles_before = user_roles_before + [role_name]/> </#list> <#if (user_roles_before?seq_index_of("Staff") >= 0)> <#assign staff_users = staff_users + [user_id]/> </#if> <#list user_roles_remove as r> <#if (user_roles_before?seq_index_of(r) >= 0)> <#assign result = restadmin("/roles/name/" + r?url + "/users/remove?role.user=id/" + user_id)/> </#if> </#list> <#assign query_user_roles = restadmin("2.0","/search?q=" + "SELECT name FROM roles WHERE users.id = '${user_id}' LIMIT 500"?url)/> <#assign user_roles_after = []/> <#list query_user_roles.data.items as r> <#assign role_name = r.name/> <#assign user_roles_after = user_roles_after + [role_name]/> </#list> <user> <login>${user_login}</login> <id>${user_id}</id> <user_type>Admin,Staff</user_type> <roles_removed> <#list user_roles_before as r> <#if (user_roles_after?seq_index_of(r) < 0) && (user_roles_remove?seq_index_of(r) >= 0)> <#if (users_pm_ids?seq_index_of(user_id) < 0)> <#assign users_pm_ids = users_pm_ids + [user_id]/> </#if> <role_name>${r}</role_name> </#if> </#list> </roles_removed> <roles_not_removed> <#list user_roles_remove as r> <#if (user_roles_after?seq_index_of(r) >= 0)> <role_name>${r}</role_name> </#if> </#list> </roles_not_removed> </user> </#if> </#if> </#list> </users> </xml> <#if send_pm == true> <#assign pm_subject = "Your access has been removed"?url/> <#assign pm_body = "<p>Hey! Due to inactivity we have removed some of the more sensitive access from your account.</p><p>If you feel this was in error, please contact the Community Team.</p><p style='margin:40px 0; color:#bbb;font-size:10px'>Please do not reply to this message</p>"?url/> <#list users_pm_ids as u> <#assign result_send = restadmin("/postoffice/notes/send?notes.recipient=/users/id/" + u + "¬es.subject=" + pm_subject + "¬es.note=test")/> </#list> </#if> </#if>596Views5likes0CommentsAvatar + Post Date to Blog Page Masonry
Hello! Is there a way to display articles author avatar and the post date at Blog Page using the masonry view? I can see there is a date for the most recent comment, but not for the original post. There is a thread comment about the same issue from 4 years ago, has there been any progress around this view?pepitaK5 years agoAdept511Views0likes2CommentsFinding Who 'Solved' A Post via API
Hi! I am looking at trying to find out the following. If I make a call to the below endpoint I see there is a 'solved' attribute that is true or false: https://developer.khoros.com/khoroscommunitydevdocs/reference/read-a-resource-in-a-collection In the example response it is set to 'false' so I can't see but if there is a solution for the answer, will this give me the information about the user, even just the user ID who solved the issue? Or even better, is there a webhook that triggers when a post is 'solved'? Thanks,sejago5 years agoGuide577Views0likes2CommentsTrying to use jQuery and liaAddScript to add anchor to TKB article
I'm trying to use the liaAddScript directive in a custom component and jQuery to add anchors to TKB articles that have specific CSS classes but it doesn't seem to want to work. This is what my custom component looks like: <#-- Add the anchor using jQuery --> <@liaAddScript> ; (function ($) { console.log('Adding anchor to article'); $('<a name="appliesTo"></a>').insertBefore("kbsync-applies-to"); })(LITHIUM.jQuery); </@liaAddScript> The custom component was added to the page's quilt but when loading an article I see violations in the JavaScript console as shown below. The anchor is also not added to the article. I thought I was using the correct syntax but is there something I'm missing or doing wrong?Solved2.1KViews0likes4CommentsAPI to Share Message ( TKB ) different nodes
Hi Team , I'm looking for REST API to post message to one board & shared across different board . or How to create message which is shared across different board ( or nodes ) . Can anyone please help . Thanks & Regards Sachin Patilpatils275 years agoGuide568Views1like6CommentsHow to pass ajax response to a macro?
Hello everyone, I want to get json file content from the other assets and pass it to a macro to be able to display things based on this json object how can this be achieved? PS. I tried this and I can see the json file content in the console however I am not able to pass it to a macro. <@liaAddScript> ;(function ($) { $.ajax({ url : '${asset.get('/html/assets/companyProducts.json')}', type: 'GET', success : function(data){ console.log(data); }, error : function(data){ } }); })(LITHIUM.jQuery); </@liaAddScript>646Views0likes1CommentFacing issue with image upload API
Hi , We are developing separate Android Mobile app for a Lithium community. Here we need to upload an image . There are two way you can upload an image but attachment and by inserting the photos . Here we need to insert the photos for which we are using following api, /restapi/vc/users/self/media/albums/default/public/images/upload?restapi.session_key=${the_key} but its giving the error "<error code="100"> <message> The file upload encountered a problem. </message>" For reference here is the code , just change the username and password on your respective stage instance. For this create a custom component and add that into custom page and try this. <form id="myForm" enctype="multipart/form-data"> image: <input name="image" id="my_image" type="file" value="browse"> </input> <input type="submit" value="Submit form" /> </form> <#assign the_key = rest("authentication/sessions/login?user.login={username}&user.password={password}").value /> <#assign your_endpoint_url = "/restapi/vc/users/self/media/albums/default/public/images/upload?restapi.session_key=${the_key}" /> <@liaAddScript> (function($) { $(document).ready(function(){ $("#myForm").submit(function(e){ var form_data = new FormData(this); console.log(form_data); console.log('get image by name'); console.log(form_data.get("image")); e.preventDefault(); // var datastring = $("#myForm").serialize(); //alert(datastring); var file = $('#my_image')[0].files[0]; if (file){ console.log(file); } $.ajax( { url: "${your_endpoint_url}", type : "POST", contentType: false, //data: form_data.get("image"), data: {"image.content":form_data.get("image")}, cache: false, // To unable request pages to be cached processData:false, // To send DOMDocument or non processed data file it is set to false dataType: "json", success: function(result){ alert('success..see response in console log'); console.log('success>>>'); console.log(result); }, error: function(error){ alert('error..see response in console log'); console.log('error>>>'); console.log(error); }, }); }); });})(LITHIUM.jQuery); </@liaAddScript> Kindly have a look and suggest any feasible way where we can upload the image with the above api. Regards Irfanirfansayyed1015 years agoContributor409Views0likes7Commentshow to make implement endpoint with ajax?
Hello everyone, My question is how can I implement endpoint to achieve this? specifically I want to make endpoint that 1. take as a parameter file name 2. get the file from the assets by name 3. parse it and return the file content I want to call this end point from custom component. here is what I tried it however I don't know how should I return the data on success to the component? <@liaAddScript> ;(function ($) { $.ajax({ url : '${asset.get('/html/assets/filename')}', type: 'GET', success : function(data){ console.log(data); }, error : function(data){ } }); })(LITHIUM.jQuery); </@liaAddScript> Excuse me, if the question sound intuitive, I am a bit new to Khoros. Thanks in advance, SherySolved1.9KViews0likes3CommentsRestricting Custom Component Only on User Profile Page.
Hi, So far I have added a custom component in view profile page and able to viewit. But I want to restrict the content onlywhen the user views his profile and not on others user profile. Please let me know how can I implement this condition. ThanksSolved195Views0likes4CommentsHow to add multiple tags to a message
curl --location --request PUT '.../api/2.0/messages/882?restapi.session_key=...' \ --header 'Content-Type: application/json' \ --data-raw '{ "data":{ "type":"message", "tags": [ { "type": "tag", "text": "tag3" }, { "type": "tag", "text": "tag4" } ] } }'patils275 years agoGuide652Views0likes2CommentsHow To Get OAuth 2.0 Access Token & Refresh Token
Hi All , below are steps to getOAuth 2.0 Access Token & Refresh Token To Get OAuth 2.0 Access , first step is to get access code How to get access code , 1) Get Redirect URL http://xxxx/getAccessToken . (It can be whatever you want, as long as you reference it in the API call.) 2) URL-encode the Client ID and the State to properly format any special characters. 3) Enter URL encoded values in below URL: https://xxxx/auth/oauth2/authorize?client_id=xxxx&response_type=code&redirect_uri=http://xxxx/getAccessToken&state=xxxx 4) I will then get routed back to my redirect URL with the authorization code shown in the code argument of the query string, as shown below. (I get a “site can’t be reached” message but that’s to be expected since the Redirect URL is just something I made up since it doesn’t need to actually work for my purposes, since it’s just used for authentication. The Redirect URL would only matter if I were actually developing a web app for end-users.) How to get Access Token POST /auth/accessToken request curl -X POST \ https://[COMMUNITY DOMAIN]/api/2.0/auth/accessToken \ -H "Content-Type: application/json" \ -H "client-id: [CLIENT ID]" \ -d '{ "client_id":"[CLIENT ID]", "client_secret":"[CLIENT SECRET]", "grant_type":"authorization_code", "redirect_uri":"[REDIRECT URI]", "code":"[AUTHORIZATION CODE]" }' POST /auth/accessToken response { "response": { "status": "success", "message": "OK", "http_code": 200, "data": { "access_token": "o5IV0yIiNDj/5lNJ6doJh08LX6SsDwtkDXDVmhGvRtI=", "expires_in": 86400, "lithium_user_id": "2d8c95ed-21dc-4ba6-ab9f-d3eff9c928ce", "refresh_token": "XAAWIWKr38W33SlqYooR9OEJW0um9DoyB/o843rdIxk=", "token_type": "bearer" } } } Refresh the access token An access token is valid for 24 hours before it expires. Refresh the token within that time period with a POST call to /auth/refreshToken and passing the refresh_token received in the response from POST /auth/accessToken. Otherwise, the user will go through the authentication flow again. When you pass the refresh_token, the Authorization Service issues a new access token and (optionally) a new refresh token. Store the new refresh token in case you need it for subsequent refreshes. The refresh token does not expire. Community Link:https://xxxx/api/2.0/auth/refreshToken { "client_id":"xxxx", "client_secret":"xxxxx", "grant_type":"refresh_token", "refresh_token":"xxxxx" } Hope this helps ..... Please refer below link for details: https://developer.khoros.com/khoroscommunitydevdocs/docs/oauth- authorization-grant Thanks & Regards Sachin Patilpatils275 years agoGuide709Views1like0CommentsLithium SDK CI demo (lithiumtech/linc-sdk-demo) not found in GitHub
The Continuous Integration section of theSDK development workflow page in the developer documentation references the GitHub demo projecthttps://github.com/lithiumtech/linc-sdk-demo, which I'm very interested in exploring. However, the repository is not found and displays a 404 page. Can someone at Khoros please investigate or does someone have a fork of it that can share a URL? Thanks!Solved2KViews0likes9CommentsUser messages feed: set default view?
When viewing any user's page (ViewProfilePage), the User Messages Feed component will always default to show "Latest contributions". When viewing your own user page,the User Messages Feedwill default to show the "Topics I've participated in". I know can create a redirect using JavaScript but this isn't ideal as the page would 'load' and then 'reload'. I know that the Page Initialization script can be used for URL redirects which would prevent the load/reload from occurring and this would provide a much better user experience. --- These are two possible approaches / solutions that I'm leaning towards: Solution 1: Redirect links from: community.com/c/user/viewprofilepage/user-id/13 To: community.com/c/user/viewprofilepage/user-id/13/user-messages-feed/participations Question 1: does anyone have any insight on how to create a URL Redirect when the window.location.pathname ends with the users' id? ${user.id} --- Solution 2: Set the default dropdown option to "Topics [user] has participated in" Question 2: Anyone how to set the dropdown option default so that when you first view a users' profile page, it is automatically set to"Topics [user] has participated in"? --- --- Thanks in advance!Inactive User5 years ago331Views1like0CommentsProcess to download BULK API file with Informatica ETL/Linux box
Hi Community folks, We have a requirement that we need to connect BULK API from Informatica ETL tool to load data into our Vertica Database. We got all the information on community forum(like Client id,community id,access key etc...) Since we are new to this Khoros process, we are not sure how will we connect to this Bulk API and download the csv/Json file. we tried to connect with GET and curl command but ended up with some errors. Can anyone please help us to provide any URL(other than BULK API documentation) which can help us to start with the process of downloading this file with Informatica ETL tool or at least from any of our Linux/Unix box. Thanks in advance Regards, msmsmsmamsmsmsma5 years agoContributor58Views0likes2Comments