89 lines
3.1 KiB
Plaintext
89 lines
3.1 KiB
Plaintext
<div>
|
|
<%= render 'response' %>
|
|
<h2 id="create">Create a Channel</h2>
|
|
</div>
|
|
|
|
<br>
|
|
To create a new Channel, send an HTTP POST to <code><%= @ssl_api_domain %>channels<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> .
|
|
|
|
<br><br>
|
|
Valid parameters:
|
|
<ul>
|
|
<li><b>api_key</b> (string) - User's API Key; please note that this is different than a Channel API key, and can be found in <a href="/account">your account details</a>. (required).</li>
|
|
<li><b>description</b> (string) - Description of the Channel (optional)</li>
|
|
<li><b>elevation</b> (integer) - Elevation in meters (optional)</li>
|
|
<li><b>field1</b> (string) - Field1 name (optional)</li>
|
|
<li><b>field2</b> (string) - Field2 name (optional)</li>
|
|
<li><b>field3</b> (string) - Field3 name (optional)</li>
|
|
<li><b>field4</b> (string) - Field4 name (optional)</li>
|
|
<li><b>field5</b> (string) - Field5 name (optional)</li>
|
|
<li><b>field6</b> (string) - Field6 name (optional)</li>
|
|
<li><b>field7</b> (string) - Field7 name (optional)</li>
|
|
<li><b>field8</b> (string) - Field8 name (optional)</li>
|
|
<li><b>latitude</b> (decimal) - Latitude in degrees (optional)</li>
|
|
<li><b>longitude</b> (decimal) - Longitude in degrees (optional)</li>
|
|
<li><b>name</b> (string) - Name of the Channel (optional)</li>
|
|
<li><b>public_flag</b> (true/false) - Whether the Channel should be public, default false (optional)</li>
|
|
<li><b>tags</b> (string) - Comma-separated list of tags (optional)</li>
|
|
<li><b>url</b> (string) - Webpage URL for the Channel (optional)</li>
|
|
</ul>
|
|
|
|
<br>
|
|
Example POST:
|
|
|
|
<pre>
|
|
POST <span class="str"><%= @ssl_api_domain %>channels<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span>
|
|
api_key=<span class="customcode"><%= @user_api_key %></span>
|
|
name=<span class="customcode">My New Channel</span>
|
|
</pre>
|
|
|
|
<br>
|
|
|
|
<div class="format format-block-xl format-text">
|
|
The response will be a webpage with your newly created Channel.
|
|
</div>
|
|
|
|
<div class="format format-block-xl format-json">
|
|
The response will be a JSON object of the new channel, for example:
|
|
|
|
<pre class="prettyprint">
|
|
{
|
|
"id": 4,
|
|
"name": "My New Channel",
|
|
"description": null,
|
|
"latitude": null,
|
|
"longitude": null,
|
|
"created_at": "2014-03-25T13:12:50-04:00",
|
|
"elevation": null,
|
|
"last_entry_id": null,
|
|
"ranking": 15,
|
|
"username": "hans",
|
|
"tags": []
|
|
}
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<div class="format format-block-xl format-xml">
|
|
The response will be an XML object of the new channel, for example:
|
|
|
|
<pre class="prettyprint">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<channel>
|
|
<id type="integer">4</id>
|
|
<name>My New Channel</name>
|
|
<description nil="true" />
|
|
<latitude type="decimal" nil="true" />
|
|
<longitude type="decimal" nil="true" />
|
|
<created-at type="dateTime">2014-03-25T20:17:44-04:00</created-at>
|
|
<elevation nil="true" />
|
|
<last-entry-id type="integer" nil="true" />
|
|
<ranking type="integer">15</ranking>
|
|
<username>hans</username>
|
|
<tags type="array" />
|
|
</channel>
|
|
</pre>
|
|
|
|
</div>
|
|
|