Create XP Goal
curl --request POST \
--url http://dolphinflashcards.com/api/create-xp-goal \
--header 'Content-Type: application/json' \
--data '
{
"jwtToken": "123",
"goalXP": "100",
"endDate": "30/07/2024"
}
'import requests
url = "http://dolphinflashcards.com/api/create-xp-goal"
payload = {
"jwtToken": "123",
"goalXP": "100",
"endDate": "30/07/2024"
}
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({jwtToken: '123', goalXP: '100', endDate: '30/07/2024'})
};
fetch('http://dolphinflashcards.com/api/create-xp-goal', 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 => "http://dolphinflashcards.com/api/create-xp-goal",
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([
'jwtToken' => '123',
'goalXP' => '100',
'endDate' => '30/07/2024'
]),
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 := "http://dolphinflashcards.com/api/create-xp-goal"
payload := strings.NewReader("{\n \"jwtToken\": \"123\",\n \"goalXP\": \"100\",\n \"endDate\": \"30/07/2024\"\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("http://dolphinflashcards.com/api/create-xp-goal")
.header("Content-Type", "application/json")
.body("{\n \"jwtToken\": \"123\",\n \"goalXP\": \"100\",\n \"endDate\": \"30/07/2024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://dolphinflashcards.com/api/create-xp-goal")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jwtToken\": \"123\",\n \"goalXP\": \"100\",\n \"endDate\": \"30/07/2024\"\n}"
response = http.request(request)
puts response.read_body{
"success": "Goal created successfully"
}{
"error": "Your supplied json keys do not match the expected format."
}Create xp goal
Create XP Goal
Create an experience points (XP) goal for the user. XP goals have an ID, type, title, end date, status (failed, completed, or in progress), fail date (if failed), and data storing (start date, starting XP, desired XP) properties.
POST
/
create-xp-goal
Create XP Goal
curl --request POST \
--url http://dolphinflashcards.com/api/create-xp-goal \
--header 'Content-Type: application/json' \
--data '
{
"jwtToken": "123",
"goalXP": "100",
"endDate": "30/07/2024"
}
'import requests
url = "http://dolphinflashcards.com/api/create-xp-goal"
payload = {
"jwtToken": "123",
"goalXP": "100",
"endDate": "30/07/2024"
}
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({jwtToken: '123', goalXP: '100', endDate: '30/07/2024'})
};
fetch('http://dolphinflashcards.com/api/create-xp-goal', 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 => "http://dolphinflashcards.com/api/create-xp-goal",
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([
'jwtToken' => '123',
'goalXP' => '100',
'endDate' => '30/07/2024'
]),
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 := "http://dolphinflashcards.com/api/create-xp-goal"
payload := strings.NewReader("{\n \"jwtToken\": \"123\",\n \"goalXP\": \"100\",\n \"endDate\": \"30/07/2024\"\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("http://dolphinflashcards.com/api/create-xp-goal")
.header("Content-Type", "application/json")
.body("{\n \"jwtToken\": \"123\",\n \"goalXP\": \"100\",\n \"endDate\": \"30/07/2024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://dolphinflashcards.com/api/create-xp-goal")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jwtToken\": \"123\",\n \"goalXP\": \"100\",\n \"endDate\": \"30/07/2024\"\n}"
response = http.request(request)
puts response.read_body{
"success": "Goal created successfully"
}{
"error": "Your supplied json keys do not match the expected format."
}Body
application/json
Identifies the user who is creating an XP goal.
Example:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6ImEzMmZkZDRiMTQ2Njc3NzE5YWIyMzcyODYxYmRlZDg5In0.eyJpc3MiOiJodHRwOi8vZG9scGhpbmZsYXNoY2FyZHMuY29tIiwiYXVkIjoiYXBpIiwic3ViIjoidU5RR2lIencxdk9EaExybTVDRWtaQ1ZoTU93MSIsImFjY2Vzc190b2tlbiI6IjRiZTA2NDNmLTFkOTgtNTczYi05N2NkLWNhOThhNjUzNDdkZCIsImFjY2Vzc190b2tlbl9yYXciOiJ0ZXN0IiwiaWF0IjoxNzI2Nzc0MTYzfQ.F-fxFitPQF-gGHyhGPGxE_zj_b8XJybqe4J_iYG66BC4Dqm4LTb8RpcDLyYUhRCcpphihpWGbdp"