Any cons of NOT using LITHIUM.jQuery when calling an endpoint from a component?
Hi folks, I was wondering if using LITHIUM.jQuery when calling endpoints is the only preferred way of doing it: <@liaAddScript> ;(function ($) { $(document).ready(function () { function callLithiumEndpoint() { $.ajax({ url: '${endpointUrl}', }) } callLithiumEndpoint(); }); })(LITHIUM.jQuery); </@liaAddScript> Can it be done with vanilla JavaScript inside a <script> tag as well, for example using fetch? I noticed that endpoints can be triggered from a browser or a postman via their path https://<community-name>/pjakv59666/plugins/custom/<some-path-to-endpoint>/<component-name> Can it be treated as a simple url, passing there parameters and parsing it?Solved1.7KViews1like2CommentsAPI v2 Search doesn't work
Reading this page, I quote: "In v2, perform a one-or-more term search with a comma-separated list of terms wrapped in parentheses. Use this when you want to return messages that have at least one of these terms in the defined fields. WHERE subject MATCHES ('apples', 'bananas', 'cherries')" This query returns 2 results: select subject,body from messages where subject matches 'attachment' This query returns 0 results. select subject,body from messages where subject matches ('attachment','android') According to the documentation I should be getting results. Fair to say that it's not WAI?1.1KViews0likes9CommentsAPI call to post message has blank response
Hi folks. Been using this in an endpoint for many years, but now it returns a blank response, so I can't read if it was successful. <#assign result_post = restadmin("/boards/id/${board_id}/messages/post?message.subject=${msg_subject?url}&message.body=${msg_body?url}")/> If, however, I do a simple $.post('/restapi/vc/boards/id/${board_id}/messages/post?message.subject=subject&message.body=body') then I get a perfectly normal response. Did something change with the v1 API?797Views0likes6CommentsWhere do I store a large amount of data, for reference?
Hi folks, planning a custom component which will basically check the user's id against a pre-existing list. I imagine this list could grow into the thousands. What are my options for storing this data/list? One option I use for smaller datasets is a hidden post and simply store it as a comma separated string. Another option might be to store a string in a custom metadata field, I guess? Any ideas how large that could be? (I don't have access to a separate server.)749Views2likes5CommentsUnable to change SSO ID of user with the API
Hey all, We need to update the SSO ID of our users systematically and I am writing a Python script to do so. However, when attempting to do so in the API v1 using a POST call to the /users/id/{id}/sso_id/set endpoint, I am getting the following response. { "response": { "status": "error", "error": { "code": 303, "message": "Permission Denied" } } } I am authenticated as a user with full admin privileges so I'm not sure why I would be getting the Permission Denied message, especially since my user can change SSO IDs via Community Admin just fine. The payload (value=) is also a simple numeric string so it shouldn't be due to invalid. characters or anything. Anyone ever experienced this and know how I can get around it? Thanks in advance!Solved648Views0likes10CommentsLogging a user out not working
Hello, I'm currently developing a solution to log out a user from the community sessions automatically. I followed the API Reference here: https://developer.khoros.com/khoroscommunitydevdocs/reference/authsignout I am currently getting the correct response of the user being signed out of all sessions but when I go to the community forums with my test user I can still see the user logged in. This is the json response that I am receiving: { "status":"success", "message":"", "data": { "signed_off_all_sessions":true, "id":"#######" } } Context: we do use a cookie for our users to log into the community site if they are logged into our site. But I have made sure to just be logged into the community site without said cookie when trying this call out. Any help would be welcomed.647Views0likes12CommentsCommunity 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.620Views1like0CommentsHow to create API accessible user account with Community
I am new to Khoros platform and want to crawl data from community. For that I did signup process with one lithium community and got my username and password. I am trying to authenticate myself with via retrieve-the-session-key but api response says curl --location --request \ POST 'https://community.alteryx.com/restapi/vc/authentication/sessions/login' \ --form 'user.login=dshrm' \ --form 'user.password=****' <response status="error"> <error code="302"> <message> User authentication failed. </message> </error> </response> I am trying to get user details via LiQl basic query `select * from users limit 1` What exactly process do I need to follow to authenticate myself ?561Views0likes11CommentsAs far as anyone knows is there a way to transfer posts, etc., from PROD to STAGE
Has anyone come up with a script to do this? Querying Production and Posting to stage with either curl or the API? It would just be nice to be able to populate more and more realistic content on the Stage instance. Or even just to post articles programmatically? There's the REST API https://developer.khoros.com/khoroscommunitydevdocs/reference/rest But I don't see where the body of the messagePostBody goes. Example: POST (Create): <#assign subject = http.request.parameters.name.get("subject", "") /> <#if subject?length gt 0> <#-- Build the requestBody parameter and assign it to a variable--> <#assign messagePostBody = { "type": "message", "subject": subject, "board": { "type": "board", "id": "Otis" } } /> <#-- Make your REST call --> <#assign resp = rest("2.0", "/messages", "POST", messagePostBody) /> ${apiv2.toJson(resp)} <#else> { "status": "error", "message": "no subject parameter passed." } </#if> Do I just add a "body" member property to that messagePostBody with whatever the body of the message is? Or is there some esoteric way of doing it? For the example given, PUT: <#assign messagePostBody = { "type": "message", "id": "34", "subject": "How do I post a REST API message?" } /> There's a subject, a type, an id, but no body. How do I add body content? Or do I have to use cURL as noted here in "recipes"? Does one need to authenticate using cURL? Can it be done within components? A lot of this seems vague. There's not a lot of context I can find. Most recipes have instructions for what to do with the ingredients ... https://developer.khoros.com/khoroscommunitydevdocs/recipes/create-a-new-message-with-products Do we run this in Freemarker? How? Do we create a component? Do we use authentication? How? In a terminal? With a fox? In a box? With green eggs and ham? 😉 This would be very helpful information. These "recipes" assume a lot of knowledge about how to use cURL within the Khoros Community that isn't provided. I would love to run this in a component. But there's no information nearby that explains that. Please clarify? A lot? Complete examples in the context of the Community product would make all the difference. curl --request POST \ --url https://community-domain/api/2.0/messages \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' { "data": { "type": "message", "board": { "id": "runningShoes" }, "subject": "Alternative to Nike Revolution Running Shoes", "body": "I have the Nike Revolution Shoes and got the Reebok Protonium shoes, but it feels very stiff while running - not much comfort/cushion while running and uncomfortable. I originally switched to Saucony because it was very comfortable and lightweight. suggestions for Saucony running shoes for women? I run only about 10mi/wk. <li-image id=\"336i254DB2339\"/>", "tags": { "items": [ { "text": "trail running" }, { "text": "running shoes" } ] }, "labels": { "items": [ { "id": "RunningShoes", "text": "Running Shoes" }, { "id": "Suggestions", "text": "Suggestions" } ] }, "products": { "items": [ { "id": "54" }, { "id": "56" } ], "list_item_type": "product" } } } Thanks, just rather unclear on the documentation around this.Solved559Views0likes13Comments