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

Provide a way to get identifier by prefix #202

Closed
lenkan opened this issue Mar 1, 2024 · 2 comments
Closed

Provide a way to get identifier by prefix #202

lenkan opened this issue Mar 1, 2024 · 2 comments

Comments

@lenkan
Copy link
Collaborator

lenkan commented Mar 1, 2024

It would be convenient to be able to do GET /identifiers/{prefix} instead of GET /identifiers/{name}. One use case is when you are reading a notification or exchange message. In that case, you only have the prefix of the intended recipient AID. So currently you have to first need an API call to get all identifiers, then pick the identifier you need to work with.

exchange = { ... a: { i: "prefix-1" } }
identifiers = listIdentifiers() // API Request to list all identifiers
identifier = identifiers.find(id => id.prefix === exchange.a.i) // Pick the identifier you needed

If we had a way to get identifier by prefix, we could do

exchange = { ... a: { i: "prefix-1" } }
identifier = getIdentifier(exchange.a.i)

Notes

Currently, you can only get an identifier by their name through the API. This is convenient for manually constructing URLs or when using the kli. When code is constructing the URL, I think using the prefix is more useful.

@2byrds
Copy link
Collaborator

2byrds commented May 2, 2024

From our dev meeting this issue could be closed in favor #217

@lenkan
Copy link
Collaborator Author

lenkan commented Sep 2, 2024

Fixed by #269

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