Technical docs (#553)
* WIP * Working on configuration * wip * Finished docs * Self hosted comparison + more links
This commit is contained in:
4
docs/api-reference/endpoint/list-forms.mdx
Normal file
4
docs/api-reference/endpoint/list-forms.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "List Forms"
|
||||
openapi: "GET /external/zapier/forms"
|
||||
---
|
||||
4
docs/api-reference/endpoint/new-submission-trigger.mdx
Normal file
4
docs/api-reference/endpoint/new-submission-trigger.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "New Submission Trigger"
|
||||
openapi: "POST /external/zapier/webhook"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Sample Submission Polling"
|
||||
openapi: "GET /external/zapier/submissions/recent"
|
||||
---
|
||||
4
docs/api-reference/endpoint/unsubscribe-webhook.mdx
Normal file
4
docs/api-reference/endpoint/unsubscribe-webhook.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Unsubscribe Webhook"
|
||||
openapi: "DELETE /external/zapier/webhook"
|
||||
---
|
||||
4
docs/api-reference/endpoint/validate-api-key.mdx
Normal file
4
docs/api-reference/endpoint/validate-api-key.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Validate API Key"
|
||||
openapi: "GET /external/zapier/validate"
|
||||
---
|
||||
BIN
docs/api-reference/images/create-token.png
Normal file
BIN
docs/api-reference/images/create-token.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 222 KiB |
37
docs/api-reference/introduction.mdx
Normal file
37
docs/api-reference/introduction.mdx
Normal 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
|
||||
```
|
||||
200
docs/api-reference/openapi.json
Normal file
200
docs/api-reference/openapi.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user