-2

error - {"type":"error","message":"Invalid mobile number. You must have entered either less than 10 digits or there is an alphabetic character in the mobile number field in API","code":"202"}

import http.client
ph='9999999999'
conn = http.client.HTTPSConnection("api.msg91.com")
print(ph)
payload = '''{"sender": "SOCKET",
  "route": "4",
  "country": "91",
  "sms": [
    {
      "message": "Testing",
      "to": "'+str(ph)+'"
    }
  ]}'''
0

1 Answer 1

1

You can either use format or f-strings concept of Python. Below code snippet is an example of f-strings

var_name= "World"
payload = f"Hello {var_name}"

print(payload)
Hello World

For format:

var_name = "World"
payload = "Hello {var}".format(var=var_name)
print(payload)
Hello World
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.