Sign in
curl --request POST \
--url http://dolphinflashcards.com/api/sign-in \
--header 'Content-Type: application/json' \
--data '
{
"userID": "user1",
"rawAccessToken": "test",
"accessToken": "duh32*£dh",
"idToken": "eu26bdj7s..."
}
'import requests
url = "http://dolphinflashcards.com/api/sign-in"
payload = {
"userID": "user1",
"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',
rawAccessToken: 'test',
accessToken: 'duh32*£dh',
idToken: 'eu26bdj7s...'
})
};
fetch('http://dolphinflashcards.com/api/sign-in', 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/sign-in",
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',
'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/sign-in"
payload := strings.NewReader("{\n \"userID\": \"user1\",\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/sign-in")
.header("Content-Type", "application/json")
.body("{\n \"userID\": \"user1\",\n \"rawAccessToken\": \"test\",\n \"accessToken\": \"duh32*£dh\",\n \"idToken\": \"eu26bdj7s...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://dolphinflashcards.com/api/sign-in")
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 \"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. The request should be in the format: {'userID': '', 'rawAccessToken': '', 'accessToken': '', 'idToken': ''}"
}{
"success": false,
"error": "User ID does not match token."
}{
"error": "JWT encoding failed due to an unexpected error"
}Sign in
Sign in
Create a new user account.
POST
/
sign-in
Sign in
curl --request POST \
--url http://dolphinflashcards.com/api/sign-in \
--header 'Content-Type: application/json' \
--data '
{
"userID": "user1",
"rawAccessToken": "test",
"accessToken": "duh32*£dh",
"idToken": "eu26bdj7s..."
}
'import requests
url = "http://dolphinflashcards.com/api/sign-in"
payload = {
"userID": "user1",
"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',
rawAccessToken: 'test',
accessToken: 'duh32*£dh',
idToken: 'eu26bdj7s...'
})
};
fetch('http://dolphinflashcards.com/api/sign-in', 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/sign-in",
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',
'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/sign-in"
payload := strings.NewReader("{\n \"userID\": \"user1\",\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/sign-in")
.header("Content-Type", "application/json")
.body("{\n \"userID\": \"user1\",\n \"rawAccessToken\": \"test\",\n \"accessToken\": \"duh32*£dh\",\n \"idToken\": \"eu26bdj7s...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://dolphinflashcards.com/api/sign-in")
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 \"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. The request should be in the format: {'userID': '', 'rawAccessToken': '', 'accessToken': '', 'idToken': ''}"
}{
"success": false,
"error": "User ID does not match token."
}{
"error": "JWT encoding failed due to an unexpected error"
}Body
application/json
A unique identifier to be assigned to the new user.
Example:
"user1"
The raw access token to use to authenticate the Alpha
Example:
"test"
The hashed version of the rawAccessToken
Example:
"duh32*£dh"
The ID Token provided by firebase authentication
Example:
"eu26bdj7s..."
⌘I