You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using @atproto/api@0.10.4 from npm.
The getActorLikes() API returns "Profile not found" even if I specify the correct handle name or DID. (I am using my own authenticated handle and did.)
I implemented a function to hit the getActorLikes endpoint myself to try it out.
However, even though all URL parameters and options are correct, "400 bad request" is returned.
Call getActorsLikes() from @atproto/api after authenticated. The specific actor is myself.
Hit app.bsky.feed.getActorLikes with bearer from somewhere other than the HTTP reference site. The specific actor is myself.
Expected behavior
The ability to retrieve "Likes" for the user specified in the "actor" parameter.
Details
Operating system: Ubuntu 22.04.4 (WSL2)
Node version: v21.6.1
Additional context
For reference, here is a function I implemented myself as an alternative to getActorLikes().
asyncgetActorLikesMyOwn(queryParams){// queryParams={actor: myhandle, limit: 100};constoptions={method: 'GET',headers: {'Accept': 'application/json','Authorization': `Bearer ${this.accessJwt}`,}};consturl=newURL("https://bsky.social/xrpc/app.bsky.feed.getActorLikes");Object.keys(queryParams).forEach(key=>url.searchParams.append(key,queryParams[key]));console.log(url.toString())try{constresponse=awaitfetch(url,options);if(!response.ok){thrownewError('Network response was not ok');};constdata=awaitresponse.json();returndata;}catch(e){console.error('There was a problem with your fetch operation:',e);throwe;};}
The text was updated successfully, but these errors were encountered:
Sorry, I solved the problem.
It was due to a mistake in my .env file.
The user specified as the actor in getActorLikes() and the bearer user were different, which caused the "Profile not found" and "Bad request" to appear.
By replacing it with the correct .env, getActorLikes() worked as expected.
However, it is strange that the HTML reference says "Does not require auth." but requires the user to be associated with authentication.
Describe the bug
I am using @atproto/api@0.10.4 from npm.
The getActorLikes() API returns "Profile not found" even if I specify the correct handle name or DID. (I am using my own authenticated handle and did.)
I implemented a function to hit the getActorLikes endpoint myself to try it out.
However, even though all URL parameters and options are correct, "400 bad request" is returned.
Note that requests from the following HTTP reference sites function properly and can retrieve likes.
https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-likes
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The ability to retrieve "Likes" for the user specified in the "actor" parameter.
Details
Additional context
For reference, here is a function I implemented myself as an alternative to getActorLikes().
The text was updated successfully, but these errors were encountered: