ContributionsMost RecentMost LikesSolutionsRe: API extract messages after a specific time Here is the documentation for that constraint: https://developer.khoros.com/khoroscommunitydevdocs/docs/messages#conversationlast_posting_activity_time As it says, it: Filters messages by the larger of these two date fields: the last post time (equivalent to the conversation.last_post_time constraint ) the last time the topic message was published (the last time a non-draft edit was made) The "last post time" it refers to (what the conversation.last_post_time constraint is for) means the last time a reply to the conversation was posted. -Doug Re: retrieve number of kudos given by every user in one rest API call This would probably be a good case to use an Endpoint -- see the following article for more information: https://developer.khoros.com/khoroscommunitydevdocs/docs/condensing-api-requests-with-endpoints -Doug Re: Label ID change? It does not affect your ability to change an existing label. However, when you change an existing label it will change the id of that label wherever it is returned by the API. So if you did a LiQL query like this: SELECT id, href, text FROM labels WHERE messages.id = '5475' And that returned this: { "status": "success", "message": "", "http_code": 200, "data": { "type": "labels", "list_item_type": "label", "size": 7, "items": [ { "type": "label", "id": "Utility Network", "href": "/labels/Utility Network", "text": "Utility Network" } ] } } Then you changed the text of the "Utility Network" label to "Legacy Utility Network" and ran the same LiQL query again, you would get a different id for the label: { "status": "success", "message": "", "http_code": 200, "data": { "type": "labels", "list_item_type": "label", "size": 7, "items": [ { "type": "label", "id": "Legacy Utility Network", "href": "/labels/Legacy Utility Network", "text": "Legacy Utility Network" } ] } } I believe we are evaluating changing the id slightly so it's normalized and url-encoded, so we might see an upcoming change where the id becomes "utility%20network" (or "legacy%20utility%20network" if the label gets changed to that). Re: Logging a user out not working Himarvide This seems like a bug with the signoff logic that runs when you make the call (it also seems like a bug that it doesn't sign off web sessions when you use OAuth). Would you mind opening a support case for this? That will get a bug opened in our system which we can track and get resolved for you. Please reference this thread in the case when you open one. Thanks, -Doug Re: Logging a user out not working Himarvide I seem to have missed this thread when I was mentioned before. Apologies for that. Are you using OAuth 2.0 (passingAuthorization and client-id headers) or a REST V1 Session Key (passingli-api-session-key header or restapi.session_key parameter) to authenticate to the API when you make the signout call? Also, are you making the signout call as the same user you are signing out, or a different user? It looks like if you authenticate via OAuth 2.0 it signs off your OAuth user (revokes your access token), but doesn't sign you out of any web sessions you have going. -Doug Re: Search on the API using "first name" Histevendany, It is not currently possible to find users by first name using REST V2. You could use the REST V1 user search endpoint and tell it to only search the name_first field: [yourcommunithostbaseurl]/restapi/vc/search/users?q=joe&advanced=true&f=name_first&search_page_size=48&restapi.response_format=json -Doug Re: Unable to publish message on behalf of another user Hijeffshurtliff, Let me reply to your last 2 questions: Is there a way to force the directives above to select one session key over another, or is there perhaps a different directive/method to leverage instead to publish the post within the endpoint? There is no way (to my knowledge) to pass a different session key from your freemarker template and have that override the session id of the currently authenticated user. We do allow you to pass either the Li-Api-Session-Key header or the restapi.session_key parameter to your endpoint call and it will use that session key to authenticate the user. Is there maybe a different way that the author can be specified by the Community APIs when creating a new message? For example, if I pass"author": {"type": "user", "id": "12345"} in the payload when creating the message will that specify the author or will it be ignored? If the user you are authenticated as has the "Switch User" permission, then you can pass the "author": { "type": "user", "id": "12345" } and it should set the user for the id you've passed as message author (assuming that id maps to a valid user) instead of using the currently authenticated user as the author. I hope that helps. -Doug Re: Unable to publish message on behalf of another user Hi jeffshurtliff, For security reasons, I would advise against trying to take the username and password as part of this endpoint. Any endpoint can be passed a REST V1 Session key (just add a request parameter named restapi.session_key=<thesessionkey>), so it's ideal to have the caller call /authentication/sessions/login endpoint and then pass the REST V1 Session key that gets returned with any endpoint that needs authentication. So you'd first want to make a call like the following to the /authentication/sessions/login endpoint to get a REST V1 Session Key: curl --location --request POST 'https://community.some.com/restapi/vc/authentication/sessions/login?restapi.response_format=json' \ --form 'user.login="yourlogin"' \ --form 'user.password="yourpassword"' That should return a response like this: { "response": { "status": "success", "value": { "type": "string", "$": "XYSopedCuqLQT179LjNxyFgTSne5vdLUb1MMgxmcSGQ." } } } Then you would call your endpoint, passing the session key returned from the /authentication/sessions/login call to the endpoint: curl --location --request POST 'https://community.some.com/plugins/custom/yourcustomername/yourcommuntiyname/messagepostingendpoint' \ --header 'Content-Type: application/json' \ --header 'Li-Api-Session-Key: XYSopedCuqLQT179LjNxyFgTSne5vdLUb1MMgxmcSGQ.' Also, I would advise against adding the .admin(true) option at all, as this could give an attacker a way to flood your community with message posts. I think you also have some spaces in between your builder method calls that might be causing an issue as well. I would recommend using a function like this to do the message posts: <#-------------------- Function: publishNewMessage --------------------> <#-- This function publishes a new message and returns the API response --> <#function publishNewMessage payload> <#if user.anonymous> <#return { "status" : "error", "message" : "You are not authorized to make this request", "data": { "type": "error_data", "code": 224, "developer_message": "", "more_info": "" } } /> <#else> <#local messagePostCall = restBuilder() .method("POST") .path("/messages") .body(payload) .admin(false) /> <#local response = messagePostCall.call() /> <#return response /> </#if> </#function> Here is a usage example, which includes a macro for rendering out an error response (assuming your endpoint is using application/json for its content type): <#-------------------- Macro: errorResponse --------------------> <#-- This macro returns a REST V2 style JSON response for errors --> <#macro errorResponse error> { "status": "error", "message": "${error.message}", "data": { "type": "error_data", "code": ${error.data.code}, "developer_message": "${error.data.developer_message}", "more_info": "${error.data.more_info}" } } </#macro> <#assign payload = { "data": { "type": "message", "board": { "id": "Otis" }, "subject": "This is a product advisory", "body": "This is the body of the message" } } /> <#assign response = publishNewMessage(payload) /> <#if response.status == "error"> <@errorResponse error=response /> <#else> ${apiv2.toJson(response)} </#if> I hope that helps! -Doug Re: Facing issues Downloading a file with third party API Unfortunately http.client only supports JSON and plaintext responses and does not support streaming out file responses. It also does not support uploading files to remote endpoints. Re: Edit Post Page HIjeffshurtliff, Unfortunately we still do not allow you to edit individual fields of a form using Studio. You could use Javascript to do it, or if you don't need the message to be next to a field, you could places a component in the page quilt for theCrmSupportCaseEditPage to add a custom component above the form for displaying your own form-level custom error messages. -Doug