Hello I have some JS code below related to the API of an app we use at work.
I am trying to get the to numbers section below to return the input data in the screen shot. I have no idea how to write JS but any help or ideas to get this to be correct would be great.
In the actual JS code from the API docs I was returning this and on testing it worked.
"to_numbers": ["+15555555555"],
I can’t however figure out how to pull the input data

import requests
url = "https://dialpad.com/api/v2/sms"
payload = {
"infer_country_code": False,
"to_numbers": return {'phone': input_data ['phone']},
"text": "test message",
"user_id": 4897195490967552
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer TBEfvRW49wqwqJN7pyYZ3mNgYU3qdeb92VSaKtqgesXaMLLSWnPMQ9t9A4xZapMNnscpVaT3qWhzFvAF3qJy42NvSvjrr3CKAHCN"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Best answer by Dan_GRHF
View original