title: Error while building a RESTApi using flask_restful
body: <p><strong>Flask RESTApi newbie here</strong></p>
  
  <p>I am trying to build a RESTapi service in Flask (and I am trying to save the output as a <code>.txt</code> file) using <code>flask_restful</code> for a code of mine using the <a href="https://github.com/nerdocs/pydifact" rel="noreferrer">pydifact</a> module as follows:</p>
  
  <pre><code>import datetime
  from pydifact.message import Message
  from pydifact.segments import Segment
  from flask import Flask, request
  from flask_restful import Resource, Api
  
  app = Flask(__name__)
  
  api = Api(app)
  
  
  class RestAPI(Resource):
      def get(self, ABSENDER_ID, EMPFÄNGER_ID, ERSTELLUNG_DATUM_ZEIT, REFERENCE):
          MSCONS = Message()
  
          def erstellung_datum_zeit(dt_time):
              # Needed for the UNB segment
              dt_time = dt_time.strftime('%Y%m%d%H%M')
              return dt_time
  
          def UNA_UNB_segment(absender_id, empfänger_id, erst_datum, ref):
  
              MSCONS.add_segment(Segment('UNA', ":+.? '"))
              MSCONS.add_segment(Segment('UNB', ['UNOC', '3'], [absender_id, '14'], [
                                 empfänger_id, '500'], [erst_datum[2:8], erst_datum[8:]], ref, '', 'TL'))
  
          ERSTELLUNG_DATUM_ZEIT = str(
              erstellung_datum_zeit(datetime.datetime.now()))
          UNA_UNB_segment(ABSENDER_ID, EMPFÄNGER_ID,
                          ERSTELLUNG_DATUM_ZEIT, REFERENCE)
          result = MSCONS.serialize()
          final_result = result
  
          PATH_FOR_TXT = r'C:\Users\kashy\OneDrive\Desktop\Codes\mscons.txt'
          textfile = open(PATH_FOR_TXT, 'w')
          textfile.write(result)
          textfile.close()
  
          return {'result': final_result}
  
  
  api.add_resource(
      RestAPI,
      '/RestAPI/&lt;int:ABSENDER_ID&gt;/&lt;int:EMPFÄNGER_ID/&lt;int:ERSTELLUNG_DATUM_ZEIT/&lt;int:REFERENCE&gt;')
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>The <code>ABSENDER_ID, EMPFÄNGER_ID, ERSTELLUNG_DATUM_ZEIT, REFERENCE</code> should all be user inputs and they should be all in string format.</p>
  
  <p>When I do <code>/RestAPI/&lt;str:ABSENDER_ID&gt;/&lt;str:EMPFÄNGER_ID/&lt;str:ERSTELLUNG_DATUM_ZEIT/&lt;str:REFERENCE&gt;</code>, i get the following error:</p>
  
  <pre><code>C:\Users\kashy\OneDrive\Desktop\Codes\pydifact&gt; &amp; C:/Users/kashy/Anaconda3/envs/py36/python.exe c:/Users/kashy/OneDrive/Desktop/Codes/api.py
  Traceback (most recent call last):
    File "c:/Users/kashy/OneDrive/Desktop/Codes/api.py", line 44, in &lt;module&gt;
      self.url_map.add(rule)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 1401, in add
      rule.bind(self)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 730, in bind
      self.compile()
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 790, in compile
      _build_regex(self.rule if self.is_leaf else self.rule.rstrip("/"))
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 779, in _build_regex
      convobj = self.get_converter(variable, converter, c_args, c_kwargs)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 738, in get_converter
      raise LookupError("the converter %r does not exist" % converter_name)
  LookupError: the converter 'str' does not exist
  </code></pre>
  
  <p>and when I do</p>
  
  <p><code>/RestAPI/&lt;int:ABSENDER_ID&gt;/&lt;int:EMPFÄNGER_ID/&lt;int:ERSTELLUNG_DATUM_ZEIT/&lt;int:REFERENCE&gt;</code>, I get the following error:</p>
  
  <pre><code>PS C:\Users\kashy\OneDrive\Desktop\Codes\pydifact&gt; &amp; C:/Users/kashy/Anaconda3/envs/py36/python.exe c:/Users/kashy/OneDrive/Desktop/Codes/api.py
  Traceback (most recent call last):
    File "c:/Users/kashy/OneDrive/Desktop/Codes/api.py", line 44, in &lt;module&gt;
      '/RestAPI/&lt;int:ABSENDER_ID&gt;/&lt;int:EMPFÄNGER_ID/&lt;int:ERSTELLUNG_DATUM_ZEIT/&lt;int:REFERENCE&gt;')
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\flask_restful\__init__.py", line 382, in add_resource
      self._register_view(self.app, resource, *urls, **kwargs)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\flask_restful\__init__.py", line 448, in _register_view
      app.add_url_rule(rule, view_func=resource_func, **kwargs)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\flask\app.py", line 98, in wrapper_func
      return f(self, *args, **kwargs)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\flask\app.py", line 1277, in add_url_rule
      self.url_map.add(rule)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 1401, in add
      rule.bind(self)
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 730, in bind
      self.compile()
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 790, in compile
      _build_regex(self.rule if self.is_leaf else self.rule.rstrip("/"))
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 766, in _build_regex
      for converter, arguments, variable in parse_rule(rule):
    File "C:\Users\kashy\Anaconda3\envs\py36\lib\site-packages\werkzeug\routing.py", line 226, in parse_rule
      raise ValueError("malformed url rule: %r" % rule)
  ValueError: malformed url rule: '/RestAPI/&lt;int:ABSENDER_ID&gt;/&lt;int:EMPFÄNGER_ID/&lt;int:ERSTELLUNG_DATUM_ZEIT/&lt;int:REFERENCE&gt;'
  </code></pre>
  
  <p>I am totally new to this and just started learning it using the <a href="https://www.youtube.com/watch?v=s_ht4AKnWZg" rel="noreferrer">Building a REST API using Python and Flask | Flask-RESTful</a> tutorial.</p>
  
  <p>Can anyone please tell me what is the mistake I am doing?</p>