Error with Oauth 2.0 Client Credentials workflow
I'm trying to authenticate an api call in a typescript app using the oauth 2.0 client credentials workflow and I'm running into issues, I believe, with generating the CC Hash for this. This is for Community Classic. I have verified that I have the correct client id, client secret and shared secret key and that they're being pulled in correctly in my code. Not sure what I'm missing, but this is the error I see when I try to authenticate: {"error":"Authorization or API call failed","details":"Failed to obtain access token. Status: 403. Response: {\"status\":\"error\",\"message\":\"cc_hash is invalid.\",\"data\":{\"type\":\"error_data\",\"code\":214,\"developer_message\":\"The decryption failed. ccHash is Invalid\",\"more_info\":\"\"},\"metadata\":{}}"} Here's the relevant part of my Typescript code that's generating the CC Hash. Not sure if something is formatted incorrectly or what's not being generated correctly or causing it to return an invalid cc hash function generateCCHash(clientId: string, clientSecret: string, sharedSecretKey: string): string { try { const epochTimeMinute = getEpochTimeMinute(); const nonce = generateNonce(); const strToHash = `${clientId}:${clientSecret}:${nonce}:${epochTimeMinute}`; console.log("String to hash:", strToHash); const hash = crypto.createHash('sha512'); hash.update(strToHash, 'utf8'); hash.update(sharedSecretKey, 'utf8'); const hashResult = hash.digest('hex'); console.log("Generated hash (cc_hash):", hashResult); return hashResult; } catch (error) { console.error("Error generating CC-Hash:", error); throw error; } }30Views0likes2CommentsUnable to retrieve users using v2 API
Unable to retrieve users from /api/2.0/search?q=SELECT * FROM users endpoint though it's returning 200 response. What could be the reason? Here is the response: { "status": "success", "message": "", "http_code": 200, "data": { "type": "users", "list_item_type": "user", "size": 0, "items": [] }, "metadata": {} }59Views0likes0CommentsDelete a bookmark subscription
Hi, I'm working on a customisation within one of our TKBs where we want to make bookmark functionality more visible. I'm creating a button to bookmark and another to remove the bookmark. My bookmark button is working as intended, but I'm having difficulty removing/deleting the bookmark. $("#remove-bookmark").on( "click", function() { $.ajax({ type: "DELETE", url: "/api/2.0/users/${userID}/badges/${bookmarkID}", contentType: "application/json", dataType: "json", }).done(function(jqXHR, textStatus) { console.log('Success' + textStatus) }).fail(function(jqXHR, textStatus) { console.log('Fail: ' + textStatus); }); }); I'm using the URL /api/2.0/users/user-id/badges/subscription-id based on documentation. Am I right in substituting user-id and subscription-id for the respective values? In my specific test case, the URL being called is /api/2.0/users/67/badges/3829. Here's the server response: { "status": "error", "message": "An unexpected error occurred.", "data": { "type": "error_data", "code": 301, "developer_message": "", "more_info": "" }, "metadata": {} } Any help appreciated.44Views0likes1CommentNot able to access V1 API's form reference index.
Not able to access V1 API's form reference index. https://developer.khoros.com/khoroscommunitydevdocs/reference/community-api-1-object-index https://devdocportal.khoros.com/t5/Community-API-v1-Reference/bd-p/restv1docs?section=commv1&branch=Album31Views1like0CommentsAPI v1 docs gone since Atlas migration to Aurora
Link for API v1 documentation used to point at this Classic instance at devdocportal.khoros.com (which I think used to be pointing at the same Classic instance that community.khoros.com ran on): https://devdocportal.khoros.com/t5/Community-API-v1-Reference/bd-p/restv1docs?section=commv1&page=apiv1home Since the Aurora migration of Atlas two weeks ago accessing this URL just returns a "Cannot find community" generic error. When can we expect this v1 doc to be back? It's currently becoming a major blocker for a bunch of development initiatives I'm involved in.61Views1like3CommentsCan someone walk me through authenticating and using Postman with Aurora?
I'm a bit of a newbie when it comes to GraphQL and Postman and I'm struggling to work through the dev docs when it comes to authenticating and setting up the basics in Postman for testing in API calls in Aurora. We're looking ahead to migration and want to start getting familiar with basic API calls. Has anyone successfully got Postman and Aurora working? Is anyone willing to walk me through the bare minimum basics of getting this set up to authenticate into our Aurora instance and run a basic GraphQL call? I'm finding the dev docs pretty lacking currently so I'm turning to the expertise of the developer community here hoping someone has already figured this out. Or, if Khoros is reading this, can we have another Developer Webinar where we can walk through this? Or is this something you can offer through training or update the docs with more details? We've reached out to our CSM to see if we can get some 1:1 training but so far it doesn't look like that's an option right now.Solved124Views0likes4CommentsOnline User Count is Completely Wrong
I'm trying to get an accurate count of online users and it's quite obvious the count is completely wrong just by looking at the results I'm encountering on my staging environment. The LIQL query used is fairly simple: SELECT count(*) FROM users WHERE online_status='online' Given the number of people who access our staging server, I would expect the result of this to be a low single digit number. Instead, I got a result of over 30 users. So I dug into the API results: SELECT login,last_visit_time FROM users WHERE online_status='online' The results list users with last visit times from 2020 and 2021 as well as users from earlier in 2022 that I know for a fact aren't online. How is Khoros defining an "online user" here? Is the behavior I'm seeing a bug or expected behavior?574Views2likes9CommentsPossible? Display 30-day FRT on a Board Component?
Our Board Oversight teams would like a component on their boards that displays the First Response Time (FRT) average over the past 30 days. While I realize I can grab this in Community Analytics, and I also am comfortable around the API... I'm a bit of a newbie when it comes to grabbing time-constrained data via the API Here's the board component with the line in question: <#if userHasApplicableRole> <#assign frt = [30_DAY_BOARD_FRT_AVG] /> <#-- this --> <div class="dc-boardwidget-FRT" title="FRT 30-day average"> <i class="fa-regular fa-reply-clock"></i> <span>${frt}</span> </div> </#if> Is this possible with the API? wkd-oliver212Views0likes3Comments