Then from there you use content::item::get_id (or content_item::get_id from pl/sql) with the relative URL.