Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

associations endpoinst query for post associations #608

Closed
nheffelman opened this issue Jul 18, 2023 · 4 comments
Closed

associations endpoinst query for post associations #608

nheffelman opened this issue Jul 18, 2023 · 4 comments

Comments

@nheffelman
Copy link

I'm trying to query for a post association with AssociationValuePrefix(wildcard query).

If I do so, I get {'error': 'GetPostAssociations: GetPostAssociationsByAttributes: : DBGetPostAssociationsByAttributes: : DBGetPostAssociationIdsByAttributes: invalid query params: missing AssociationValue'}

If I include an associationValue with an empty string or a string with a random value i get
{'error': 'GetPostAssociations: GetPostAssociationsByAttributes: : invalid query params: both AssociationValue and AssociationValuePrefix provided'}

@nheffelman
Copy link
Author

yeah, i can't see any way to possibly use AssociationValuePrefix

I'm sure it's not there to intentionally not be used, but it is unusable. You cannot use it to query. It breaks all queries if it is included.

@lazynina
Copy link
Member

@nheffelman - you need to specify the AssociationType if you wish to query using AssociationValuePrefix. Here's an example:

curl 'https://node.deso.org/api/v0/post-associations/query' \
  -H 'content-type: application/json' \
  --data-raw '{"PostHashHex":"4f96f087f77f318042fcea42425b3b4a725951f4aa7438ef82b117d42c9b4629","AssociationType":"REACTION","AssociationValuePrefix": "L"}' \
  --compressed

@nheffelman
Copy link
Author

Thanks lazynina, after I saw your curl request worked with my post hash hex, I figured out I didn't need to include anything but posthashhex, type, and value prefix. Now i'm getting the response i wanted. I had been additionally including transactorKey and appKey in my request.

@lazynina
Copy link
Member

@nheffelman - glad it's working for you now. transactorKey and appKey will further filter your results, but is likely not what you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants