Skip to main content
POST
/
create-account
Create account
curl --request POST \
  --url http://dolphinflashcards.com/api/create-account \
  --header 'Content-Type: application/json' \
  --data '
{
  "userID": "user1",
  "displayName": "sampleName",
  "rawAccessToken": "test",
  "accessToken": "duh32*£dh",
  "idToken": "eu26bdj7s..."
}
'
import requests

url = "http://dolphinflashcards.com/api/create-account"

payload = {
"userID": "user1",
"displayName": "sampleName",
"rawAccessToken": "test",
"accessToken": "duh32*£dh",
"idToken": "eu26bdj7s..."
}
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({
userID: 'user1',
displayName: 'sampleName',
rawAccessToken: 'test',
accessToken: 'duh32*£dh',
idToken: 'eu26bdj7s...'
})
};

fetch('http://dolphinflashcards.com/api/create-account', 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-account",
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([
'userID' => 'user1',
'displayName' => 'sampleName',
'rawAccessToken' => 'test',
'accessToken' => 'duh32*£dh',
'idToken' => 'eu26bdj7s...'
]),
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-account"

payload := strings.NewReader("{\n \"userID\": \"user1\",\n \"displayName\": \"sampleName\",\n \"rawAccessToken\": \"test\",\n \"accessToken\": \"duh32*£dh\",\n \"idToken\": \"eu26bdj7s...\"\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-account")
.header("Content-Type", "application/json")
.body("{\n \"userID\": \"user1\",\n \"displayName\": \"sampleName\",\n \"rawAccessToken\": \"test\",\n \"accessToken\": \"duh32*£dh\",\n \"idToken\": \"eu26bdj7s...\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("http://dolphinflashcards.com/api/create-account")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userID\": \"user1\",\n \"displayName\": \"sampleName\",\n \"rawAccessToken\": \"test\",\n \"accessToken\": \"duh32*£dh\",\n \"idToken\": \"eu26bdj7s...\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
{
"error": "Your supplied json keys do not match the expected format..."
}

Body

application/json
userID
string
required

A unique identifier to be assigned to the new user.

Example:

"user1"

displayName
string
required

A unique name or title for the new user.

Example:

"sampleName"

rawAccessToken
string
required

The raw access token to use to authenticate the Alpha

Example:

"test"

accessToken
string
required

The hashed version of the rawAccessToken

Example:

"duh32*£dh"

idToken
string
required

The ID Token provided by firebase authentication

Example:

"eu26bdj7s..."

Response

Sign-in successful, returns a JWT token

success
boolean
Example:

true

token
string

The generated JWT token for the user

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."