Loading...

PUT   https://api.3seventy.com/api/v2.1/account/{accountId}/contact/{contactId}/subscription/{subscriptionId}?overrideSubscription={overrideSubscription}

Description

Updates a specific optin for a contact. Contacts are sent a handset verification message.

Path Parameters

accountId integer The account ID which owns the contact required
contactId integer The contact who's subscription is being adjusted required
subscriptionId integer The ID of the subscription to adjust required

Query Strings

overrideSubscription boolean This will override optout to optin optional

Request Properties application/json

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 = XXXX;

var context = new T70Context();

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

var item = contactSubRepo.Get(subscriptionId);

item.SmsEnabled = false;

contactSubRepo.Update(item);

}

}