Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Understand base64 encode id for Github v4 API

Solved! Go to Solution.

Recently when querying to github, the ID field for an entity decribes it self as "Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID."

 

When I decode an Id as -

 

>>> b64decode('MDQ6VXNlcjMzODI4OTQy').decode('utf-8')
'04:User33828942'

 

"User" signifies entity, and the number signifies databaseID?

What does "04" prefixed to ":" mean/ signify?

1 Reply
Solution
Community Manager
Message 2 of 2

Re: Understand base64 encode id for Github v4 API

The underlying structure of the IDs is undocumented and subject to change at any time.

 

I hope that helps.