code: function get_id(val) {
    if ( typeof val === 'string' || typeof val === 'number' )
      return val;
  
    if ( typeof val === 'object' && val.id )
      return val.id;
  
    return false;
  }
docs: Whether the value can be used in the REST endpoint
  @param  {Mixed}  val
  @return {Boolean}     TRUE if value can be inserted into the endpoint