Recent Content
Cannot successfully archive message via API v2
Has anyone been able to successfully archive a message using the Community API v2 POST call documented in the Developer Docs? I've tried several ways and can't seem to get it to work. For example: Using the restadmin directive <#assign response = restadmin("2.0", "/archives/archive", "POST", {"messageId": "32815"}) /> Status: ${response.status}<br /> Message: ${response.message}<br /> Data Keys:<br /> <#list response.data?keys as dataKey> - ${dataKey}<br /> </#list> Using the restBuilder directive <#assign archivePostCall = restBuilder() .method("POST") .path("/archives/archive") .body({"messageId": "32815"}) .admin(true) /> <#assign response = archivePostCall.call() /> Status: ${response.status}<br /> Message: ${response.message}<br /> Data Keys:<br /> <#list response.data?keys as dataKey> - ${dataKey}<br /> </#list> Both attempts above returned the following response: Status: error Message: Error generating JSON response. Data Keys: - getClass - validTemplateModelObject - toSerializedString - isValidTemplateModelObject - hashCode - equals - get - toString - class I tried performing the same operation via Python (as shown below) but the response is either a 400 or 500 error depending on whether or not I explicitly define the "content-type" header as "application/json" in my request. Attempt #1: Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] on win32 >>> from khoros import Khoros >>> khoros = Khoros() >>> response = khoros.post('/api/2.0/archives/archive', {'messageId': '32815'}, return_json=False) >>> response <Response [400]> >>> response.text '{"status":"error","message":"A possible invalid request has been made. Make sure you are following the API spec and have used the correct URL, are included all required parameters and if a request payload is required you have included one.","data":{"type":"error_data","code":309,"developer_message":"","more_info":""},"metadata":{}}' >>> response.request.url 'https://REDACTED.com/api/2.0/archives/archive' >>> response.request.body '{"messageId": "32815"}' >>> response.request.headers {'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'li-api-session-key': 'REDACTED', 'Content-Length': '22'} Attempt #2: >>> response = khoros.post('/api/2.0/archives/archive', {'messageId': '32815'}, headers={'content-type': 'application/json'}, return_json=False) >>> response <Response [500]> >>> response.text '{"status":"error","message":"An unexpected error occurred.","data":{"type":"error_data","code":301,"developer_message":"Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\\n at [Source: org.apache.catalina.connector.CoyoteInputStream@34f637da; line: 1, column: 1]","more_info":""},"metadata":{}}' >>> response.request.headers {'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'li-api-session-key': 'REDACTED', 'content-type': 'application/json', 'Content-Length': '22'} I was hoping I could do a network trace of the archival process in the web UI to see what the syntax should be, but it looks like a different UI-specific endpoint and form is used to perform the operation so I couldn't learn anything from it. Any help with this would be greatly appreciated. Thanks!787Views0likes9CommentsFeaturing a topic in Khoros Classic
Hi all, I'm looking for a way to be able to feature a give topic via the REST API v2. I tried doing this in a test endpoint, <#assign feature_call = restBuilder() .method("PUT") .path("/messages/11577") .body({ "data": { "type": "message", "conversation": { "featured": true } } }) .admin(true) /> but it fails with the following error: { "status":"error", "message":"The following parameters, or the value passed in for them, are not valid: [featured].", "data":{ "type":"error_data", "code":404, "developer_message":"The parameter featured is not allowed in an 'update' call.", "more_info":"" }, "metadata":{} } I couldn't find anything in the REST API v1 either. Is there no way to actually feature a message via the API?Getting a 414 error code when updating messages via API
We have a third party tool where we can update messages in TKBs. I'm using the session key for authentication using a non-SSO user with their username and password to get and refresh the session key. The user has Admin permissions across the entire community (for testing this), their email is verified, I've checked to make sure their account is correctly set up and working and that their permissions are correct. However, when I run the call for certain TKBs, I get this error: {"status":"error","message":"Permission Denied","data":{"type":"error_data","code":414,"developer_message":"","more_info":""},"metadata":{}} But when I run it for other TKBs, I don't get the error. I've looked at both TKBs and I'm scratching my head. Permissions are the same, settings are the same, essentially everything is the same besides which category they're in, but I've checked permissions in all categories/sub-categories and there are no differences. Any idea why this would happen or why I'm getting Permission Denied for a user with Admin permissions in some TKBs but not others?24Views0likes1CommentFreezing Kudos on a Topic on Classic
Hi all, Is there a way via either rest v1 or v2 (preferably the latter) to freeze the kudos for a given topic? I see that I can make a topic read only, but don't seen an obvious way to disable kudoing. Not sure if this is possible, but given gaps in the docs, I'm hoping that it's doable but that the field to update is not available with a select * query in the API browser. Thanks!Session Key auth 302 Failure
Hello! Apologies in advance if this has been asked, I am very new to the library. I am unfortunately stuck on logging in to acquire a session token (following Session Key authentication) for a while now. I have an account which is given API access by the company, but when trying to login with the session API key, I get 302 user authentication failed. I am confident that my username/password combination is correct, and that this is not an issue with escaping (also wrote a Python client to verify, got the same results): user@HOSTNAME:~$ curl --location --request \ > POST 'https://[community]/restapi/vc/authentication/sessions/login' \ > --form 'user.login=[username]' \ > --form 'user.password=[password]' <response status="error"> <error code="302"> <message> User authentication failed. </message> </error> </response> Of note perhaps, is that when I login to my community I am redirected to the company SSO; the domain itself does not provide login portals; perhaps this is a clue? I'm not sure if this circumstance allows for session authentication. It's confusing me because coworkers have reported being able to execute the curl command and login. I also tested with an admin-provisioned API-key user account, with the same results. What are the circumstances under which 302 authentication failure is triggered, assuming username/password and API permissions are supposedly granted? I've scanned the community for related posts, but the status code for authentication issues is not often 302. Is this an IP whitelisting issue, or do I need extra headers, or am I just not allowed to make session auths? Would appreciate any help on resolving this issue.91Views0likes3CommentsQraphQL Missing constraint on the messages collection
Hi all, I am trying to create a system to pull all messages from a board posted in the last hour, can someone tell me what I am missing here.. There is no constraint for postTime.. I only want the new posts (depth 0) but that makes both of the other constrains useless as the feed would be polluted with messages surfaced because someone has commented on the original post...35Views0likes4Comments
Featured Places
Release Notes & Updates
Review release notes and updates for all of our products! Select a tag to browse by product or resource type.Help & Support
Find solutions and support for Khoros productsSupport Information
Review general information about Khoros Support
Events & Webinars
Learn more about your Khoros solution with helpful webinars and special events
Events
No events to show