Get resource by id