Can you print the response as shown below
resp = platform.post('/restapi/v1.0/account/~/extension/~/sms',
{
'from' : { 'phoneNumber': RINGCENTRAL_USERNAME },
'to' : [ {'phoneNumber': RECIPIENT} ],
'text' : 'Hello World from Python'
})
print resp.text()
Thanks heres the response
{
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/message-store/8373199004",
"id" : 8373199004,
"to" : [ {
"phoneNumber" : "+15622916474",
"location" : "Downey, CA"
} ],
"from" : {
"phoneNumber" : "+12107291286",
"name" : "Telemarketing ."
},
"type" : "SMS",
"creationTime" : "2020-06-30T19:59:09.000Z",
"readStatus" : "Read",
"priority" : "Normal",
"attachments" : [ {
"id" : 8373199004,
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/message-store/8373199004/content/8373199004",
"type" : "Text",
"contentType" : "text/plain"
} ],
"direction" : "Outbound",
"availability" : "Alive",
"subject" : "Test SMS using a RingCentral Developer account - Hello World from Python",
"messageStatus" : "Queued",
"smsSendingAttemptsCount" : 1,
"conversationId" : 4763525408982918811,
"conversation" : {
"id" : "4763525408982918811",
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/conversation/4763525408982918811"
},
"lastModifiedTime" : "2020-06-30T19:59:09.628Z"
}
it says failed, what can be causing that, tried doing it from the console and they don't get sent, but the callout feature works.
{
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/message-store/8373199004",
"id" : 8373199004,
"to" : [ {
"phoneNumber" : "+15622916474",
"location" : "Downey, CA"
} ],
"from" : {
"phoneNumber" : "+12107291286",
"name" : "Telemarketing ."
},
"type" : "SMS",
"creationTime" : "2020-06-30T19:59:09.000Z",
"readStatus" : "Read",
"priority" : "Normal",
"attachments" : [ {
"id" : 8373199004,
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/message-store/8373199004/content/8373199004",
"type" : "Text",
"contentType" : "text/plain"
} ],
"direction" : "Outbound",
"availability" : "Alive",
"subject" : "Test SMS using a RingCentral Developer account - Hello World from Python",
"messageStatus" : "SendingFailed",
"smsSendingAttemptsCount" : 1,
"conversationId" : 4763525408982918811,
"conversation" : {
"id" : "4763525408982918811",
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/conversation/4763525408982918811"
},
"lastModifiedTime" : "2020-06-30T19:59:10.355Z"
}
This is what i got
{
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/phone-number?page=1&perPage=100",
"records" : [ {
"features" : [ "CallerId", "SmsSender", "MmsSender" ],
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/phone-number/343601004",
"id" : 343601004,
"phoneNumber" : "+12107291286",
"paymentType" : "Local",
"type" : "VoiceFax",
"usageType" : "MainCompanyNumber",
"status" : "Normal",
"country" : {
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1",
"id" : "1",
"name" : "United States"
}
} ],
"paging" : {
"page" : 1,
"totalPages" : 1,
"perPage" : 100,
"totalElements" : 1,
"pageStart" : 0,
"pageEnd" : 0
},
"navigation" : {
"firstPage" : {
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/phone-number?page=1&perPage=100"
},
"lastPage" : {
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/phone-number?page=1&perPage=100"
}
}
}
the '+12107291286' , is the number they assigned us in the sandbox account, the other one is one of our regular RC numbers
tried using my mobile number and got the same.
{
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/message-store/8373371004",
"id" : 8373371004,
"to" : [ {
"phoneNumber" : "+1562572XXXX"
} ],
"from" : {
"phoneNumber" : "+12107291286",
"name" : "Telemarketing ."
},
"type" : "SMS",
"creationTime" : "2020-06-30T21:14:08.000Z",
"readStatus" : "Read",
"priority" : "Normal",
"attachments" : [ {
"id" : 8373371004,
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/280008004/extension/280008004/message-store/8373371004/content/8373371004",
"type" : "Text",
"contentType" : "text/plain"
} ],
"direction" : "Outbound",
"availability" : "Alive",
"subject" : "Test SMS using a RingCentral Developer account - tester",
"messageStatus" : "SendingFailed",
"smsSendingAttemptsCount" : 1,
"conversationId" : 4763525412780169249,
"conversation" : {
"id" : "4763525412780169249",
"uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/conversation/4763525412780169249"
},
"lastModifiedTime" : "2020-06-30T21:14:08.872Z"
}