Link Search Menu Expand Document

Updated Fri Mar 5th 2021, 12:17 UTC

Opt-In

PUT /conversations/:conversation/subscribe

When a User has manually created an OptOut for a Contact PhoneNumber, it is possible to resubscribe that PhoneNumber. However, if the Contact requested the Opt-Out, then this action is not permitted.

Please note, if the Contact requested the Opt-Out through another channel (email, phone call), you may be setting yourself at legal risk by re-subscribing the Contact without their consent.

Examples

Subscribe

Request

PUT /conversations/Pvwqm5G/subscribe
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X PUT /conversations/Pvwqm5G/subscribe
    

Response

Status

200

Response Type

Conversation

Example
{
  "@type": "Conversation",
  "id": "/conversations/JYnJBY",
  "@context": "/contexts/Conversation.jsonld",
  "slug": "JYnJBY",
  "currentState": "closed",
  "account": "/accounts/marks_llc",
  "requestingUserInfo": {
    "@type": "ConversationUserInfo",
    "id": "/conversations/JYnJBY/user_info",
    "@context": "/contexts/ConversationUserInfo.jsonld",
    "read": false,
    "readToTimelinePosition": null,
    "starred": false,
    "assigned": false
  },
  "phoneNumber": "+13035551234",
  "formattedPhoneNumber": "(303) 555-1234",
  "assignedContact": null,
  "associatedContacts": "/conversations/JYnJBY/associated_contacts",
  "participants": "/conversations/JYnJBY/participants",
  "assignments": "/conversations/JYnJBY/assignments",
  "reopenConversation": null,
  "closeConversation": "/conversations/JYnJBY/close",
  "readConversation": "/conversations/JYnJBY/read",
  "unreadConversation": "/conversations/JYnJBY/read",
  "starConversation": "/conversations/JYnJBY/star",
  "unstarConversation": "/conversations/JYnJBY/star",
  "blockConversation": "/conversations/Pvwqm5/block",
  "unblockConversation": null,
  "subscribeConversation": "/conversations/Pvwqm5G/subscribe",
  "unsubscribeConversation": null,
  "timeline": "/conversations/JYnJBY/timeline",
  "unanswered": false,
  "unsubscribed": false,
  "blocked": false,
  "stats": "/conversations/Pvwqm5G/stats",
  "assignContact": "/conversations/Pvwqm5G/assign_contact",
  "latestPreviewableItem": {
    "@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>",
    "deliveryState": "delivered",
    "displayTimestamp": "2018-07-24T20:59:32.156Z",
    "timelinePosition": "2018-07-24T20:59:32.156Z",
    "conversation": "/conversations/kY1QwY",
    "sender": {
      "@type": "User",
      "@context": "/contexts/User.jsonld",
      "id": "/users/wqyODPA",
      "name": "Chuck Norris",
      "firstName": "Chuck",
      "lastName": "Norris",
      "email": "chuck@textus.example",
      "avatar": "icon.png",
      "automatedActor": false,
      "hasPassword": false,
      "discarded": false,
      "settings": {
        "notifications": {
          "email": true
        },
        "customSettings": {}
      },
      "memberships": "/users/wqyODPA/memberships"
    },
    "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": [
      "auto_message"
    ]
  }
}

© 2021 TextUs