forked from formbricks/formbricks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API documentation for Surveys & Profile Management API (formbrick…
- Loading branch information
1 parent
b7877b2
commit 529166d
Showing
5 changed files
with
248 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
import { Fence } from "@/components/shared/Fence"; | ||
|
||
export const meta = { | ||
title: "Surveys API", | ||
description: | ||
"Explore the Formbricks Public Client API for client-side tasks and integration into your website.", | ||
}; | ||
|
||
#### Management API | ||
|
||
# Surveys API | ||
|
||
The Survey API currently has one endpoint that allows you to get all the surveys you have in your Formbricks environment. You will need the [API Key](/docs/api/api-key-setup) to access the same! | ||
|
||
--- | ||
|
||
## List all surveys {{ tag: 'GET', label: '/api/v1/surveys' }} | ||
|
||
<Row> | ||
<Col> | ||
|
||
Retrieve all the surveys you have for the environment. | ||
|
||
### Mandatory Headers | ||
|
||
<Properties> | ||
<Property name="x-Api-Key" type="string"> | ||
Your Formbricks API key. | ||
</Property> | ||
</Properties> | ||
|
||
</Col> | ||
<Col sticky> | ||
|
||
<CodeGroup title="Request" tag="GET" label="/api/v1/surveys"> | ||
|
||
```bash {{ title: 'cURL' }} | ||
curl --location \ | ||
'https://app.formbricks.com/api/v1/surveys' \ | ||
--header \ | ||
'x-api-key: <your-api-key>' | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
<CodeGroup title="Response"> | ||
|
||
```json {{title:'200 Success'}} | ||
{ | ||
"data": [ | ||
{ | ||
"id": "cllnfy2780fromy0hy7uoxvtn", | ||
"createdAt": "2023-08-23T07:56:20.516Z", | ||
"updatedAt": "2023-08-23T07:56:26.947Z", | ||
"name": "Product Market Fit (Superhuman)", | ||
"type": "link", | ||
"environmentId": "cll2m30r70004mx0huqkitgqv", | ||
"status": "inProgress", | ||
"attributeFilters": [], | ||
"displayOption": "displayOnce", | ||
"autoClose": null, | ||
"triggers": [], | ||
"redirectUrl": null, | ||
"recontactDays": null, | ||
"questions": [ | ||
{ | ||
"id": "gml6mgy71efgtq8np3s9je5p", | ||
"type": "cta", | ||
"headline": "You are one of our power users! Do you have 5 minutes?", | ||
"required": false, | ||
"buttonLabel": "Happy to help!", | ||
"logic": [ | ||
{ | ||
"condition": "skipped", | ||
"destination": "end" | ||
} | ||
], | ||
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We would love to understand your user experience better. Sharing your insight helps a lot!</span></p>", | ||
"buttonExternal": false, | ||
"dismissButtonLabel": "No, thanks." | ||
}, | ||
{ | ||
"id": "kp62fbqe8cfzmvy8qwpr81b2", | ||
"type": "multipleChoiceSingle", | ||
"headline": "How disappointed would you be if you could no longer use My Product?", | ||
"subheader": "Please select one of the following options:", | ||
"required": true, | ||
"choices": [ | ||
{ | ||
"id": "bdgy1hnwd7uwmfxk1ljqp1n5", | ||
"label": "Not at all disappointed" | ||
}, | ||
{ | ||
"id": "poabnvgtwenp8rb2v70gj4hj", | ||
"label": "Somewhat disappointed" | ||
}, | ||
{ | ||
"id": "opfiqyqz8wrqn0i0f7t24d3n", | ||
"label": "Very disappointed" | ||
} | ||
], | ||
"shuffleOption": "none" | ||
}, | ||
{ | ||
"id": "klvpwd4x08x8quesihvw5l92", | ||
"type": "multipleChoiceSingle", | ||
"headline": "What is your role?", | ||
"subheader": "Please select one of the following options:", | ||
"required": true, | ||
"choices": [ | ||
{ | ||
"id": "c8nerw6l9gpsxcmqkn10f9hy", | ||
"label": "Founder" | ||
}, | ||
{ | ||
"id": "ebjqezei6a2axtuq86cleetn", | ||
"label": "Executive" | ||
}, | ||
{ | ||
"id": "ctiijjblyhlp22snypfamqt1", | ||
"label": "Product Manager" | ||
}, | ||
{ | ||
"id": "ibalyr0mhemfkkr82vypmg40", | ||
"label": "Product Owner" | ||
}, | ||
{ | ||
"id": "fipk606aegslbd0e7yhc0xjx", | ||
"label": "Software Engineer" | ||
} | ||
], | ||
"shuffleOption": "none" | ||
}, | ||
{ | ||
"id": "ryo75306flyg72iaeditbv51", | ||
"type": "openText", | ||
"headline": "What type of people do you think would most benefit from My Product?", | ||
"required": true | ||
}, | ||
{ | ||
"id": "lkjaxb73ulydzeumhd51sx9g", | ||
"type": "openText", | ||
"headline": "What is the main benefit your receive from My Product?", | ||
"required": true | ||
}, | ||
{ | ||
"id": "ec7agikkr58j8uonhioinkyk", | ||
"type": "openText", | ||
"headline": "How can we improve My Product for you?", | ||
"subheader": "Please be as specific as possible.", | ||
"required": true | ||
} | ||
], | ||
"thankYouCard": { | ||
"enabled": true, | ||
"headline": "Thank you!", | ||
"subheader": "We appreciate your feedback." | ||
}, | ||
"delay": 0, | ||
"autoComplete": null, | ||
"closeOnDate": null | ||
} | ||
] | ||
} | ||
``` | ||
```json {{ title: '401 Not Authenticated' }} | ||
{ | ||
"code": "not_authenticated", | ||
"message": "Not authenticated", | ||
"details": { | ||
"x-Api-Key": "Header not provided or API Key invalid" | ||
} | ||
} | ||
``` | ||
</CodeGroup> | ||
|
||
</Col> | ||
</Row> | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters