|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
− | <translate>
| + | #REDIRECT [[Api]] |
− | = Send Message =
| |
− | This method is used to send an SMS/MMS message.
| |
− | | |
− | == URL ==
| |
− | https://<TENANT_URL>/clientweb/smsapi/v1/Messages
| |
− | | |
− | == HTTP Method ==
| |
− | POST
| |
− | | |
− | == Content-Type ==
| |
− | application/JSON
| |
− | | |
− | === Parameters ===
| |
− | {|border="1" style="border-collapse:collapse" cellpadding="5"
| |
− | | '''Name'''
| |
− | | '''Description'''
| |
− | | '''Additional Info'''
| |
− | |-
| |
− | | To
| |
− | | Destination phone number
| |
− | | mandatory
| |
− | |-
| |
− | | Body
| |
− | | Message text<ref>There may be a maximum number of characters in the message text, and that depends on the service provider. For SMS, 1600 characters max is typical (note: non-GSM characters would be less). For MMS, there is no specific limit for text, but an overall file size limit (typically 300 KB-600 KB)</ref>
| |
− | | Mandatory for SMS; optional for MMS if ''MediaURLs'' is present
| |
− | |-
| |
− | | From
| |
− | | Origination phone number
| |
− | | Mandatory
| |
− | |-
| |
− | | MessagingServiceSid
| |
− | | BP Service identifier
| |
− | | Reserved for future use
| |
− | |-
| |
− | | MediaUrls
| |
− | | Link to content
| |
− | | Used for MMS only
| |
− | |-
| |
− | | StatusCallback
| |
− | | Callback URL
| |
− | | Optional
| |
− | |-
| |
− | | ApplicationSid
| |
− | | BP application identifier
| |
− | | Reserved for future use
| |
− | |-
| |
− | | MaxPrice
| |
− | | Maximum allowed price
| |
− | | optional
| |
− | |-
| |
− | | ProvideFeedback
| |
− | | Request confirmation flag
| |
− | | Reserved for future use; optional (false by default)
| |
− | |-
| |
− | | ValidityPeriod
| |
− | | Max time to wait
| |
− | | Reserved for future use; optional (14,400 sec by default)
| |
− | |}
| |
− | | |
− | | |
− | '''Alternatively, you could specify content as ''application/x-www-form-urlencoded'' :'''
| |
− | | |
− | === Content-Type ===
| |
− | application/x-www-form-urlencoded
| |
− | | |
− | === Parameters ===
| |
− | {|border="1" style="border-collapse:collapse" cellpadding="5"
| |
− | | '''Name'''
| |
− | | '''Description'''
| |
− | | '''Additional Info'''
| |
− | |-
| |
− | | To
| |
− | | Destination phone number
| |
− | | Mandatory
| |
− | |-
| |
− | | Body
| |
− | | Message text
| |
− | | Mandatory for SMS; optional for MMS if ''MediaURLs'' is present
| |
− | |-
| |
− | | From
| |
− | | Origination phone number
| |
− | | Mandatory
| |
− | |-
| |
− | | MessagingServiceSid
| |
− | | BP Service identifier
| |
− | | Reserved for future use
| |
− | |-
| |
− | | MediaUrl (to send multiple media up to 10, specify ''MediaUrl0'', ''MediaUrl1'', …, ''MediaUrl9'')
| |
− | | Link to content
| |
− | | Used for MMS only
| |
− | |-
| |
− | | StatusCallback
| |
− | | Callback URL
| |
− | | Optional
| |
− | |-
| |
− | | ApplicationSid
| |
− | | BP application identifier
| |
− | | Reserved for future use
| |
− | |-
| |
− | | MaxPrice
| |
− | | Maximum allowed price
| |
− | | Optional
| |
− | |-
| |
− | | ProvideFeedback
| |
− | | Request confirmation flag
| |
− | | Reserved for future use; optional (false by default)
| |
− | |-
| |
− | | ValidityPeriod
| |
− | | Max time to wait
| |
− | | Reserved for future use; optional (14,400 sec by default)
| |
− | |}
| |
− | | |
− | == Response Type ==
| |
− | JSON object
| |
− | | |
− | == Response ==
| |
− | {
| |
− | "tenant_id": “<TENANT_ID>”
| |
− | "api_version": "1",
| |
− | "body": "Let's grab lunch at Milliways tomorrow!",
| |
− | "num_segments": "1",
| |
− | "num_media": "1",
| |
− | “subresource_uris”: {“media”: “media_url”}
| |
− | "date_created": "Wed, 18 Aug 2010 20:01:40 +0000",
| |
− | "date_sent": null,
| |
− | "date_updated": "Wed, 18 Aug 2010 20:01:40 +0000",
| |
− | "direction": "outbound-api",
| |
− | "error_code": null,
| |
− | "error_message": null,
| |
− | "from": "14158141829",
| |
− | "sid": "MM90c6fc909d8504d45ecdb3a3d5b3556e",
| |
− | "status": "queued",
| |
− | "to": "15558675310",
| |
− | "uri": "/clientweb/smsapi/v1/Messages/MM90c6fc909d8504d45ecdb3a3d5b3556e"
| |
− | }
| |
− | | |
− | | |
− | | |
− | <references/>
| |
− | </translate>
| |