Create guide to list and update identifiers#169
Merged
aviau merged 1 commit intoFlared:mainfrom Feb 4, 2026
Merged
Conversation
d76dcf8 to
a2e6a50
Compare
gpratte-flare
approved these changes
Feb 4, 2026
aviau
reviewed
Feb 4, 2026
docs/guides/update-identifiers.mdx
Outdated
|
|
||
| api_client = FlareApiClient.from_env() | ||
|
|
||
| last_from: str | None = None |
aviau
reviewed
Feb 4, 2026
docs/guides/update-identifiers.mdx
Outdated
|
|
||
| data = resp.json() | ||
| items = data.get("items", []) | ||
| last_from = data.get("next") or last_from |
aviau
reviewed
Feb 4, 2026
docs/guides/update-identifiers.mdx
Outdated
| method="GET", | ||
| url="/firework/v3/identifiers/", | ||
| params={ | ||
| "from": last_from, |
a2e6a50 to
7664ed6
Compare
Contributor
Author
|
updated script: import time
from flareio import FlareApiClient
api_client = FlareApiClient.from_env()
# 1. List all identifiers
for resp in api_client.scroll(
method="GET",
url="/firework/v3/identifiers/",
):
# Rate limiting (default).
time.sleep(0.25)
data = resp.json()
items = data.get("items", [])
for item in items:
# Rate limiting (default).
time.sleep(0.25)
identifier_id = item.get("id")
# 2. Get the full identifier by ID
identifier_resp = api_client.get(f"/firework/v3/identifiers/{identifier_id}")
identifier = identifier_resp.json().get("identifier")
# Rate limiting (default).
time.sleep(0.25)
# 3. Do the necessary updates to the identifier
api_client.put(
f"/firework/v2/assets/{identifier_id}",
json={
"name": identifier.get("name", "")
+ " (updated)", # Example: update name or other fields
"type": identifier.get("type"), # Required
"data": identifier.get("data"), # Required
# Include other fields from the Identifier schema as needed
},
)
print(f"Updated identifier {identifier_id}") |
aviau
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Guide:

Here's the copy pasted python example, I tested the script to update the name of some identifiers: