Get your sequence in 2 steps!
To start, get your account (but use your email, please):
curl -XPUT -d'password=testing' https://email@example.com
You ought to get back a success:
Then get your sequence, if it's new we'll create it and start it from 1:
curl -XPOST -d'auth=testing' https://firstname.lastname@example.org/myFirstSequence
You'll get back the range of IDs you requested, 1 by default:
Looking for more?
Well, there's not much more... but here's a couple thoughts:
If base 10 is to weak for you, you can request your sequence in base 8, 16 or 36 by adding a suffix to your sequence:
curl -XPOST -d'auth=testing' https://email@example.com/myFirstSequence.b36 (or .b16, or .b8)
You'll get back your IDs all nice. For example, if you were on ID 37:
NB if you ask for a different base or no base it all the default is base 10. Also if you provide a valid .b# extension the return values are strings instead of numbers.
N even more B putting on an extension does not change the sequence. so /myFirstSequence and /myFirstSequence.b36 will give you successive numbers - just in a different base.
If you want to get more than one ID at a time, just ask:
curl -XPOST -d'auth=testing' https://firstname.lastname@example.org/myFirstSequence?get=10
You'll get back the range of IDs you requested:
If you're looking for something more snowflake-esque, dynamically name your sequence the date or milliseconds since epoch, you'll get IDs that reset every time the sequence name changes - because we autovivify your sequence at first request, you never have to worry about the existence of a sequence before requesting numbers.
You won't need a machine id since this sequence is across all machines, but you're not getting 10s of thousands of IDs per second. You can grab several IDs in a single request and cache them locally and get more when you run out, that'll save you some latency... but really if you need that kind of performance what are you looking here for? Just run a snowflake server.
Run it yourself!
Yup, that's it.
But I could build that myself!
You sure could.