import requests


def get_model_id(access_token, model_name):
  """Gets 3D printing company model id using model name
  Args:
    access_token (str): Current access token for business account
    model_name (str): Model name stored with 3D printing company
  Returns:
    model_id (str): Model ID matching the parameter model name passed
  """
  # Url to retrieve model data
  api_url = 'https://api.shapeways.com/models/v1'
  
  # Builds url header information
  headers = {
    'Authorization': 'Bearer ' + access_token
  }

  # Gets model data
  models_response = requests.get(url=api_url +'?', headers=headers)
  
  # Get model id by model name
  model_id = [model['modelId'] for model in models_response.json()['models'] if model['title'] == model_name]
  
  # Returns model id matching model name parameter from list
  return model_id