Technical docs (#553)

* WIP

* Working on configuration

* wip

* Finished docs

* Self hosted comparison + more links
This commit is contained in:
Julien Nahum
2024-09-02 15:33:17 +02:00
committed by GitHub
parent 6d4b5b8ff4
commit 4cd8b3c62e
33 changed files with 1289 additions and 242 deletions

View File

@@ -0,0 +1,4 @@
---
title: "List Forms"
openapi: "GET /external/zapier/forms"
---

View File

@@ -0,0 +1,4 @@
---
title: "New Submission Trigger"
openapi: "POST /external/zapier/webhook"
---

View File

@@ -0,0 +1,4 @@
---
title: "Sample Submission Polling"
openapi: "GET /external/zapier/submissions/recent"
---

View File

@@ -0,0 +1,4 @@
---
title: "Unsubscribe Webhook"
openapi: "DELETE /external/zapier/webhook"
---

View File

@@ -0,0 +1,4 @@
---
title: "Validate API Key"
openapi: "GET /external/zapier/validate"
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

View File

@@ -0,0 +1,37 @@
---
title: "Introduction"
description: "API Documentation for OpnForm"
---
Welcome to the OpnForm API documentation. This guide provides information on how to interact with the OpnForm API to automate your workflows and integrate OpnForm with your applications.
## Authentication
To authenticate with the OpnForm API, you need an API key. Here's how to create and use an API key.
### Creating an API Key
<Frame>
<img
src="/api-reference/images/create-token.png"
alt="Creating an API Key in OpnForm"
/>
</Frame>
1. Log in to your OpnForm account.
2. Navigate to the Access Tokens page at https://opnform.com/settings/access-tokens.
3. Click on the "Create new token" button.
4. Give your token a name (e.g., "My API Integration").
5. Click "Create" to generate your API key. 6. Copy the generated API key immediately, as it won't be displayed again for security reasons.
### Using the API Key
To use the API key, you need to include it in the header of every request you make to the API as a Bearer token. Here's how to do it:
1. Take your API key that you generated earlier.
2. Add it to the `Authorization` header of your HTTP request.
3. Prefix the key with the word "Bearer" followed by a space.
```
Authorization: Bearer YOUR_API_KEY
```

View File

@@ -0,0 +1,200 @@
{
"openapi": "3.0.1",
"info": {
"title": "OpnForm API",
"description": "API for interacting with OpnForm, primarily used for Zapier integration",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.opnform.com"
}
],
"security": [
{
"bearerAuth": []
}
],
"paths": {
"/external/zapier/validate": {
"get": {
"summary": "Validate API Key",
"description": "This endpoint is used by Zapier to test the validity of the API key.",
"responses": {
"200": {
"description": "API key is valid"
},
"401": {
"description": "Invalid API key"
}
}
}
},
"/external/zapier/forms": {
"get": {
"summary": "List Forms",
"description": "Retrieve a list of forms available in a specific workspace.",
"parameters": [
{
"name": "workspace_id",
"in": "query",
"description": "The ID of the workspace for which to list forms",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Form"
}
}
}
}
}
}
}
},
"/external/zapier/webhook": {
"post": {
"summary": "New Submission Trigger",
"description": "This endpoint is used to set up a webhook for new form submissions.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"hookUrl": {
"type": "string",
"description": "The URL provided by Zapier to send the submission data"
},
"form_id": {
"type": "string",
"description": "The ID of the form for which to trigger the webhook"
}
},
"required": ["hookUrl", "form_id"]
}
}
}
},
"responses": {
"200": {
"description": "Webhook successfully set up"
}
}
},
"delete": {
"summary": "Unsubscribe Webhook",
"description": "This endpoint is used to unsubscribe from the webhook.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"hookUrl": {
"type": "string",
"description": "The URL provided by Zapier to stop sending the submission data"
},
"form_id": {
"type": "string",
"description": "The ID of the form for which to unsubscribe the webhook"
}
},
"required": ["hookUrl", "form_id"]
}
}
}
},
"responses": {
"200": {
"description": "Webhook successfully unsubscribed"
}
}
}
},
"/external/zapier/submissions/recent": {
"get": {
"summary": "Sample Submission Polling",
"description": "Retrieves the most recent submissions for a specified form.",
"parameters": [
{
"name": "form_id",
"in": "query",
"description": "The ID of the form to retrieve submissions for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Submission"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"Submission": {
"type": "object",
"properties": {
"submission_id": {
"type": "string"
},
"form_id": {
"type": "string"
},
"submitted_at": {
"type": "string",
"format": "date-time"
},
"data": {
"type": "object",
"additionalProperties": true
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}