formatids function

Format ids for web API queries