Hey all. I wrote a little Python app that I need to have send data to my Bubble App.
I’m getting the following error when posting from Python to Bubble:
Python Code:
import json
from urllib.request import urlopen
url = ‘https://my.bubbleapps.io/version-test/api/1.1/wf/criticalsystems’
req = url
headerInfo = {‘content-type’: ‘application/json’ }
cudtomerId = “1234567890x0987654321”
print (line, " - ALIVE")
postdata = {'customer':cudtomerId, 'ipaddress':line, 'alive':"true"}
print (postdata)
jLoad = json.dumps(postdata)
print (jLoad)
r = requests.post(req, headerInfo, jLoad)
print (r.text)
print (r.status_code)
Here’s the Debugged output from the console window of the Python App.
10.75.10.92 - ALIVE
postdata: {‘customer’: ‘1234567890x0987654321’, ‘ipaddress’: ‘10.75.10.92’, ‘alive’: ‘true’}
jLoad: {“customer”: “1234567890x0987654321”, “ipaddress”: “10.75.10.92”, “alive”: “true”}
{“statusCode”:400,“body”:{“status”:“MISSING_DATA”,“message”:“Missing parameter for workflow criticalsystems: parameter customer”}}
400
Press any key to continue . . .
The r.status_code is telling me im missing the parameter “customer” but as you can see it’s being send in jLoad…
Here’s the bubble side:
API Work Flow:
I greatly appreciate the help everyone. Thanks a million!!!