Subscribe a single recipient to a specific topic.
Put
/API/Rest/Subscriptions/Subscribe
CreateEditMember
No Permission
Recipient is not in the database.
Invalid topic
Too many API calls
Recipient is already subscribed
Database error
Unknown error
"Recipient subscribed" or "Recipient resubscribed"
Subscribe a recipient.
using System;
using System.Net.Http;
string url = "https://example.com/API/Rest/Subscriptions/Subscribe?accountName=acme&login=ApiUser&emailAddress=joe@example.com&topic=Weekly%20Specials";
// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Put, url))
{
request.Headers.Add("Password", "YOUR_PASSWORD");
using (HttpResponseMessage response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
# encoding: utf-8
require 'rest-client'
require 'json'
url = 'https://example.com/API/Rest/Subscriptions/Subscribe?accountName=acme&login=ApiUser&emailAddress=joe@aol.com&topic=Weekly%20Specials'
response = RestClient.put(url, "", {:Password => "YOUR_PASSWORD"})
puts response
import requests
url = "https://example.com/API/Rest/Subscriptions/Subscribe?accountName=acme&login=ApiUser&emailAddress=joe@aol.com&topic=Weekly%20Specials"
headers = {'password':'YOUR_PASSWORD'}
resp = requests.put(url, headers=headers)
if resp.status_code == 200:
print(resp.text)
curl --request PUT --header "Password: YOUR_PASSWORD" "https://example.com/API/Rest/Subscriptions/Subscribe?accountName=acme&login=ApiUser&emailAddress=joe@example.com&topic=Weekly%20Specials"