Got it

HUAWEI B525s-23a 4G/LTE WIFI ROUTER - Access via API

Created: Feb 17, 2020 12:38:49Latest reply: Aug 21, 2021 15:53:45 5228 4 9 0 0
  Rewarded HiCoins: 1 (problem resolved)

I am writing a PERL script to call the API on my router with some Curl commands. I want to send an SMS. So far I have managed to obtain tokens and login via the API (I am using sha256 and base64 to hash and encode the password into the correct format) but I cannot send an SMS. I keep getting error '100003' (Access denied). I have obtained the Session ID and Token from 'http://192.168.8.1/api/webserver/SesTokInfo'. Should I be using the same Session ID and Token as I logged in with or should I update them from 'SesTokInfo'?

Here is the section of code I am using:

my $message_data = "<request><Index>-1</Index><Phones><Phone>$PHONE_NUMBER</Phone></Phones><Sca></Sca><Content>hello</Content><Length>5</Length><Reserved>1</Reserved><Date>2020-02-17 02:00</Date></request>";

system "curl -v -X POST --data \"$message_data\" \"http://192.168.8.1/api/sms/send-sms\"
 -H \"Host: 192.168.8.1\"
 -H \"Cookie: SessionID=$SESSION_ID\"
 -H \"__RequestVerificationToken: $TOKEN\"
 -H \"X-Requested-With: XMLHttpRequest\"
 -H \"Content-Type: application/x-www-form-urlencoded; charset=UTF-8\"
 -H \"Accept: */*\"
 -H \"Accept-Language: en-GB,en;q=0.5\"
 -H \"Accept-Encoding: gzip, deflate\"
 -H \"Referer: http://192.168.8.1/html/smsinbox.html\"
 -H \"'X-Requested-With: XMLHttpRequest'\"
 -H \"Connection: keep-alive\"
 -H \"Origin: http://192.168.8.1\"
 --dump-header send_sms_session.txt";

Featured Answers

Recommended answer

chenhui
Admin Created Feb 17, 2020 12:40:17

Only the author can view this post
  • x
  • convention:

All Answers
chenhui
chenhui Admin Created Feb 17, 2020 12:40:17

Only the author can view this post
  • x
  • convention:

Only the author can view this post
  • x
  • convention:

Only the author can view this post
  • x
  • convention:

Only the author can view this post
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.