gophish/documentation/api/index.html

1712 lines
176 KiB
HTML
Raw Normal View History

<!DOCTYPE html><html><head><meta charset="utf-8"><title>Gophish API</title><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><style>@import url('https://fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata|Raleway:200');.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.right .hljs-comment{color:#969896}.right .css .hljs-class,.right .css .hljs-id,.right .css .hljs-pseudo,.right .hljs-attribute,.right .hljs-regexp,.right .hljs-tag,.right .hljs-variable,.right .html .hljs-doctype,.right .ruby .hljs-constant,.right .xml .hljs-doctype,.right .xml .hljs-pi,.right .xml .hljs-tag .hljs-title{color:#c66}.right .hljs-built_in,.right .hljs-constant,.right .hljs-literal,.right .hljs-number,.right .hljs-params,.right .hljs-pragma,.right .hljs-preprocessor{color:#de935f}.right .css .hljs-rule .hljs-attribute,.right .ruby .hljs-class .hljs-title{color:#f0c674}.right .hljs-header,.right .hljs-inheritance,.right .hljs-name,.right .hljs-string,.right .hljs-value,.right .ruby .hljs-symbol,.right .xml .hljs-cdata{color:#b5bd68}.right .css .hljs-hexcolor,.right .hljs-title{color:#8abeb7}.right .coffeescript .hljs-title,.right .hljs-function,.right .javascript .hljs-title,.right .perl .hljs-sub,.right .python .hljs-decorator,.right .python .hljs-title,.right .ruby .hljs-function .hljs-title,.right .ruby .hljs-title .hljs-keyword{color:#81a2be}.right .hljs-keyword,.right .javascript .hljs-function{color:#b294bb}.right .hljs{display:block;overflow-x:auto;background:#1d1f21;color:#c5c8c6;padding:.5em;-webkit-text-size-adjust:none}.right .coffeescript .javascript,.right .javascript .xml,.right .tex .hljs-formula,.right .xml .css,.right .xml .hljs-cdata,.right .xml .javascript,.right .xml .vbscript{opacity:.5}body{color:black;background:white;font:400 14px / 1.42 'Roboto',Helvetica,sans-serif}header{border-bottom:1px solid #f2f2f2;margin-bottom:12px}h1,h2,h3,h4,h5{color:black;margin:12px 0}h1 .permalink,h2 .permalink,h3 .permalink,h4 .permalink,h5 .permalink{margin-left:0;opacity:0;transition:opacity .25s ease}h1:hover .permalink,h2:hover .permalink,h3:hover .permalink,h4:hover .permalink,h5:hover .permalink{opacity:1}.triple h1 .permalink,.triple h2 .permalink,.triple h3 .permalink,.triple h4 .permalink,.triple h5 .permalink{opacity:.15}.triple h1:hover .permalink,.triple h2:hover .permalink,.triple h3:hover .permalink,.triple h4:hover .permalink,.triple h5:hover .permalink{opacity:.15}h1{font:200 36px 'Raleway',Helvetica,sans-serif;font-size:36px}h2{font:200 36px 'Raleway',Helvetica,sans-serif;font-size:30px}h3{font-size:100%;text-transform:uppercase}h5{font-size:100%;font-weight:normal}p{margin:0 0 10px}p.choices{line-height:1.6}a{color:#428bca;text-decoration:none}li p{margin:0}hr.split{border:0;height:1px;width:100%;padding-left:6px;margin:12px auto;background-image:linear-gradient(to right, rgba(0,0,0,0) 20%, rgba(0,0,0,0.2) 51.4%, rgba(255,255,255,0.2) 51.4%, rgba(255,255,255,0) 80%)}dl dt{float:left;width:130px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;fon
<p>These docs describe how to use the <a href="https://github.com/gophish/gophish">gophish</a> API.</p>
2016-01-08 01:35:15 +00:00
<div class="note">
<h2 id="header-authorization">Authorization <a class="permalink" href="#header-authorization" aria-hidden="true"></a></h2>
<p>All API requests require the use of a generated API key. You can find your API key, or generate a new one, by navigating to the /settings endpoint, or clicking the “Settings” sidebar item.</p>
<p>When making requests, simply append the <code>api_key=[API_KEY]</code> as a GET parameter to authorize yourself to the API.</p>
<pre><code class="language-http">GET /api/campaigns/?api_key=12345678901234567890123456789012</code></pre>
<p>If no API key is provided, youll receive the following response when attempting to make requests to API endpoints:</p>
<pre><code class="language-json">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"API Key not set"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre>
</div>
</div><div class="middle"><section id="campaigns" class="resource-group"><h2 class="group-heading">Campaigns <a href="#campaigns" class="permalink">&para;</a></h2><p>Campaigns object contain the resources needed for gophish to launch and track a simulated phishing campaign.</p>
2016-01-08 01:35:15 +00:00
<p>Campaigns have the following attributes:</p>
<ul>
<li>
<p><code>id</code> : 1 (number, required) - Unique identifier</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>name</code> : Example Campaign (string, required) - Title of Campaign</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>created_date</code> : 2015-1-1T01:02:03.000000Z (datetime) - Date the Campaign was created</p>
</li>
<li>
<p><code>completed_date</code> : 2015-1-1T01:02:03.000000Z (datetime) - Date the Campaign was completed</p>
</li>
<li>
<p><code>template</code> : <a href="#templates">Template</a></p>
</li>
<li>
<p><code>page</code> : <a href="#pages">Page</a> (required) - Landing page for users who click the phishing link</p>
</li>
<li>
<p><code>status</code> : Emails Sent (string) - The current status of the campaign</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>results</code> : array[Result] - List of Results for the campaign</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>timeline</code> : array[Event] - List of Events for the campaign</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>smtp</code> : <a href="#smtp">SMTP</a></p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>url</code> : <a href="http://foo.bar">http://foo.bar</a> (required, string) - The URL used in the Template sent to us
ers</p>
</li>
</ul>
<p>The results of the campaign are stored in the <code>results</code> field. Each result has the following attributes:</p>
<ul>
<li>
<p><code>id</code> : 1 (number, required) - Unique identifier</p>
</li>
<li>
<p><code>email</code> : <a href="mailto:foo@example.com">foo@example.com</a> - Email address of the target</p>
</li>
<li>
<p><code>first_name</code> : John - First name of the target</p>
</li>
<li>
<p><code>last_name</code> : Doe - Last name of the target</p>
</li>
<li>
<p><code>status</code> : Email Sent - The status of the result</p>
</li>
<li>
<p><code>ip</code> : 1.2.3.4 - The IP address that created the event (if any)</p>
</li>
<li>
<p><code>latitude</code> : 0.0000- The latitude of the IP address</p>
</li>
<li>
<p><code>longitude</code> : 0.0000 - The longitude of the IP address</p>
</li>
</ul>
<p>Each campaign also keeps a timeline of events that occur, such as clicking a link, opening an email, etc. These events each have the following attributes:</p>
<ul>
<li>
<p><code>email</code> : <a href="mailto:foo@example.com">foo@example.com</a> - Email address of the target</p>
</li>
<li>
<p><code>time</code> : 2015-1-1T01:02:03.000000Z (datetime) - The timestamp the event was created</p>
</li>
<li>
<p><code>message</code> : Campaign Created (string) - The event message</p>
</li>
</ul>
</section></div><div class="middle"><div id="campaigns-campaigns" class="resource"><h3 class="resource-heading">Campaigns <a href="#campaigns-campaigns" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/campaigns</span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
2016-01-08 01:35:15 +00:00
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Campaign"</span></span>,
"<span class="hljs-attribute">created_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">completed_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">template</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Emails Sent"</span></span>,
"<span class="hljs-attribute">results</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">first_name</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">last_name</span>": <span class="hljs-value"><span class="hljs-string">"Doe"</span></span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Email Sent"</span></span>,
"<span class="hljs-attribute">ip</span>": <span class="hljs-value"><span class="hljs-string">"1.2.3.4"</span></span>,
"<span class="hljs-attribute">latitude</span>": <span class="hljs-value"><span class="hljs-number">0</span></span>,
"<span class="hljs-attribute">longitude</span>": <span class="hljs-value"><span class="hljs-number">0</span>
</span>}
]</span>,
"<span class="hljs-attribute">timeline</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">time</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign Created"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">smtp</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">host</span>": <span class="hljs-value"><span class="hljs-string">"smtp.example.com:25"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"foo"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"bar"</span></span>,
"<span class="hljs-attribute">from_address</span>": <span class="hljs-value"><span class="hljs-string">"John Doe &lt;foo@example.com&gt;"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value"><span class="hljs-string">"http://foo.bar"</span>
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[]</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="campaigns-campaigns-get" class="action get"><h4 class="action-heading"><div class="name">Get Campaigns</div><a href="#campaigns-campaigns-get" class="method get">GET</a><code class="uri">/campaigns</code></h4><p>Get a list of campaigns.</p>
</div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/campaigns</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Campaign"</span></span>,
"<span class="hljs-attribute">created_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">completed_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">template</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">""</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Emails Sent"</span></span>,
"<span class="hljs-attribute">results</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">first_name</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">last_name</span>": <span class="hljs-value"><span class="hljs-string">"Doe"</span></span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Email Sent"</span></span>,
"<span class="hljs-attribute">ip</span>": <span class="hljs-value"><span class="hljs-string">"1.2.3.4"</span></span>,
"<span class="hljs-attribute">latitude</span>": <span class="hljs-value"><span class="hljs-number">0</span></span>,
"<span class="hljs-attribute">longitude</span>": <span class="hljs-value"><span class="hljs-number">0</span>
</span>}
]</span>,
"<span class="hljs-attribute">timeline</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">time</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign Created"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">smtp</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">host</span>": <span class="hljs-value"><span class="hljs-string">"smtp.example.com:25"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"foo"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"bar"</span></span>,
"<span class="hljs-attribute">from_address</span>": <span class="hljs-value"><span class="hljs-string">"John Doe &lt;foo@example.com&gt;"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value"><span class="hljs-string">"http://foo.bar"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Campaign"</span></span>,
"<span class="hljs-attribute">created_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">completed_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">template</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Emails Sent"</span></span>,
"<span class="hljs-attribute">results</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">first_name</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">last_name</span>": <span class="hljs-value"><span class="hljs-string">"Doe"</span></span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Email Sent"</span></span>,
"<span class="hljs-attribute">ip</span>": <span class="hljs-value"><span class="hljs-string">"1.2.3.4"</span></span>,
"<span class="hljs-attribute">latitude</span>": <span class="hljs-value"><span class="hljs-number">0</span></span>,
"<span class="hljs-attribute">longitude</span>": <span class="hljs-value"><span class="hljs-number">0</span>
</span>}
]</span>,
"<span class="hljs-attribute">timeline</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">time</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign Created"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">smtp</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">host</span>": <span class="hljs-value"><span class="hljs-string">"smtp.example.com:25"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"foo"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"bar"</span></span>,
"<span class="hljs-attribute">from_address</span>": <span class="hljs-value"><span class="hljs-string">"John Doe &lt;foo@example.com&gt;"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value"><span class="hljs-string">"http://foo.bar"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Title of Campaign"</span>
</span>}</span>,
"<span class="hljs-attribute">created_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Campaign was created"</span>
</span>}</span>,
"<span class="hljs-attribute">completed_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Campaign was completed"</span>
</span>}</span>,
"<span class="hljs-attribute">template</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of template"</span>
</span>}</span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Subject of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Raw text of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The attachments sent with the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Template was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>
]
</span>}</span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The current status of the campaign"</span>
</span>}</span>,
"<span class="hljs-attribute">results</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The results of the campaign"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">timeline</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The event timeline"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">smtp</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">host</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The hostname and port for the SMTP server"</span>
</span>}</span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The username used for SMTP authentication"</span>
</span>}</span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The password used for SMTP authentication"</span>
</span>}</span>,
"<span class="hljs-attribute">from_address</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The \"From\" address to spoof"</span>
2016-01-08 01:35:15 +00:00
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"host"</span>,
<span class="hljs-string">"username"</span>,
<span class="hljs-string">"password"</span>,
<span class="hljs-string">"from_address"</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The SMTP settings used in the campaign"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The URL used in the Template sent to users"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"status"</span>,
<span class="hljs-string">"url"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="campaigns-campaigns-post" class="action post"><h4 class="action-heading"><div class="name">Create New Campaign</div><a href="#campaigns-campaigns-post" class="method post">POST</a><code class="uri">/campaigns</code></h4><p>Create a new campaign.</p>
</div></div><hr class="split"><div class="middle"><div id="campaigns-campaign" class="resource"><h3 class="resource-heading">Campaign <a href="#campaigns-campaign" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/campaigns/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Campaign"</span></span>,
"<span class="hljs-attribute">created_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">completed_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">template</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Emails Sent"</span></span>,
"<span class="hljs-attribute">results</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">first_name</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">last_name</span>": <span class="hljs-value"><span class="hljs-string">"Doe"</span></span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value"><span class="hljs-string">"Email Sent"</span></span>,
"<span class="hljs-attribute">ip</span>": <span class="hljs-value"><span class="hljs-string">"1.2.3.4"</span></span>,
"<span class="hljs-attribute">latitude</span>": <span class="hljs-value"><span class="hljs-number">0</span></span>,
"<span class="hljs-attribute">longitude</span>": <span class="hljs-value"><span class="hljs-number">0</span>
</span>}
]</span>,
"<span class="hljs-attribute">timeline</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"foo@example.com"</span></span>,
"<span class="hljs-attribute">time</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign Created"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">smtp</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">host</span>": <span class="hljs-value"><span class="hljs-string">"smtp.example.com:25"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"foo"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"bar"</span></span>,
"<span class="hljs-attribute">from_address</span>": <span class="hljs-value"><span class="hljs-string">"John Doe &lt;foo@example.com&gt;"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value"><span class="hljs-string">"http://foo.bar"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Title of Campaign"</span>
</span>}</span>,
"<span class="hljs-attribute">created_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Campaign was created"</span>
</span>}</span>,
"<span class="hljs-attribute">completed_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Campaign was completed"</span>
</span>}</span>,
"<span class="hljs-attribute">template</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of template"</span>
</span>}</span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Subject of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Raw text of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The attachments sent with the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Template was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>
]
</span>}</span>,
"<span class="hljs-attribute">page</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</span>,
"<span class="hljs-attribute">status</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The current status of the campaign"</span>
</span>}</span>,
"<span class="hljs-attribute">results</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The results of the campaign"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">timeline</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The event timeline"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">smtp</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">host</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The hostname and port for the SMTP server"</span>
</span>}</span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The username used for SMTP authentication"</span>
</span>}</span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The password used for SMTP authentication"</span>
</span>}</span>,
"<span class="hljs-attribute">from_address</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The \"From\" address to spoof"</span>
2016-01-08 01:35:15 +00:00
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"host"</span>,
<span class="hljs-string">"username"</span>,
<span class="hljs-string">"password"</span>,
<span class="hljs-string">"from_address"</span>
]</span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The SMTP settings used in the campaign"</span>
2016-01-08 01:35:15 +00:00
</span>}</span>,
"<span class="hljs-attribute">url</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The URL used in the Template sent to users"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"status"</span>,
<span class="hljs-string">"url"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="campaigns-campaign-get" class="action get"><h4 class="action-heading"><div class="name">Get Campaign</div><a href="#campaigns-campaign-get" class="method get">GET</a><code class="uri">/campaigns/{id}</code></h4><p>Get a campaign by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Campaign ID</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/campaigns/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign deleted successfully!"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">true</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Campaign not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="campaigns-campaign-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete a Campaign</div><a href="#campaigns-campaign-delete" class="method delete">DELETE</a><code class="uri">/campaigns/{id}</code></h4><p>Delete a campaign by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Campaign ID</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><section id="templates" class="resource-group"><h2 class="group-heading">Templates <a href="#templates" class="permalink">&para;</a></h2><p>Templates define what email content is sent to targets during campaigns. It contains the subject of the email as well as the HTML and text content of the email.</p>
2016-01-08 01:35:15 +00:00
<ul>
<li>
<p><code>id</code>: 1 (number, required) - Unique identifier</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>name</code>: Example Template (string, required) - Name of template</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>subject</code>: Example email template subject (string) - Subject of email sent to users</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>text</code>: <code>This is a test message!</code> (string) - Raw text of email sent to users</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>html</code>: <code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;</code> (string) - HTML of email sent to users</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>attachments</code>: array[Attachment] - The attachments sent with the email template</p>
2016-01-08 01:35:15 +00:00
</li>
<li>
<p><code>modified_date</code>: <code>2015-01-01T01:02:03.000000Z</code> (string) - Date the Template was last modified</p>
</li>
</ul>
<p>You can also attach files or payloads to the emails that you send. These are attached as a list of Attachment objects.</p>
<p>Attachments have the following attributes:</p>
<ul>
<li>
<p><code>id</code>: 1 (required, number) - Unique identifier</p>
</li>
<li>
<p><code>name</code>: Example Attachment (required) - Filename of Attachment</p>
</li>
<li>
<p><code>content</code>: Base64 encoded attachment content</p>
</li>
<li>
<p><code>type</code>: <code>text/plain</code> - MIME type of the Attachment</p>
</li>
</ul>
</section></div><div class="middle"><div id="templates-templates" class="resource"><h3 class="resource-heading">Templates <a href="#templates-templates" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/templates</span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
2016-01-08 01:35:15 +00:00
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[]</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="templates-templates-get" class="action get"><h4 class="action-heading"><div class="name">Get Templates</div><a href="#templates-templates-get" class="method get">GET</a><code class="uri">/templates</code></h4><p>Get a list of templates.</p>
</div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/templates</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of template"</span>
</span>}</span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Subject of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Raw text of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The attachments sent with the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Template was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of template"</span>
</span>}</span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Subject of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Raw text of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The attachments sent with the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Template was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="templates-templates-post" class="action post"><h4 class="action-heading"><div class="name">Create New Template</div><a href="#templates-templates-post" class="method post">POST</a><code class="uri">/templates</code></h4><p>Create a new template</p>
<div class="note">
<p><strong>Importing an Existing Email</strong></p>
<p>What better way to make pixel-perfect emails than by importing an existing email you already have sitting in your inbox?</p>
<p>Using the <a href="#import-email">Import Email</a> endpoint, you can take a raw email and import it as a template into gophish.</p>
</div>
</div></div><hr class="split"><div class="middle"><div id="templates-template" class="resource"><h3 class="resource-heading">Template <a href="#templates-template" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/templates/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Template"</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Example email template subject"</span></span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"This is a test message!"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Attachment"</span></span>,
"<span class="hljs-attribute">content</span>": <span class="hljs-value"><span class="hljs-string">"Hello, world!"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"text/plain"</span>
</span>}
]</span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of template"</span>
</span>}</span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Subject of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">text</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Raw text of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of email sent to users"</span>
</span>}</span>,
"<span class="hljs-attribute">attachments</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The attachments sent with the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Template was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Template not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="templates-template-get" class="action get"><h4 class="action-heading"><div class="name">Get Template</div><a href="#templates-template-get" class="method get">GET</a><code class="uri">/templates/{id}</code></h4><p>Get a template by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Template ID</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/templates/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Template deleted successfully!"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">true</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Template not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="templates-template-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete a Template</div><a href="#templates-template-delete" class="method delete">DELETE</a><code class="uri">/templates/{id}</code></h4><p>Delete a template by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Template ID</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><section id="groups" class="resource-group"><h2 class="group-heading">Groups <a href="#groups" class="permalink">&para;</a></h2><p>Groups contain the details for one or more users targeted in the simulated phishing campaign. Groups contain the following attributes:</p>
2016-01-08 01:35:15 +00:00
<ul>
<li>
<p><code>id</code>: 1 (required, number) - Unique identifier</p>
</li>
<li>
<p><code>name</code>: Example Group (required) - Name of the Group</p>
</li>
<li>
<p><code>modified_date</code>: <code>2015-01-01T01:02:03.000000Z</code> (string) - Date the Group was last modified</p>
</li>
<li>
<p><code>targets</code>: Attributes (array[Target]) (required) - The targets in the group</p>
2016-01-08 01:35:15 +00:00
</li>
</ul>
<p>Each target contains the following attributes:</p>
<ul>
<li>
<p><code>id</code>: 1 (required, number) - Unique identifier</p>
</li>
<li>
<p><code>first_name</code>: John - First name of Target</p>
</li>
<li>
<p><code>last_name</code>: Doe - Last name of Target</p>
</li>
<li>
<p><code>email</code>: <a href="mailto:john.doe@example.com">john.doe@example.com</a> - Email address of Target</p>
</li>
<li>
<p><code>position</code>: System Administrator - Company position of the Target</p>
</li>
</ul>
<div class="note">
<p><strong>Have A Lot of Users to Import?</strong></p>
2016-01-08 01:35:15 +00:00
<p>If you have all your targets in a CSV file, you can bulk import them into a group using the <a href="#import-group">Import CSV</a> endpoint.</p>
<p>In the future, we plan to add other importation methods to make setting up groups a breeze.</p>
</div>
</section></div><div class="middle"><div id="groups-groups" class="resource"><h3 class="resource-heading">Groups <a href="#groups-groups" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/groups</span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
2016-01-08 01:35:15 +00:00
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Group"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value"><span class="hljs-string">"array[Target]"</span>
2016-01-08 01:35:15 +00:00
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[]</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="groups-groups-get" class="action get"><h4 class="action-heading"><div class="name">Get Groups</div><a href="#groups-groups-get" class="method get">GET</a><code class="uri">/groups</code></h4><p>Get a list of groups.</p>
</div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/groups</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Group"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value"><span class="hljs-string">"array[Target]"</span>
2016-01-08 01:35:15 +00:00
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of the Group"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Group was last modified"</span>
</span>}</span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The targets in the group"</span>
2016-01-08 01:35:15 +00:00
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"targets"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Group"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value"><span class="hljs-string">"array[Target]"</span>
2016-01-08 01:35:15 +00:00
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of the Group"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Group was last modified"</span>
</span>}</span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The targets in the group"</span>
2016-01-08 01:35:15 +00:00
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"targets"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="groups-groups-post" class="action post"><h4 class="action-heading"><div class="name">Create New Group</div><a href="#groups-groups-post" class="method post">POST</a><code class="uri">/groups</code></h4><p>Create a new group</p>
</div></div><hr class="split"><div class="middle"><div id="groups-group" class="resource"><h3 class="resource-heading">Group <a href="#groups-group" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/groups/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Group"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span></span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value"><span class="hljs-string">"array[Target]"</span>
2016-01-08 01:35:15 +00:00
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of the Group"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Group was last modified"</span>
</span>}</span>,
"<span class="hljs-attribute">targets</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The targets in the group"</span>
2016-01-08 01:35:15 +00:00
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"targets"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Group not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="groups-group-get" class="action get"><h4 class="action-heading"><div class="name">Get Group</div><a href="#groups-group-get" class="method get">GET</a><code class="uri">/groups/{id}</code></h4><p>Get a group by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Group ID</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/groups/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Group deleted successfully!"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">true</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Group not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="groups-group-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete a Group</div><a href="#groups-group-delete" class="method delete">DELETE</a><code class="uri">/groups/{id}</code></h4><p>Delete a Group by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Template ID</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><section id="pages" class="resource-group"><h2 class="group-heading">Pages <a href="#pages" class="permalink">&para;</a></h2><p>Pages are the HTML page that a user lands on after clicking on a phishing link.</p>
2016-01-08 01:35:15 +00:00
<ul>
<li>
<p><code>id</code>: 1 (required, number) - Unique identifier</p>
</li>
<li>
<p><code>name</code>: Example Page (required, string) - Name of Page</p>
</li>
<li>
<p><code>html</code>: <code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;</code> (required, string) - HTML of the landing page users hit when clicking links in the email template</p>
</li>
<li>
<p><code>modified_date</code>: <code>2015-01-01T01:02:03.000000Z</code> (string) - Date the Page was last modified</p>
</li>
</ul>
<div class="note">
<p><strong>Importing a Site</strong></p>
2016-01-08 01:35:15 +00:00
<p>Let gophish do the hard work for you in importing a site. By using the <a href="#import-site">Import Site</a> endpoint, you can simply give gophish a URL and have the site imported for you.</p>
</div>
</section></div><div class="middle"><div id="pages-pages" class="resource"><h3 class="resource-heading">Pages <a href="#pages-pages" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/pages</span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
2016-01-08 01:35:15 +00:00
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[]</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="pages-pages-get" class="action get"><h4 class="action-heading"><div class="name">Get Pages</div><a href="#pages-pages-get" class="method get">GET</a><code class="uri">/pages</code></h4><p>Get a list of pages.</p>
</div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/pages</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="pages-pages-post" class="action post"><h4 class="action-heading"><div class="name">Create New Page</div><a href="#pages-pages-post" class="method post">POST</a><code class="uri">/pages</code></h4><p>Create a new page</p>
</div></div><hr class="split"><div class="middle"><div id="pages-page" class="resource"><h3 class="resource-heading">Page <a href="#pages-page" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/pages/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Page not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="pages-page-get" class="action get"><h4 class="action-heading"><div class="name">Get Page</div><a href="#pages-page-get" class="method get">GET</a><code class="uri">/pages/{id}</code></h4><p>Get a page by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Page ID</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method put">PUT</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/pages</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"Example Page"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This is a test message!&lt;/body&gt;&lt;/html&gt;"</span></span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value"><span class="hljs-string">"2015-01-01T01:02:03.000000Z"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"number"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Unique identifier"</span>
</span>}</span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Name of Page"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the landing page users hit when clicking links in the email template"</span>
</span>}</span>,
"<span class="hljs-attribute">modified_date</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Date the Page was last modified"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"html"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Page not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="pages-page-put" class="action put"><h4 class="action-heading"><div class="name">Put Page</div><a href="#pages-page-put" class="method put">PUT</a><code class="uri">/pages</code></h4><p>Modify a page by its ID.</p>
</div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/pages/<span class="hljs-attribute" title="id">1</span></span></div><div class="tabs"><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Page deleted successfully!"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">true</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Page not found"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-literal">null</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div><div class="middle"><div id="pages-page-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete a Page</div><a href="#pages-page-delete" class="method delete">DELETE</a><code class="uri">/pages/{id}</code></h4><p>Delete a page by its ID.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>id</dt><dd><code>number</code>&nbsp;<span class="required">(required)</span>&nbsp;<span class="text-muted example"><strong>Example:&nbsp;</strong><span>1</span></span><p>The Page ID</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><section id="import" class="resource-group"><h2 class="group-heading">Import <a href="#import" class="permalink">&para;</a></h2><p>Import functions facilitate the ability to import emails, groups and more using simple interfaces.</p>
</section></div><div class="middle"><div id="import-group" class="resource"><h3 class="resource-heading">Group <a href="#import-group" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/import/group</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">multipart/form-data; boundary=----BOUNDARY</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>------BOUNDARY
2016-01-08 01:35:15 +00:00
Content-Disposition: form-data; name=<span class="hljs-string">"files[]"</span>; filename=<span class="hljs-string">"filename.csv"</span>
Content-Type: application/vnd.ms-excel
[File Content]
------BOUNDARY</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>[
2016-01-08 01:35:15 +00:00
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">1</span></span>,
"<span class="hljs-attribute">first_name</span>": <span class="hljs-value"><span class="hljs-string">"John"</span></span>,
"<span class="hljs-attribute">last_name</span>": <span class="hljs-value"><span class="hljs-string">"Doe"</span></span>,
"<span class="hljs-attribute">email</span>": <span class="hljs-value"><span class="hljs-string">"john.doe@example.com"</span></span>,
"<span class="hljs-attribute">position</span>": <span class="hljs-value"><span class="hljs-string">"System Administrator"</span>
</span>}
]</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"array"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="import-group-post" class="action post"><h4 class="action-heading"><div class="name">Import a Group</div><a href="#import-group-post" class="method post">POST</a><code class="uri">/import/group</code></h4><p>This endpoint allows you to import a group from a CSV.</p>
<p>The fields expected in the CSV are as follows:</p>
<ul>
<li>
<p>First Name</p>
</li>
<li>
<p>Last Name</p>
</li>
<li>
<p>Position</p>
</li>
<li>
<p>Email</p>
</li>
<li>
<p>Company</p>
</li>
</ul>
</div></div><hr class="split"><div class="middle"><div id="import-email" class="resource"><h3 class="resource-heading">Email <a href="#import-email" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/import/email</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">text/plain</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>MIME-Version: 1.0
2016-01-08 01:35:15 +00:00
Date: Fri, 25 Dec 2015 21:22:28 -0600
Subject: Foo Bar
From: John Doe <span class="hljs-tag">&lt;<span class="hljs-title">john.doe@example.com</span>&gt;</span>
To: Jane Doe <span class="hljs-tag">&lt;<span class="hljs-title">jane.doe@example.com</span>&gt;</span>
Content-Type: multipart/alternative; boundary=14dae9473639dc6b2a0527c4945f
--14dae9473639dc6b2a0527c4945f
Content-Type: text/plain; charset=UTF-8
Foo bar
--14dae9473639dc6b2a0527c4945f
Content-Type: text/html; charset=UTF-8
<span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">dir</span>=<span class="hljs-value">"ltr"</span>&gt;</span>Foo bar<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
--14dae9473639dc6b2a0527c4945f--</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">text</span>": <span class="hljs-value"><span class="hljs-string">"Foo bar"</span></span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value"><span class="hljs-string">"\"\\u003cdiv\\u003eFoo bar\\u003c/div\\u003e\""</span></span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value"><span class="hljs-string">"Foo Bar"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">text</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The email text part"</span>
</span>}</span>,
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The email HTML part"</span>
</span>}</span>,
"<span class="hljs-attribute">subject</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The email subject"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="import-email-post" class="action post"><h4 class="action-heading"><div class="name">Import an Email</div><a href="#import-email-post" class="method post">POST</a><code class="uri">/import/email</code></h4><p>This endpoint allows you to parse and import an email in RFC 5322 format.</p>
<p>You can use this endpoint to easily import an email that you have received legitimately to re-use it for simulated phishing.</p>
</div></div><hr class="split"><div class="middle"><div id="import-site" class="resource"><h3 class="resource-heading">Site <a href="#import-site" class="permalink">&para;</a></h3></div></div><div class="right"><div class="definition"><span class="method post">POST</span>&nbsp;<span class="uri"><span class="hostname">http://localhost:3333/api</span>/import/site</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">url</span>": <span class="hljs-value"><span class="hljs-string">"http://foo.bar"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">url</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The URL to be retrieved"</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"url"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">400</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
2016-01-08 01:35:15 +00:00
"html": "<span class="hljs-tag">&lt;<span class="hljs-title">html</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">head</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">head</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">body</span>&gt;</span>This is a test message!<span class="hljs-tag">&lt;/<span class="hljs-title">body</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">html</span>&gt;</span>"
}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">html</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"HTML of the requested URL."</span>
</span>}
</span>}</span>,
"<span class="hljs-attribute">required</span>": <span class="hljs-value">[
<span class="hljs-string">"html"</span>
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">message</span>": <span class="hljs-value"><span class="hljs-string">"Error message"</span></span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value"><span class="hljs-literal">false</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">data</span>": <span class="hljs-value"><span class="hljs-string">"Any associated data"</span>
</span>}</code></pre><div style="height: 1px;"></div><h5>Schema</h5><pre><code>{
"<span class="hljs-attribute">$schema</span>": <span class="hljs-value"><span class="hljs-string">"http://json-schema.org/draft-04/schema#"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"object"</span></span>,
"<span class="hljs-attribute">properties</span>": <span class="hljs-value">{
"<span class="hljs-attribute">message</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The detailed error message"</span>
</span>}</span>,
"<span class="hljs-attribute">success</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"boolean"</span></span>,
2016-01-08 01:35:15 +00:00
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"The success status of the request"</span>
</span>}</span>,
"<span class="hljs-attribute">data</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"string"</span>
</span>}
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="import-site-post" class="action post"><h4 class="action-heading"><div class="name">Import a Site</div><a href="#import-site-post" class="method post">POST</a><code class="uri">/import/site</code></h4><p>Imports a site via the URL. This causes gophish to reach out to the site and pull down the HTML of the URL given.</p>
<p>To keep styles, images, and Javascript setup and working, gophish adds a <code>base</code> tag to the returned HTML pointing to the original site.</p>
</div></div><hr class="split"><div class="middle"><p style="text-align: center;" class="text-muted">Generated by&nbsp;<a href="https://github.com/danielgtaylor/aglio" class="aglio">aglio</a>&nbsp;on 12 Jan 2016</p></div></div></div></div><script>/* eslint-env browser */
2016-01-08 01:35:15 +00:00
/* eslint quotes: [2, "single"] */
'use strict';
/*
Determine if a string ends with another string.
*/
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
/*
Get a list of direct child elements by class name.
*/
function childrenByClass(element, name) {
var filtered = [];
for (var i = 0; i < element.children.length; i++) {
var child = element.children[i];
var classNames = child.className.split(' ');
if (classNames.indexOf(name) !== -1) {
filtered.push(child);
}
}
return filtered;
}
2016-01-08 01:35:15 +00:00
/*
Get an array [width, height] of the window.
*/
function getWindowDimensions() {
var w = window,
d = document,
e = d.documentElement,
g = d.body,
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight || e.clientHeight || g.clientHeight;
return [x, y];
}
/*
Collapse or show a request/response example.
*/
function toggleCollapseButton(event) {
var button = event.target.parentNode;
var content = button.parentNode.nextSibling;
var inner = content.children[0];
if (button.className.indexOf('collapse-button') === -1) {
// Clicked without hitting the right element?
return;
}
if (content.style.maxHeight && content.style.maxHeight !== '0px') {
// Currently showing, so let's hide it
button.className = 'collapse-button';
content.style.maxHeight = '0px';
} else {
// Currently hidden, so let's show it
button.className = 'collapse-button show';
content.style.maxHeight = inner.offsetHeight + 12 + 'px';
}
}
function toggleTabButton(event) {
var i, index;
var button = event.target;
// Get index of the current button.
var buttons = childrenByClass(button.parentNode, 'tab-button');
for (i = 0; i < buttons.length; i++) {
if (buttons[i] === button) {
index = i;
button.className = 'tab-button active';
} else {
buttons[i].className = 'tab-button';
}
}
// Hide other tabs and show this one.
var tabs = childrenByClass(button.parentNode.parentNode, 'tab');
for (i = 0; i < tabs.length; i++) {
if (i === index) {
tabs[i].style.display = 'block';
} else {
tabs[i].style.display = 'none';
}
}
}
2016-01-08 01:35:15 +00:00
/*
Collapse or show a navigation menu. It will not be hidden unless it
is currently selected or `force` has been passed.
*/
function toggleCollapseNav(event, force) {
var heading = event.target.parentNode;
var content = heading.nextSibling;
var inner = content.children[0];
if (heading.className.indexOf('heading') === -1) {
// Clicked without hitting the right element?
return;
}
if (content.style.maxHeight && content.style.maxHeight !== '0px') {
// Currently showing, so let's hide it, but only if this nav item
// is already selected. This prevents newly selected items from
// collapsing in an annoying fashion.
if (force || window.location.hash && endsWith(event.target.href, window.location.hash)) {
content.style.maxHeight = '0px';
}
} else {
// Currently hidden, so let's show it
content.style.maxHeight = inner.offsetHeight + 12 + 'px';
}
}
/*
Refresh the page after a live update from the server. This only
works in live preview mode (using the `--server` parameter).
*/
function refresh(body) {
document.querySelector('body').className = 'preload';
document.body.innerHTML = body;
// Re-initialize the page
init();
autoCollapse();
document.querySelector('body').className = '';
}
/*
Determine which navigation items should be auto-collapsed to show as many
as possible on the screen, based on the current window height. This also
collapses them.
*/
function autoCollapse() {
var windowHeight = getWindowDimensions()[1];
var itemsHeight = 64; /* Account for some padding */
var itemsArray = Array.prototype.slice.call(
document.querySelectorAll('nav .resource-group .heading'));
// Get the total height of the navigation items
itemsArray.forEach(function (item) {
itemsHeight += item.parentNode.offsetHeight;
});
// Should we auto-collapse any nav items? Try to find the smallest item
// that can be collapsed to show all items on the screen. If not possible,
// then collapse the largest item and do it again. First, sort the items
// by height from smallest to largest.
var sortedItems = itemsArray.sort(function (a, b) {
return a.parentNode.offsetHeight - b.parentNode.offsetHeight;
});
while (sortedItems.length && itemsHeight > windowHeight) {
for (var i = 0; i < sortedItems.length; i++) {
// Will collapsing this item help?
var itemHeight = sortedItems[i].nextSibling.offsetHeight;
if ((itemsHeight - itemHeight <= windowHeight) || i === sortedItems.length - 1) {
// It will, so let's collapse it, remove its content height from
// our total and then remove it from our list of candidates
// that can be collapsed.
itemsHeight -= itemHeight;
toggleCollapseNav({target: sortedItems[i].children[0]}, true);
sortedItems.splice(i, 1);
break;
}
}
}
}
/*
Initialize the interactive functionality of the page.
*/
function init() {
var i, j;
2016-01-08 01:35:15 +00:00
// Make collapse buttons clickable
var buttons = document.querySelectorAll('.collapse-button');
for (i = 0; i < buttons.length; i++) {
buttons[i].onclick = toggleCollapseButton;
// Show by default? Then toggle now.
if (buttons[i].className.indexOf('show') !== -1) {
toggleCollapseButton({target: buttons[i].children[0]});
}
}
var responseCodes = document.querySelectorAll('.example-names');
for (i = 0; i < responseCodes.length; i++) {
var tabButtons = childrenByClass(responseCodes[i], 'tab-button');
for (j = 0; j < tabButtons.length; j++) {
tabButtons[j].onclick = toggleTabButton;
// Show by default?
if (j === 0) {
toggleTabButton({target: tabButtons[j]});
}
}
}
2016-01-08 01:35:15 +00:00
// Make nav items clickable to collapse/expand their content.
var navItems = document.querySelectorAll('nav .resource-group .heading');
for (i = 0; i < navItems.length; i++) {
navItems[i].onclick = toggleCollapseNav;
// Show all by default
toggleCollapseNav({target: navItems[i].children[0]});
}
}
// Initial call to set up buttons
init();
window.onload = function () {
autoCollapse();
// Remove the `preload` class to enable animations
document.querySelector('body').className = '';
};
</script></body></html>