User Details API
curl --request GET \
--url https://api.pazy.io/v1.0/user/:idimport requests
url = "https://api.pazy.io/v1.0/user/:id"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/user/:id', 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.pazy.io/v1.0/user/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.pazy.io/v1.0/user/:id"
req, _ := http.NewRequest("GET", url, nil)
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.pazy.io/v1.0/user/:id")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/user/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyUser APIs
User Details API
Retrieve user details for a specific its identifier
User Details API
curl --request GET \
--url https://api.pazy.io/v1.0/user/:idimport requests
url = "https://api.pazy.io/v1.0/user/:id"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/user/:id', 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.pazy.io/v1.0/user/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.pazy.io/v1.0/user/:id"
req, _ := http.NewRequest("GET", url, nil)
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.pazy.io/v1.0/user/:id")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/user/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All requests require an API key in the request headers. Headers:Authorization: Api-Key YOUR_API_KEY
Request
Content-Type:application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the User to retrieve. If you pass ‘me’ as param, it gives your details |
Code Examples
curl -X GET https://api.pazy.io/v1.0/user/<userId> \
-H "Authorization: Api-Key YOUR_API_KEY"
const response = await fetch("https://api.pazy.io/v1.0/user/<userId>", {
method: "GET",
headers: {
Authorization: "Api-Key YOUR_API_KEY",
},
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/user/<userId>"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
result = response.json()
Success Response
HTTP Status:200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the user response data |
data.id | string | Unique identifier for the user |
data.name | string | Name of the user |
data.email | string | Email address of the user |
data.role | string | Role of the user in the organization e.g. ADMIN, MEMBER |
data.organization | object | Information about the user’s organization |
data.organization.id | string | Unique identifier for the organization |
data.organization.name | string | Name of the organization |
Response Example
{
"ok": true,
"data": {
"id": "<userId>",
"name": "John Doe",
"email": "johndoe@pazy.io",
"role": "ADMIN",
"organization": {
"id": "<orgId>",
"name": "JOHN DOE ORG PRIVATE LIMITED"
}
}
}
Error Responses
Missing User ID
HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "MISSING_REQUIRED_FIELD",
"message": "User ID is required"
}
}
User Not Found
HTTP Status:404 Not Found
{
"ok": false,
"error": {
"code": "USER_NOT_FOUND",
"message": "User not found"
}
}
Access Denied
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "ACCESS_DENIED",
"message": "Access denied: You can only view your own users or users where you are the user owner"
}
}
Authentication Errors
HTTP Status:401 Unauthorized
{
"ok": false,
"error": {
"code": "MISSING_CREDENTIALS",
"message": "Missing Credentials"
}
}
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API Key"
}
}
Permission Errors
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Permission check failed - PERMISSION_CHECK_FAILED"
}
}
Best Practices
Access Control
- Only your data you can view. You can view all users data, only if you are ‘admin’.
Was this page helpful?