2016-05-07 11:28:24 +00:00
<ol class="breadcrumb">
2017-03-07 14:30:56 +00:00
<li><a href="/"> {{ # translate }} Home {{ / translate }} </a></li>
<li class="active"> {{ # translate }} API {{ / translate }} </li>
2016-05-07 11:28:24 +00:00
</ol>
2017-03-07 14:30:56 +00:00
<h2> {{ # translate }} API {{ / translate }} </h2>
2016-05-07 11:28:24 +00:00
<hr>
<div class="panel panel-default">
<div class="panel-body">
<div class="pull-right">
2017-03-07 14:30:56 +00:00
<form class="form-horizontal confirm-submit" {{ # if accessToken }} data-confirm-message=" {{ # translate }} Are you sure? Resetting would invalidate the currently existing token. {{ / translate }} " {{ else }} data-confirm-message=" {{ # translate }} Are you sure? {{ / translate }} " {{ / if }} method="post" action="/users/api/reset-token">
2016-05-07 11:28:24 +00:00
<input type="hidden" name="_csrf" value=" {{ csrfToken }} ">
<button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-retweet" aria-hidden="true"></span>
{{ # if accessToken }}
2017-03-07 14:30:56 +00:00
{{ # translate }} Reset Access Token {{ / translate }}
2016-05-07 11:28:24 +00:00
{{ else }}
2017-03-07 14:30:56 +00:00
{{ # translate }} Generate Access Token {{ / translate }}
2016-05-07 11:28:24 +00:00
{{ / if }}
</button>
</form>
</div>
{{ # if accessToken }}
2017-03-07 14:30:56 +00:00
{{ # translate }} Personal access token: {{ / translate }} <code> {{ accessToken }} </code>
2016-05-07 11:28:24 +00:00
{{ else }}
2017-03-07 14:30:56 +00:00
{{ # translate }} Access token not yet generated {{ / translate }}
2016-05-07 11:28:24 +00:00
{{ / if }}
</div>
</div>
2016-05-07 12:36:51 +00:00
<div class="well">
2017-03-07 14:30:56 +00:00
<h3> {{ # translate }} Notes about the API {{ / translate }} </h3>
2016-05-07 12:36:51 +00:00
<ul>
<li>
2017-03-07 14:30:56 +00:00
{{ # translate }} API response is a JSON structure with <code>error</code> and <code>data</code> properties. If the response <code>error</code> has a value set then the request failed. {{ / translate }}
2016-05-07 12:36:51 +00:00
</li>
<li>
2017-03-07 14:30:56 +00:00
{{ # translate }} You need to define proper <code>Content-Type</code> when making a request. You can either use <code>application/x-www-form-urlencoded</code> for normal form data or <code>application/json</code> for a JSON payload. Using <code>multipart/form-data</code> is not supported. {{ / translate }}
2016-05-07 12:36:51 +00:00
</li>
</ul>
</div>
2017-03-07 14:30:56 +00:00
<h3>POST /api/subscribe/:listId – {{ # translate }} Add subscription {{ / translate }} </h3>
2016-05-07 11:28:24 +00:00
<p>
2017-03-07 14:30:56 +00:00
{{ # translate }} This API call either inserts a new subscription or updates existing. Fields not included are left as is, so if you update only LAST_NAME value, then FIRST_NAME is kept untouched for an existing subscription. {{ / translate }}
2016-05-07 11:28:24 +00:00
</p>
<p>
2017-03-07 14:30:56 +00:00
<strong>GET</strong> {{ # translate }} arguments {{ / translate }}
2016-05-07 11:28:24 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>access_token</strong> – {{ # translate }} your personal access token {{ / translate }}
2016-05-07 11:28:24 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong>POST</strong> {{ # translate }} arguments {{ / translate }}
2016-05-07 11:28:24 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>EMAIL</strong> – {{ # translate }} subscriber's email address {{ / translate }} (<em> {{ # translate }} required {{ / translate }} </em>)</li>
<li><strong>FIRST_NAME</strong> – {{ # translate }} subscriber's first name {{ / translate }} </li>
<li><strong>LAST_NAME</strong> – {{ # translate }} subscriber's last name {{ / translate }} </li>
<li><strong>TIMEZONE</strong> – {{ # translate }} subscriber's timezone (eg. "Europe/Tallinn", "PST" or "UTC"). If not set defaults to "UTC" {{ / translate }} </li>
<li><strong>MERGE_TAG_VALUE</strong> – {{ # translate }} custom field value. Use yes/no for option group values (checkboxes, radios, drop downs) {{ / translate }} </li>
2016-05-12 16:21:56 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
{{ # translate }} Additional POST arguments {{ / translate }} :
2016-05-12 16:21:56 +00:00
</p>
<ul>
<li>
2017-03-07 14:30:56 +00:00
<strong>FORCE_SUBSCRIBE</strong> – {{ # translate }} set to "yes" if you want to make sure the email is marked as subscribed even if it was previously marked as unsubscribed. If the email was already unsubscribed/blocked then subscription status is not changed {{ / translate }}
2016-08-29 09:27:14 +00:00
by default.
2016-05-12 16:21:56 +00:00
</li>
<li>
2017-03-07 14:30:56 +00:00
<strong>REQUIRE_CONFIRMATION</strong> – {{ # translate }} set to "yes" if you want to send confirmation email to the subscriber before actually marking as subscribed {{ / translate }}
2016-05-12 16:21:56 +00:00
</li>
2016-05-07 11:28:24 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong> {{ # translate }} Example {{ / translate }} </strong>
2016-05-07 11:28:24 +00:00
</p>
2016-08-29 09:27:14 +00:00
<pre>curl -XPOST {{ serviceUrl }} api/subscribe/B16uVTdW?access_token= {{ accessToken }} \
2016-05-12 16:21:56 +00:00
--data 'EMAIL=test@example.com&MERGE_CHECKBOX=yes&REQUIRE_CONFIRMATION=yes'</pre>
2016-05-07 11:28:24 +00:00
2017-03-07 14:30:56 +00:00
<h3>POST /api/unsubscribe/:listId – {{ # translate }} Remove subscription {{ / translate }} </h3>
2016-05-07 11:28:24 +00:00
<p>
2017-03-07 14:30:56 +00:00
{{ # translate }} This API call marks a subscription as unsubscribed {{ / translate }}
2016-05-07 11:28:24 +00:00
</p>
<p>
2017-03-07 14:30:56 +00:00
<strong>GET</strong> {{ # translate }} arguments {{ / translate }}
2016-05-07 11:28:24 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>access_token</strong> – {{ # translate }} your personal access token {{ / translate }}
2016-05-07 11:28:24 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong>POST</strong> {{ # translate }} arguments {{ / translate }}
2016-05-07 11:28:24 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>EMAIL</strong> – {{ # translate }} subscriber's email address {{ / translate }} (<em> {{ # translate }} required {{ / translate }} </em>)
2016-05-07 11:28:24 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong> {{ # translate }} Example {{ / translate }} </strong>
2016-05-07 11:28:24 +00:00
</p>
2016-08-29 09:27:14 +00:00
<pre>curl -XPOST {{ serviceUrl }} api/unsubscribe/B16uVTdW?access_token= {{ accessToken }} \
2016-05-07 11:28:24 +00:00
--data 'EMAIL=test@example.com'</pre>
2016-06-24 11:29:07 +00:00
2017-03-07 14:30:56 +00:00
<h3>POST /api/delete/:listId – {{ # translate }} Delete subscription {{ / translate }} </h3>
2016-06-24 11:29:07 +00:00
<p>
2017-03-07 14:30:56 +00:00
{{ # translate }} This API call deletes a subscription {{ / translate }}
2016-06-24 11:29:07 +00:00
</p>
<p>
2017-03-07 14:30:56 +00:00
<strong>GET</strong> {{ # translate }} arguments {{ / translate }}
2016-06-24 11:29:07 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>access_token</strong> – {{ # translate }} your personal access token {{ / translate }}
2016-06-24 11:29:07 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong>POST</strong> {{ # translate }} arguments {{ / translate }}
2016-06-24 11:29:07 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>EMAIL</strong> – {{ # translate }} subscriber's email address {{ / translate }} (<em> {{ # translate }} required {{ / translate }} </em>)
2016-06-24 11:29:07 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong> {{ # translate }} Example {{ / translate }} </strong>
2016-06-24 11:29:07 +00:00
</p>
2016-08-29 09:27:14 +00:00
<pre>curl -XPOST {{ serviceUrl }} api/delete/B16uVTdW?access_token= {{ accessToken }} \
2016-06-24 11:29:07 +00:00
--data 'EMAIL=test@example.com'</pre>
2016-08-29 09:27:14 +00:00
2017-04-10 17:09:40 +00:00
<h3>GET /api/blacklist/get – {{ # translate }} Get list of blacklisted emails {{ / translate }} </h3>
2016-08-29 09:27:14 +00:00
<p>
2017-04-10 17:09:40 +00:00
{{ # translate }} This API call get list of blacklisted emails. {{ / translate }}
</p>
<p>
<strong>GET</strong> {{ # translate }} arguments {{ / translate }}
</p>
<ul>
<li><strong>access_token</strong> – {{ # translate }} your personal access token {{ / translate }}
<li><strong>start</strong> – {{ # translate }} Start position {{ / translate }} (<em> {{ # translate }} optional, default 0 {{ / translate }} </em>)</li>
<li><strong>limit</strong> – {{ # translate }} limit emails count in response {{ / translate }} (<em> {{ # translate }} optional, default 10000 {{ / translate }} </em>)</li>
<li><strong>search</strong> – {{ # translate }} filter by part of email {{ / translate }} (<em> {{ # translate }} optional, default '' {{ / translate }} </em>)</li>
</ul>
<p>
<strong> {{ # translate }} Example {{ / translate }} </strong>
</p>
<pre>curl -XGET ' {{ serviceUrl }} api/blacklist/get?access_token= {{ accessToken }} &limit=10&start=10&search=gmail' </pre>
<h3>POST /api/blacklist/add – {{ # translate }} Add email to blacklist {{ / translate }} </h3>
<p>
{{ # translate }} This API call either add emails to blacklist {{ / translate }}
2016-08-29 09:27:14 +00:00
</p>
<p>
2017-03-07 14:30:56 +00:00
<strong>GET</strong> {{ # translate }} arguments {{ / translate }}
2016-08-29 09:27:14 +00:00
</p>
<ul>
2017-03-07 14:30:56 +00:00
<li><strong>access_token</strong> – {{ # translate }} your personal access token {{ / translate }}
2016-08-29 09:27:14 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong>POST</strong> {{ # translate }} arguments {{ / translate }}
2016-08-29 09:27:14 +00:00
</p>
<ul>
2017-04-10 17:09:40 +00:00
<li><strong>EMAIL</strong> – {{ # translate }} email address {{ / translate }} (<em> {{ # translate }} required {{ / translate }} </em>)</li>
</ul>
<p>
<strong> {{ # translate }} Example {{ / translate }} </strong>
</p>
<pre>curl -XPOST ' {{ serviceUrl }} api/blacklist/add?access_token= {{ accessToken }} ' \
--data 'EMAIL=test@example.com&'</pre>
<h3>POST /api/blacklist/delete – {{ # translate }} Delete email from blacklist {{ / translate }} </h3>
<p>
{{ # translate }} This API call either delete emails from blacklist {{ / translate }}
</p>
<p>
<strong>GET</strong> {{ # translate }} arguments {{ / translate }}
</p>
<ul>
<li><strong>access_token</strong> – {{ # translate }} your personal access token {{ / translate }}
</ul>
<p>
<strong>POST</strong> {{ # translate }} arguments {{ / translate }}
</p>
<ul>
<li><strong>EMAIL</strong> – {{ # translate }} email address {{ / translate }} (<em> {{ # translate }} required {{ / translate }} </em>)</li>
2016-08-29 09:27:14 +00:00
</ul>
<p>
2017-03-07 14:30:56 +00:00
<strong> {{ # translate }} Example {{ / translate }} </strong>
2016-08-29 09:27:14 +00:00
</p>
2017-04-10 17:09:40 +00:00
<pre>curl -XPOST ' {{ serviceUrl }} api/blacklist/delete?access_token= {{ accessToken }} ' \
--data 'EMAIL=test@example.com&'</pre>