Lithosphere The Lithium Community

%3CLINGO-SUB%20id%3D%22lingo-sub-484833%22%20slang%3D%22en-US%22%3ELiQL%20Post%20Count%2C%20Kudo%20count%2C%20an%20solution%20count%20for%20users%20in%20one%20week.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-484833%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20some%20trouble%20figuring%20out%20the%20best%20way%20to%20get%20an%20automated%20report%20from%20Lithium.%20I%20only%20need%20a%20few%20stats%2C%20and%20I%20have%20gotten%20the%20post%20count%20with%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%22%3CA%20href%3D%22https%3A%2F%2Fapi.lithium.com%2Fcommunity%2F2.0%2F******%2Fsearch%3Fq%3DSELECT%2Bcount%2528*%2529%2BFROM%2Bmessages%2BWHERE%2Bauthor.id%2B%253D%2B%2527'%26quot%3B%24userID%26quot%3B'%2527%2BAND%2Bpost_time%2B%253E%2B'%26quot%3B%24lastSunday%26quot%3B'%26amp%3Bapi.pretty_print%3Dtrue%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fapi.lithium.com%2Fcommunity%2F2.0%2F******%2Fsearch%3Fq%3DSELECT%2Bcount%2528*%2529%2BFROM%2Bmessages%2BWHERE%2Bauthor.id%2B%253D%2B%2527'%22%24userID%22'%2527%2BAND%2Bpost_time%2B%253E%2B'%22%24lastSunday%22'%26amp%3Bapi.pretty_print%3Dtrue%3C%2FA%3E'%20%7C%20jq%20-r%20'.data.count%22%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20I%20can%20not%20figure%20out%20how%20to%20get%20the%20kudos%20or%20the%20solutions%20by%20time%20period.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-484956%22%20slang%3D%22en-US%22%3ERe%3A%20LiQL%20Post%20Count%2C%20Kudo%20count%2C%20an%20solution%20count%20for%20users%20in%20one%20week.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-484956%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F74298%22%20target%3D%22_blank%22%3E%40ntmcgee%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EUsing%20V1%3A%3C%2FP%3E%3CP%3EBelow%20API%20will%20return%20you%20kudos%20count%20for%20the%20last%20week.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%2Frestapi%2Fvc%2Fusers%2Fid%2F4%2Fmetrics%2Fname%2Fnet_kudos_weight_received%3Fdate_start%3D2018-07-01%26amp%3Bdate_end%3D2018-07-07%3C%2FPRE%3E%3CP%3EBelow%20API%20will%20return%20you%20Total%20Posts%20Count%20for%20the%20last%20week%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%2Frestapi%2Fvc%2Fusers%2Fid%2F4%2Fmetrics%2Fname%2Foverall_posts%3Fdate_start%3D2018-07-01%26amp%3Bdate_end%3D2018-07-07%3C%2FPRE%3E%3CP%3E%26nbsp%3BBelow%20API%20will%20return%20you%20Total%20Accepted%20solution%20Count%20for%20the%20last%20week%20of%20user%3A%3C%2FP%3E%3CPRE%3E%2Frestapi%2Fvc%2Fusers%2Fid%2F4%2Fmetrics%2Fname%2Fnet_accepted_solutions%3Fdate_start%3D2018-07-01%26amp%3Bdate_end%3D2018-07-07%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E---%3C%2FP%3E%3CP%3EYou%20can%20get%20Overall%20Post%20count%2C%20Kudos%20count%20and%20Solution%20count%20of%20the%20user%20using%20below%20LiQL%20API%20V2%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3ESELECT%20messages.count(*)%2C%20kudos_received.sum(weight)%2C%20solutions_authored.count(*)%20FROM%20users%20WHERE%20id%20%3D%20'4'%3C%2FPRE%3E%3CP%3EUsing%20this%20API%20will%20return%20response%20for%20one%20user%20for%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20486px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F145704iA4482B98E63D54B0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20srcset%3D%22%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F145704iA4482B98E63D54B0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%201.0x%22%20alt%3D%22user_activity.PNG%22%20title%3D%22user_activity.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-484924%22%20slang%3D%22en-US%22%3ERe%3A%20LiQL%20Post%20Count%2C%20Kudo%20count%2C%20an%20solution%20count%20for%20users%20in%20one%20week.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-484924%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20the%20reply!%20But%20I%20actually%20need%20to%20keep%20track%20of%20things%20per%20user.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20keep%20track%20of%20employee%20activity%20on%20our%20community.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20have%20any%20idea%20how%20I%20could%20pull%20this%20off%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-484900%22%20slang%3D%22en-US%22%3ERe%3A%20LiQL%20Post%20Count%2C%20Kudo%20count%2C%20an%20solution%20count%20for%20users%20in%20one%20week.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-484900%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F74298%22%20target%3D%22_blank%22%3E%40ntmcgee%3C%2FA%3E%3C%2FP%3E%3CP%3EYou%20can%20use%20below%20metrics%20api%20to%20get%20kudos%20count%20in%20community%20on%20date%20range%3C%2FP%3E%3CP%3E%3CSPAN%3Ehttps%3A%2F%2F%26lt%3Byour_community_url%26gt%3B%2Frestapi%2Fvc%2Fmetrics%2Fname%2Fnet_kudos_weight%2F%3Fdate_start%3D2018-07-01%26amp%3Bdate_end%3D2018-07-07.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
ntmcgee
New Commentator

