In my user database table, I take the MD5 hash of the email address of a user as the id.
Example: email(example@example.org) = id(d41d8cd98f00b204e9800998ecf8427e)
email(example@example.org) = id(d41d8cd98f00b204e9800998ecf8427e)
Use the email address as the file name of a blank, temporary file in a shared folder, like /var/myprocess/example@example.org
Then, call ftok on the file name. ftok will return a unique, integer ID.
It won't be guaranteed to be unique though, but it will probably suffice for your API.