Update Message
This request updates a message, targeted by secure ID.
patch | /sms/messages/{message_sid} |
put | /sms/messages/{message_sid} |
Sample
A sample PATCH request to update the SMS object, targeted by secure ID, with the values in the request body:
curl -X PATCH \
'https://api.carrierx.com/core/v2/sms/097b49df-c54e-4eaf-97d0-89cf7d5a655b' \
-H 'Content-Type: application/json' \
--data-binary '{"user_data":"updated_test_message"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200
status code with a serialized copy of the updated SMS object:
{
"date_changed": "2024-01-06T15:18:30.084Z",
"date_created": "2023-12-06T15:18:29.189Z",
"date_status_changed": "2023-12-06T15:18:30.046Z",
"direction": "outbound",
"from": "15162065575",
"group_recipients": [],
"mcc": 310,
"media_urls": [],
"message": "This is a test message",
"message_segments": 1,
"message_sid": "097b49df-c54e-4eaf-97d0-89cf7d5a655b",
"mnc": 999,
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"price": "0.01",
"status": "delivered",
"to": "15162065574",
"type": "sms",
"user_data": "updated_test_message"
}
An SMS object can be updated using either a PATCH
or PUT
request.
-
A
PATCH
request can be used to update one or more attribute values. When using aPATCH
request, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The message secure ID is passed in the query URL, and the values to be modified are passed in the request body. -
A
PUT
request can be used to update an entire SMS object. The message secure ID is passed in the query URL, and the entire SMS object is passed in the request body.
Note, while all the fields must be present in a PUT
request, not all the attribute values may be modified after the initial creation, because when created, some of them become read-only.
Required Scopes
To update an SMS object, the partner must have one of the following scopes enabled:
sms.manage
sms.update
Path Arguments
Parameter | Data Type | Description |
---|---|---|
message_sid required | string | The message secure ID. |
Body Arguments
JSON representation of the fields and values to be updated.
The field that can be modified is user_data
.
Refer to this table to view all fields that appear in the SMS object.