LiQL Post Count, Kudo count, an solution count for users in one week.

I'm having some trouble figuring out the best way to get an automated report from Lithium. I only need a few stats, and I have gotten the post count with:

"https://api.lithium.com/community/2.0/******/search?q=SELECT+count%28*%29+FROM+messages+WHERE+author...' | jq -r '.data.count"

But I can not figure out how to get the kudos or the solutions by time period.

0 Kudos
4 Replies
Highlighted
Esteemed Contributor
Esteemed Contributor

Re: LiQL Post Count, Kudo count, an solution count for users in one week.

@ntmcgee

You can use below metrics api to get kudos count in community on date range

https://<your_community_url>/restapi/vc/metrics/name/net_kudos_weight/?date_start=2018-07-01&date_end=2018-07-07.

 

.......
Did you know we work with Kudos and Accepted Solution.
Reply
Loading...
ntmcgee
New Commentator

Re: LiQL Post Count, Kudo count, an solution count for users in one week.

Thank you for the reply! But I actually need to keep track of things per user.

 

I'm trying to keep track of employee activity on our community.

 

Do you have any idea how I could pull this off?

0 Kudos
Reply
Loading...
Esteemed Contributor
Esteemed Contributor

Re: LiQL Post Count, Kudo count, an solution count for users in one week.

@ntmcgee,

Using V1:

Below API will return you kudos count for the last week.

 

/restapi/vc/users/id/4/metrics/name/net_kudos_weight_received?date_start=2018-07-01&date_end=2018-07-07

Below API will return you Total Posts Count for the last week:

 

/restapi/vc/users/id/4/metrics/name/overall_posts?date_start=2018-07-01&date_end=2018-07-07

 Below API will return you Total Accepted solution Count for the last week of user:

/restapi/vc/users/id/4/metrics/name/net_accepted_solutions?date_start=2018-07-01&date_end=2018-07-07

 

---

You can get Overall Post count, Kudos count and Solution count of the user using below LiQL API V2

 

SELECT messages.count(*), kudos_received.sum(weight), solutions_authored.count(*) FROM users WHERE id = '4'

Using this API will return response for one user for

 

 

user_activity.PNG

 

.......
Did you know we work with Kudos and Accepted Solution.
0 Kudos
Reply
Loading...
ntmcgee
New Commentator

Re: LiQL Post Count, Kudo count, an solution count for users in one week.

Thanks for that! Based on the paths, that looks like it would work!

For whatever reason, I am getting permission denied though.

I have admin access, I wonder if there is another role that I need to have?

0 Kudos
Reply
Loading...