Loading...

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

Description

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

Path Parameters

accountId integer The account ID which owns the contact required
contactId integer The contact to opt in required

Request Properties application/json

SubscriptionId integer The ID of the contact that is opted in. required
SmsEnabled boolean Set if we can send an SMS to this contact on this subscription. optional
MmsEnabled boolean Set if we can send a MMS to this contact on this subscription. optional
EmailEnabled boolean Set if we can send an email to this contact on this subscription. optional
VoiceEnabled boolean Set if we can send a voice message to this contact on this subscription. optional


                    

C#


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);

}

}