title: get a reuse the token for the Huawei modem E3372h
body: <p>so i want to read some sms received in my huawei modem.</p>
  
  <p>For that i m tryin to first get the token and session id from the  '<a href="http://192.168.8.1/api/webserver/SesTokInfo" rel="nofollow noreferrer">http://192.168.8.1/api/webserver/SesTokInfo</a> page</p>
  
  <p>then try to reuse this token in the page <a href="http://192.168.8.1/api/sms/sms-list" rel="nofollow noreferrer">http://192.168.8.1/api/sms/sms-list</a></p>
  
  <p>but i got this error</p>
  
  <pre><code>&lt;error&gt;
  &lt;code&gt;125002&lt;/code&gt;
  &lt;message&gt;&lt;/message&gt;
  &lt;/error&gt;
  </code></pre>
  
  <p>which mean that i don t have the right token value, what i m wondering about.</p>
  
  <p>so this is how my code looks</p>
  
  <pre><code>
  import hashlib
  import base64
  import binascii
  import xml.etree.ElementTree as ET
  from datetime import datetime
  import requests
  from bs4 import BeautifulSoup
  
  BASEURL = 'http://192.168.8.1'
  
  
  session = requests.Session()
  reqresponse = session.get(BASEURL + '/api/webserver/SesTokInfo')
  if reqresponse.status_code == 200:
          root = ET.fromstring(reqresponse.text)
          for results in root.iter('SesInfo'):
              sessionid = results.text
              print("the sessionId is", sessionid)
          for results in root.iter('TokInfo'):
              token = results.text
              print("The token is", token)
          sessioncookies = reqresponse.cookies
  
  post_data = '&lt;?xml version = "1.0" encoding = "UTF-8"?&gt;\n'
  post_data += '&lt;request&gt;&lt;PageIndex&gt;1&lt;/PageIndex&gt;&lt;ReadCount&gt;3&lt;/ReadCount&gt;&lt;BoxType&gt;1&lt;/BoxType&gt;&lt;SortTyp$
  
  headers = {'Content-Type': 'text/xml; charset=UTF-8',
                 '__RequestVerificationToken': token
                }
  
  api_url = BASEURL + '/api/sms/sms-list'
  logonresponse = session.post( api_url, data=post_data, headers=headers, cookies=sessioncookies)
  logonresponse2 = session.get( api_url, data=post_data, headers=headers, cookies=sessioncookies)
  
  
  
  
  result = BeautifulSoup(logonresponse.text, 'html.parser')
  
  for r in result:
      print(r)
  
  </code></pre>
  
  <p>can someone helo me with the troubleshooting please?</p>