List Saved Passwords
curl --request GET \
--url https://api.example.com/api/password-generator/view-all-saved-passwords/ \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/api/password-generator/view-all-saved-passwords/"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/api/password-generator/view-all-saved-passwords/', 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.example.com/api/password-generator/view-all-saved-passwords/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/password-generator/view-all-saved-passwords/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/password-generator/view-all-saved-passwords/")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/password-generator/view-all-saved-passwords/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": "Missing required fields."
}
Saved Passwords
List Saved Passwords
GET
/
api
/
password-generator
/
view-all-saved-passwords
/
List Saved Passwords
curl --request GET \
--url https://api.example.com/api/password-generator/view-all-saved-passwords/ \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/api/password-generator/view-all-saved-passwords/"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/api/password-generator/view-all-saved-passwords/', 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.example.com/api/password-generator/view-all-saved-passwords/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/password-generator/view-all-saved-passwords/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/password-generator/view-all-saved-passwords/")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/password-generator/view-all-saved-passwords/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": "Missing required fields."
}
Retrieves all passwords saved by the authenticated user.
Endpoint
GET /api/password-generator/view-all-saved-passwords/
Authentication
string
required
Bearer token for authentication. User must be logged in.
Request
This endpoint does not accept any parameters. It automatically filters passwords for the authenticated user.Response
string
required
A message indicating the user whose passwords are being retrieved.
array
required
Success Response
200 OK
{
"message": "Passwords saved by the user john_doe: ",
"passwords": [
{
"id": 1,
"name_pages": "Example Website",
"url": "https://example.com",
"password_saved": "MySecureP@ss123",
"user": 1
},
{
"id": 2,
"name_pages": "Test Site",
"url": "https://test.com",
"password_saved": "AnotherP@ss456",
"user": 1
}
]
}
Error Responses
{
"error": "Missing required fields."
}
{
"error": "password does not exist after creation."
}
{
"error": "error message"
}
Example Request
curl -X GET https://api.example.com/api/password-generator/view-all-saved-passwords/ \
-H "Authorization: Bearer YOUR_TOKEN"
fetch('https://api.example.com/api/password-generator/view-all-saved-passwords/', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data.passwords));
import requests
headers = {
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.get(
'https://api.example.com/api/password-generator/view-all-saved-passwords/',
headers=headers
)
data = response.json()
print(data['passwords'])
Implementation Details
This endpoint is implemented inviews.py:64 using the view_all_saved_passwords view function. It filters the SavedPasswords model by the authenticated user and serializes the results using SavedPasswordsSerializer.⌘I
