Skip to content

Instantly share code, notes, and snippets.

@rrrkren
Last active April 5, 2022 17:04
Show Gist options
  • Save rrrkren/d6f8948b08267e04932cfc367b9c8575 to your computer and use it in GitHub Desktop.
Save rrrkren/d6f8948b08267e04932cfc367b9c8575 to your computer and use it in GitHub Desktop.
fetching topshot moment link by flow ID
curl --request POST 'https://public-api.nbatopshot.com/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query {getMintedMoment(momentId: \"13251145\") {data {id\n flowId}}}"}'
# {"data":{"getMintedMoment":{"data":{"id":"909806bb-60fd-4d72-b38f-42be7c5da5d7","flowId":"13251145"}}}}
# the `13251145` is the moment's flow ID that you can find on events, the ashes ID is the same TS moment ID it came from.
# the ID you get in the response is the topshot's offchain moment ID. you can put compose the moment URL in this format:
# https://nbatopshot.com/moment/909806bb-60fd-4d72-b38f-42be7c5da5d7
# this actually works in the other way around, the ID you passed in can also be the moment's UUID
curl --request POST 'https://public-api.nbatopshot.com/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query {getMintedMoment(momentId: \"909806bb-60fd-4d72-b38f-42be7c5da5d7\") {data {id\n flowId}}}"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment