forked from sutrolabs/census-custom-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (61 loc) · 3.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html>
<head>
<title>Sample Census Custom API Endpoints</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
</head>
<body>
<h1>Sample Census Custom API Endpoints</h1>
<p>You should have the following integration endpoints available on this server.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Endpoint URL</th>
</tr>
</thead>
<tbody>
<tr>
<td>minimal</td>
<td>An endpoint that stubs every method but doesn't push data</td>
<td>{{ site.environment.URL }}/.netlify/functions/minimal</td>
</tr>
<tr>
<td>canny</td>
<td>A basic integration with canny.io that upserts users</td>
<td>{{ site.environment.URL }}/.netlify/functions/canny?census_secret=YOUR_SECRET</td>
</tr>
<tr>
<td>postgres</td>
<td>A basic integration that can write into PostgreSQL databases</td>
<td>{{ site.environment.URL }}/.netlify/functions/postgres</td>
</tr>
</tbody>
</table>
<h2>Installation & Testing Instructions</h2>
<p>These functions are currently deployed and waiting to be connected in Census.</p>
<p><strong>Note: In order to use Canny, you need to add a shared secret
for authentication (CENSUS_SECRET) as well as your Canny
API Key (CANNY_API_KEY) as environment variables</strong></p>
<ol>
<li>Login to Census at <a href="//app.getcensus.com">app.getcensus.com</a></li>
<li>Click on the <strong>Connections</strong> tab</li>
<li>Click on <strong>Add Service</strong> and select <strong>Custom API</strong></li>
<li>Paste the appropriate endpoint URL of the custom API</li>
<li>Replace YOUR_SECRET with a secret you generate and save</li>
</ol>
<h2>Notes for PostgreSQL Connection</h2>
<p>The code for a custom connector doesn't embed any credentials for accessing your
destination database. There's a few ways to provide these credentials when building
your own connectors (see our docs). In this basic setup, you should add credentials
to the environment using Netlify's
<a href="https://app.netlify.com/sites/{{ site.environment.SITE_NAME }}/settings/deploys#environment">site settings</a>
</p>
<h2>How to Debug</h2>
<p>The folks at Netlify provide an easy way to access the log of how lambda functions execute. For example,
<a href="https://app.netlify.com/sites/{{ site.environment.SITE_NAME }}/functions/minimal">this page</a>
shows the log for the minimal endpoint.
</p>
</body>
</html>