From 7e0244d49c28d9f5b1e8a907f6a95ed4adf42f1e Mon Sep 17 00:00:00 2001 From: Jezza Hehn Date: Sat, 18 Apr 2026 02:58:30 +0000 Subject: [PATCH] docs: fix README examples for follow, vote, reaction jobs - follow.follow requires payload dict, not username string - vote.votecast uses 'vote' not 'voteType', and has parent structure - reaction.reacttosomething uses 'reaction' and 'parent', not 'reactionType' and 'objectPK/SK' - feed.following -> feed.followingfeed - branch.listbyname doesn't take prefix parameter --- README.md | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fcce906..37d0e20 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,15 @@ profile = API.run_job('userprofile.get', "username") ```python # Follow a user -followed = API.run_job('follow.follow', "username-to-follow") +followed = API.run_job('follow.follow', { + "isFollowing": true, + "parent": { + "pk": "userprofile#username", + "sk": "userprofile#username" + }, + "followType": "userprofile", + "parentSlug": "username" +}) ``` #### Vote Operations @@ -239,9 +247,13 @@ followed = API.run_job('follow.follow', "username-to-follow") ```python # Cast a vote voted = API.run_job('vote.votecast', { - "pk": "post-id", - "sk": "post-id", - "voteType": "up" # or "down" + "parent": { + "pk": "post-id", + "sk": "post-id", + "slug": "post-slug", + "entity": "post" + }, + "vote": "up" # or "down" }) ``` @@ -250,10 +262,11 @@ voted = API.run_job('vote.votecast', { ```python # React to something (post, comment, etc.) reactions = API.run_job('reaction.reacttosomething', { - "objectPK": "post-id", - "objectSK": "post-id", - "objectType": "post", - "reactionType": "like" # various types supported + "parent": { + "pk": "post-id", + "sk": "post-id" + }, + "reaction": "like" # various types supported }) # Get reactions by parent @@ -296,8 +309,8 @@ trusts = API.run_job('trust.listbyuserhas', "username") # Get a specific branch branch = API.run_job('branch.get', "branch-name") -# List branches by name -branches = API.run_job('branch.listbyname', "prefix") +# List branches (all branches with pagination) +branches = API.run_job('branch.listbyname') ``` #### Feed Operations @@ -307,7 +320,7 @@ branches = API.run_job('branch.listbyname', "prefix") feed = API.run_job('feed.cafefeed') # Get following feed -following_feed = API.run_job('feed.following') +following_feed = API.run_job('feed.followingfeed') ``` #### Block Operations @@ -466,7 +479,15 @@ API = trustcafeapiwrapper.APIClient( ) # Follow a user -follow = API.run_job('follow.follow', "philosopher-jon") +follow = API.run_job('follow.follow', { + "isFollowing": true, + "parent": { + "pk": "userprofile#philosopher-jon", + "sk": "userprofile#philosopher-jon" + }, + "followType": "userprofile", + "parentSlug": "philosopher-jon" +}) print(f"Followed user: {follow}") # Get their profile