<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Using a API to send out a SMS]]></title><description><![CDATA[<p dir="auto">After running this code, I get no errors only a blank screen. Could anyone tell what I did wrong at first glance?</p>
<p dir="auto">from m5stack import *<br />
from m5ui import *<br />
from uiflow import *</p>
<p dir="auto">fields = {<br />
'from': 'PythonElk',<br />
'to': '+XXXXXXXX',<br />
'message': 'Test Message To your phone.'<br />
}<br />
try:<br />
req = urequests(<br />
method='POST',<br />
url='<a href="https://api.46elks.com/a1/SMS" target="_blank" rel="noopener noreferrer nofollow ugc">https://api.46elks.com/a1/SMS</a>',<br />
headers=fields,<br />
data={'XXXXXXXXXXXXXXXXXXXXX',' YYYYYYYYYYYYYYYYYYYY'}<br />
)<br />
except Exception as e:<br />
print(e)<br />
import urequests<br />
import ujson<br />
setScreenColor(0x111111)<br />
auth = (<br />
'XXXXXXXXXXXXXXXXXXXXXXXX',<br />
'YYYYYYYYYYYYYYYYYYYYYY'<br />
)<br />
fields = {<br />
'from': 'PythonElk',<br />
'to': '+XXXXXXXX',<br />
'message': 'Test Message To your phone.'<br />
}<br />
headers = {'Content-Type': 'application/json'}<br />
try:<br />
#urequests.request(method='POST', url='<a href="https://api.46elks.com/a1/SMS" target="_blank" rel="noopener noreferrer nofollow ugc">https://api.46elks.com/a1/SMS</a>', auth, fields,headers<br />
post_data = ujson.dumps('XXXXXXXXXXXXXXXXXXXXXXX','YYYYYYYYYYYYYYYYYYYYYYYYYYY')<br />
request_url = '<a href="https://api.46elks.com/a1/SMS" target="_blank" rel="noopener noreferrer nofollow ugc">https://api.46elks.com/a1/SMS</a>'<br />
res = requests.post(request_url, headers = {'content-type': 'application/json'}, data = post_data,json=fields)<br />
print(res)</p>
<h1>req = urequests.request(method='POST', url="import urequests  setScreenColor(0x222222)  fields = {     'from': 'PythonElk',     'to': '+XXXXXXX',     'message': 'Test Message To your phone.'     }     try:   req = urequests.request(     method='POST',     url='<a href="https://api.46elks.com/a1/SMS" target="_blank" rel="noopener noreferrer nofollow ugc">https://api.46elks.com/a1/SMS</a>',     headers=fields,     data=('XXXXXXXXXXXXXXXX','YYYYYYYYYYYYYYYYYYYYY')     ) except:   print(req.status_code)",json={'user':'a'}, headers={})</h1>
<p dir="auto">except Exception as e:<br />
print(e)</p>
]]></description><link>https://community.m5stack.com/topic/1841/using-a-api-to-send-out-a-sms</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 03:46:18 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1841.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Apr 2020 00:32:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using a API to send out a SMS on Sat, 02 May 2020 11:50:43 GMT]]></title><description><![CDATA[<p dir="auto">Me and a friend of mine figured out how to do a HTTP post with parameters in micropython. Me used it for sending SMS, but it can be modified to anything else.<br />
<a href="https://forum.m5stack.com/topic/1902/http-post-from-arduino-esp8266-esp32-how-to-send-parameters-x-www-form-urlencoded-using-micropython/3" target="_blank" rel="noopener noreferrer nofollow ugc">https://forum.m5stack.com/topic/1902/http-post-from-arduino-esp8266-esp32-how-to-send-parameters-x-www-form-urlencoded-using-micropython/3</a></p>
]]></description><link>https://community.m5stack.com/post/8483</link><guid isPermaLink="true">https://community.m5stack.com/post/8483</guid><dc:creator><![CDATA[rbrakus]]></dc:creator><pubDate>Sat, 02 May 2020 11:50:43 GMT</pubDate></item><item><title><![CDATA[Reply to Using a API to send out a SMS on Sun, 12 Apr 2020 06:30:42 GMT]]></title><description><![CDATA[<p dir="auto">I do not see any GUI objects required to show text on the screen. I only see code that runs in the background.</p>
]]></description><link>https://community.m5stack.com/post/8121</link><guid isPermaLink="true">https://community.m5stack.com/post/8121</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 12 Apr 2020 06:30:42 GMT</pubDate></item></channel></rss>