Creating a new user
curl --request POST \
--url https://cashboard-f5x2.onrender.com/user/add \
--header 'Content-Type: application/json' \
--data '
{
"username": "michellemso",
"email": "michellemuthoni2@gmail.com",
"password": "Mso!254"
}
'import requests
url = "https://cashboard-f5x2.onrender.com/user/add"
payload = {
"username": "michellemso",
"email": "michellemuthoni2@gmail.com",
"password": "Mso!254"
}
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({
username: 'michellemso',
email: 'michellemuthoni2@gmail.com',
password: 'Mso!254'
})
};
fetch('https://cashboard-f5x2.onrender.com/user/add', 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://cashboard-f5x2.onrender.com/user/add",
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([
'username' => 'michellemso',
'email' => 'michellemuthoni2@gmail.com',
'password' => 'Mso!254'
]),
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://cashboard-f5x2.onrender.com/user/add"
payload := strings.NewReader("{\n \"username\": \"michellemso\",\n \"email\": \"michellemuthoni2@gmail.com\",\n \"password\": \"Mso!254\"\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://cashboard-f5x2.onrender.com/user/add")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"michellemso\",\n \"email\": \"michellemuthoni2@gmail.com\",\n \"password\": \"Mso!254\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/user/add")
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 \"username\": \"michellemso\",\n \"email\": \"michellemuthoni2@gmail.com\",\n \"password\": \"Mso!254\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "A new user has been created!"
}{
"status": "error",
"message": "User not created! Please try again"
}Users
Creating a new user
This endpoint creates a new user.
The request body can include the following properties:
- username(string) - the user’s username
- email(string) - the user’s email
- password(string) - the user’s password
- currency(string) - the user’s preferred currency
The currency property is not required and defaults to “KSH” if not provided.
The response will be a JSON object that includes details of the query. The properties include:
-
status(string) - indicates whether it was successful or not
-
message(string) - provides details
POST
/
user
/
add
Creating a new user
curl --request POST \
--url https://cashboard-f5x2.onrender.com/user/add \
--header 'Content-Type: application/json' \
--data '
{
"username": "michellemso",
"email": "michellemuthoni2@gmail.com",
"password": "Mso!254"
}
'import requests
url = "https://cashboard-f5x2.onrender.com/user/add"
payload = {
"username": "michellemso",
"email": "michellemuthoni2@gmail.com",
"password": "Mso!254"
}
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({
username: 'michellemso',
email: 'michellemuthoni2@gmail.com',
password: 'Mso!254'
})
};
fetch('https://cashboard-f5x2.onrender.com/user/add', 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://cashboard-f5x2.onrender.com/user/add",
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([
'username' => 'michellemso',
'email' => 'michellemuthoni2@gmail.com',
'password' => 'Mso!254'
]),
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://cashboard-f5x2.onrender.com/user/add"
payload := strings.NewReader("{\n \"username\": \"michellemso\",\n \"email\": \"michellemuthoni2@gmail.com\",\n \"password\": \"Mso!254\"\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://cashboard-f5x2.onrender.com/user/add")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"michellemso\",\n \"email\": \"michellemuthoni2@gmail.com\",\n \"password\": \"Mso!254\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/user/add")
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 \"username\": \"michellemso\",\n \"email\": \"michellemuthoni2@gmail.com\",\n \"password\": \"Mso!254\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "A new user has been created!"
}{
"status": "error",
"message": "User not created! Please try again"
}Body
application/json
The body is of type object.
Response
Created
The response is of type object.

