Schedule

POST /:account/messages/schedule

A Message may be scheduled to be delivered at a future time.

Examples

Schedule a Message

Request

POST /my_account/messages/schedule

Body

{
  "from": "+13035551111",
  "to": "+13035551234",
  "body": "New phone who dis?",
  "scheduled_at": "2058-10-25T18:09:13Z"
}
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X POST /my_account/messages/schedule
    -d '{
  "from": "+13035551111",
  "to": "+13035551234",
  "body": "New phone who dis?",
  "scheduled_at": "2058-10-25T18:09:13Z"
}'

Response

Status

201

Response Type

Message

Example Body

{
  "@type": "Message",
  "id": "/messages/QNDkpL",
  "@context": "/contexts/Message.jsonld",
  "direction": "out",
  "body": "Chuck Norris doesn't use web standards as the web will conform to him.",
  "formattedBody": "<div>Chuck Norris doesn't use web standards as the web will conform to him.</div>",
  "displayTimestamp": "2018-07-24T20:59:32.156Z",
  "timelinePosition": "2018-07-24T20:59:32.156Z",
  "deliveryState": "delivered",
  "conversation": "/conversations/kY1QwY",
  "sender": "/users/hikvlD",
  "attachments": {
    "@context": "/contexts/hydra:Collection.jsonld",
    "@type": "hydra:Collection",
    "id": "/messages/joZqVWd/attachments",
    "members": [],
    "totalItems": 0
  },
  "friendlyStateDescription": "Message Delivered",
  "retryAllowed": false,
  "retry": null,
  "latestEventAt": "2018-07-24T20:59:32.156Z",
  "flags": [
    "scheduled"
  ],
  "source": "textus"
}

© 2024 TextUs