title: How do I read the parameter of the GET request in a RESTful Flask/SQLAlchemy/Marshmallow environment
body: <p>I was working my way through a couple of tutorials before xmas and I'm now trying to pick up where I left of.
  Trying to teach myself REST by building some simple API end points. My confusion is coming from the fact that I cant find the tutorials I was using and there seems to be several different ways to solve the problem. So now I'm not sure what is the correct way to do it.
  The code is working for returning all customers in the DB, now I want to return a specific customer based on their Id</p>
  
  <p>Ok this is what I have...</p>
  
  <p>I have an app.py that defines the resource like this:</p>
  
  <pre><code>api.add_resource(CustomerResource, '/Customer')
  </code></pre>
  
  <p>I have a models.py that defines the customer class like this:</p>
  
  <pre><code>ma = Marshmallow()
  db = SQLAlchemy()
  
  class Customer(db.Model):
      __tablename__ = 'customers'
      __table_args__ = {"schema":"business"}
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.Text, nullable=False)
      status = db.Column(db.Integer, nullable=False)
  
  class CustomerSchema(ma.Schema):
      id = fields.Integer()
      name = fields.String(required=True)
      status = fields.Integer(required=True)
  </code></pre>
  
  <p>I have customer.py that defines the customer class as this:</p>
  
  <pre><code>customers_schema = CustomerSchema(many=True)
  customer_schema = CustomerSchema()
  
  class CustomerResource(Resource):
      def get(self):
          customers = Customer.query.all()
          customers = customers_schema.dump(customers)
          return {'status': 'success', 'data': customers}, 200
  </code></pre>
  
  <p>I have tried using request.args, but I dont believe that is the correct way to go due to the fact it will become unspported.</p>
  
  <p>So the above all works with the GET successfully returning all customers. But now I want to be able to use GET <a href="http://127.0.0.1:5000/api/Customer/10" rel="nofollow noreferrer">http://127.0.0.1:5000/api/Customer/10</a> and to just return the details for customer id = 10</p>
  
  <p>I'm not sure whether I need to define a new resource or whether the existing CustomerResource can be modified to test for the presence of a parameter.</p>
  
  <p>Any guidance appreciated...</p>