Create a new quest
curl --request POST \
--url https://api.engagefabric.com/projects/{projectId}/quests \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"eventType": "<string>",
"targetCount": 123,
"description": "<string>",
"filters": {},
"timeWindowSeconds": 123
}
],
"description": "<string>",
"iconUrl": "<string>",
"prerequisites": [
"<string>"
],
"rewards": [
{
"amount": 123,
"currencyCode": "<string>",
"badgeId": "<string>",
"track": "<string>"
}
],
"cooldownSeconds": 123,
"maxCompletions": 123,
"availableFrom": "<string>",
"availableUntil": "<string>",
"timeLimitSeconds": 123,
"category": "<string>",
"tags": [
"<string>"
],
"sortOrder": 123,
"metadata": {}
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/quests"
payload = {
"name": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"eventType": "<string>",
"targetCount": 123,
"description": "<string>",
"filters": {},
"timeWindowSeconds": 123
}
],
"description": "<string>",
"iconUrl": "<string>",
"prerequisites": ["<string>"],
"rewards": [
{
"amount": 123,
"currencyCode": "<string>",
"badgeId": "<string>",
"track": "<string>"
}
],
"cooldownSeconds": 123,
"maxCompletions": 123,
"availableFrom": "<string>",
"availableUntil": "<string>",
"timeLimitSeconds": 123,
"category": "<string>",
"tags": ["<string>"],
"sortOrder": 123,
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
steps: [
{
id: '<string>',
name: '<string>',
eventType: '<string>',
targetCount: 123,
description: '<string>',
filters: {},
timeWindowSeconds: 123
}
],
description: '<string>',
iconUrl: '<string>',
prerequisites: ['<string>'],
rewards: [
{amount: 123, currencyCode: '<string>', badgeId: '<string>', track: '<string>'}
],
cooldownSeconds: 123,
maxCompletions: 123,
availableFrom: '<string>',
availableUntil: '<string>',
timeLimitSeconds: 123,
category: '<string>',
tags: ['<string>'],
sortOrder: 123,
metadata: {}
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/quests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engagefabric.com/projects/{projectId}/quests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'steps' => [
[
'id' => '<string>',
'name' => '<string>',
'eventType' => '<string>',
'targetCount' => 123,
'description' => '<string>',
'filters' => [
],
'timeWindowSeconds' => 123
]
],
'description' => '<string>',
'iconUrl' => '<string>',
'prerequisites' => [
'<string>'
],
'rewards' => [
[
'amount' => 123,
'currencyCode' => '<string>',
'badgeId' => '<string>',
'track' => '<string>'
]
],
'cooldownSeconds' => 123,
'maxCompletions' => 123,
'availableFrom' => '<string>',
'availableUntil' => '<string>',
'timeLimitSeconds' => 123,
'category' => '<string>',
'tags' => [
'<string>'
],
'sortOrder' => 123,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engagefabric.com/projects/{projectId}/quests"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"eventType\": \"<string>\",\n \"targetCount\": 123,\n \"description\": \"<string>\",\n \"filters\": {},\n \"timeWindowSeconds\": 123\n }\n ],\n \"description\": \"<string>\",\n \"iconUrl\": \"<string>\",\n \"prerequisites\": [\n \"<string>\"\n ],\n \"rewards\": [\n {\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"badgeId\": \"<string>\",\n \"track\": \"<string>\"\n }\n ],\n \"cooldownSeconds\": 123,\n \"maxCompletions\": 123,\n \"availableFrom\": \"<string>\",\n \"availableUntil\": \"<string>\",\n \"timeLimitSeconds\": 123,\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sortOrder\": 123,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engagefabric.com/projects/{projectId}/quests")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"eventType\": \"<string>\",\n \"targetCount\": 123,\n \"description\": \"<string>\",\n \"filters\": {},\n \"timeWindowSeconds\": 123\n }\n ],\n \"description\": \"<string>\",\n \"iconUrl\": \"<string>\",\n \"prerequisites\": [\n \"<string>\"\n ],\n \"rewards\": [\n {\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"badgeId\": \"<string>\",\n \"track\": \"<string>\"\n }\n ],\n \"cooldownSeconds\": 123,\n \"maxCompletions\": 123,\n \"availableFrom\": \"<string>\",\n \"availableUntil\": \"<string>\",\n \"timeLimitSeconds\": 123,\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sortOrder\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/quests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"eventType\": \"<string>\",\n \"targetCount\": 123,\n \"description\": \"<string>\",\n \"filters\": {},\n \"timeWindowSeconds\": 123\n }\n ],\n \"description\": \"<string>\",\n \"iconUrl\": \"<string>\",\n \"prerequisites\": [\n \"<string>\"\n ],\n \"rewards\": [\n {\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"badgeId\": \"<string>\",\n \"track\": \"<string>\"\n }\n ],\n \"cooldownSeconds\": 123,\n \"maxCompletions\": 123,\n \"availableFrom\": \"<string>\",\n \"availableUntil\": \"<string>\",\n \"timeLimitSeconds\": 123,\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sortOrder\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyQuests
Create a new quest
POST
/
projects
/
{projectId}
/
quests
Create a new quest
curl --request POST \
--url https://api.engagefabric.com/projects/{projectId}/quests \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"eventType": "<string>",
"targetCount": 123,
"description": "<string>",
"filters": {},
"timeWindowSeconds": 123
}
],
"description": "<string>",
"iconUrl": "<string>",
"prerequisites": [
"<string>"
],
"rewards": [
{
"amount": 123,
"currencyCode": "<string>",
"badgeId": "<string>",
"track": "<string>"
}
],
"cooldownSeconds": 123,
"maxCompletions": 123,
"availableFrom": "<string>",
"availableUntil": "<string>",
"timeLimitSeconds": 123,
"category": "<string>",
"tags": [
"<string>"
],
"sortOrder": 123,
"metadata": {}
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/quests"
payload = {
"name": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"eventType": "<string>",
"targetCount": 123,
"description": "<string>",
"filters": {},
"timeWindowSeconds": 123
}
],
"description": "<string>",
"iconUrl": "<string>",
"prerequisites": ["<string>"],
"rewards": [
{
"amount": 123,
"currencyCode": "<string>",
"badgeId": "<string>",
"track": "<string>"
}
],
"cooldownSeconds": 123,
"maxCompletions": 123,
"availableFrom": "<string>",
"availableUntil": "<string>",
"timeLimitSeconds": 123,
"category": "<string>",
"tags": ["<string>"],
"sortOrder": 123,
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
steps: [
{
id: '<string>',
name: '<string>',
eventType: '<string>',
targetCount: 123,
description: '<string>',
filters: {},
timeWindowSeconds: 123
}
],
description: '<string>',
iconUrl: '<string>',
prerequisites: ['<string>'],
rewards: [
{amount: 123, currencyCode: '<string>', badgeId: '<string>', track: '<string>'}
],
cooldownSeconds: 123,
maxCompletions: 123,
availableFrom: '<string>',
availableUntil: '<string>',
timeLimitSeconds: 123,
category: '<string>',
tags: ['<string>'],
sortOrder: 123,
metadata: {}
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/quests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engagefabric.com/projects/{projectId}/quests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'steps' => [
[
'id' => '<string>',
'name' => '<string>',
'eventType' => '<string>',
'targetCount' => 123,
'description' => '<string>',
'filters' => [
],
'timeWindowSeconds' => 123
]
],
'description' => '<string>',
'iconUrl' => '<string>',
'prerequisites' => [
'<string>'
],
'rewards' => [
[
'amount' => 123,
'currencyCode' => '<string>',
'badgeId' => '<string>',
'track' => '<string>'
]
],
'cooldownSeconds' => 123,
'maxCompletions' => 123,
'availableFrom' => '<string>',
'availableUntil' => '<string>',
'timeLimitSeconds' => 123,
'category' => '<string>',
'tags' => [
'<string>'
],
'sortOrder' => 123,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engagefabric.com/projects/{projectId}/quests"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"eventType\": \"<string>\",\n \"targetCount\": 123,\n \"description\": \"<string>\",\n \"filters\": {},\n \"timeWindowSeconds\": 123\n }\n ],\n \"description\": \"<string>\",\n \"iconUrl\": \"<string>\",\n \"prerequisites\": [\n \"<string>\"\n ],\n \"rewards\": [\n {\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"badgeId\": \"<string>\",\n \"track\": \"<string>\"\n }\n ],\n \"cooldownSeconds\": 123,\n \"maxCompletions\": 123,\n \"availableFrom\": \"<string>\",\n \"availableUntil\": \"<string>\",\n \"timeLimitSeconds\": 123,\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sortOrder\": 123,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engagefabric.com/projects/{projectId}/quests")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"eventType\": \"<string>\",\n \"targetCount\": 123,\n \"description\": \"<string>\",\n \"filters\": {},\n \"timeWindowSeconds\": 123\n }\n ],\n \"description\": \"<string>\",\n \"iconUrl\": \"<string>\",\n \"prerequisites\": [\n \"<string>\"\n ],\n \"rewards\": [\n {\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"badgeId\": \"<string>\",\n \"track\": \"<string>\"\n }\n ],\n \"cooldownSeconds\": 123,\n \"maxCompletions\": 123,\n \"availableFrom\": \"<string>\",\n \"availableUntil\": \"<string>\",\n \"timeLimitSeconds\": 123,\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sortOrder\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/quests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"eventType\": \"<string>\",\n \"targetCount\": 123,\n \"description\": \"<string>\",\n \"filters\": {},\n \"timeWindowSeconds\": 123\n }\n ],\n \"description\": \"<string>\",\n \"iconUrl\": \"<string>\",\n \"prerequisites\": [\n \"<string>\"\n ],\n \"rewards\": [\n {\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"badgeId\": \"<string>\",\n \"track\": \"<string>\"\n }\n ],\n \"cooldownSeconds\": 123,\n \"maxCompletions\": 123,\n \"availableFrom\": \"<string>\",\n \"availableUntil\": \"<string>\",\n \"timeLimitSeconds\": 123,\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sortOrder\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
Body
application/json
Quest name
Quest steps
Show child attributes
Show child attributes
Quest description
Icon URL
Quest IDs required before this quest
Rewards on completion
Show child attributes
Show child attributes
How often quest can be repeated
Available options:
ONCE, DAILY, WEEKLY, MONTHLY, UNLIMITED Cooldown between completions in seconds
Maximum number of completions
When quest becomes available
When quest availability ends
Time limit to complete in seconds
Quest category
Quest tags
Display order
Custom metadata
Response
Quest created successfully
⌘I
