Loading...

Description

Opts a contact into a specific subscription. Contacts are sent a handset verification message.


Request URL

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/contact/{contactId}/subscription

Request Properties

Parameter Description Mandatory
accountId The account ID which owns the contact Yes
contactId The contact to opt in Yes
SubscriptionId The ID of the contact that is opted in. Yes
SmsEnabled Set if we can send an SMS to this contact on this subscription. No
MmsEnabled Set if we can send a MMS to this contact on this subscription. No
EmailEnabled Set if we can send an email to this contact on this subscription. No
VoiceEnabled Set if we can send a voice message to this contact on this subscription. No

C#
PHP


using System;
using System.Collections.Generic;
using System.Linq;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Models;

public class Program
{

private static void Main(string[] args)
{

const int accountId = XXXX;

const int contactId = XXXXX;

const int subscriptionId = XXXXX;

var context = new T70Context();

var contactSubRepo = context.Repository<ContactSubscription>(new { AccountId = accountId, ContactId =contactId });

var item = new ContactSubscription()
{

SubscriptionId = subscriptionId ,

EmailEnabled = false,

SmsEnabled = true,

MmsEnabled = false,

VoiceEnabled = false

};

contactSubRepo.Add(item);

}

}

 

Stay tuned for JAVA code snippet
Stay tuned for RUBY code snippet
Stay tuned for PHP code snippet