Ask a Question
Back to All

message post success, but unresponsive

I am using "add message to booking " via


where id is a reservation ID in the future. I am the both the guest and the owner of this reservation. The python code is below.

The "response" returned is a success code of 200, however no message appears in the string and I receive no email as the guest (email is specified in the reservation).

Importantly, the developer document's "Try it" button also results in a code 200 AND places the message in the string and produces an email for me as the guest.

I am at a loss as to why my code generates a success code while not actually producing the message as expected.

def LSend(subject, message,typem,idn,sn='true'):
idn = str(idn)
url = "https://api.lodgify.com/v1/reservation/booking/"+idn+"/messages"
payload = "[{"subject":subject,"message":message,"type":typem,"send_notification":sn}]"
headers = {
"accept": "application/json",
"content-type": "application/*+json",
response = requests.post(url, data=payload, headers=headers)
return response

response=LSend(subject='from script',message='Please send this test message.t',typem='Owner',idn=MYIDHERE)