placeholder-data-sdk
v1.0.2
Published
All URIs are relative to *https://jsonplaceholder.typicode.com*
Downloads
273
Readme
DefaultApi
All URIs are relative to https://jsonplaceholder.typicode.com
| Method | HTTP request | Description | | ----------------------------- | ------------------- | -------------- | | usersGet | GET /users | Get all users | | usersIdGet | GET /users/{id} | Get user by ID |
usersGet
Array usersGet()
Example
import { DefaultApi, Configuration } from "placeholder-data-sdk";
const configuration = new Configuration();
const apiInstance = new DefaultApi(configuration);
const { status, data } = await apiInstance.usersGet();Parameters
This endpoint does not have any parameters.
Return type
Array
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | | ----------- | ---------------- | ---------------- | | 200 | User's list | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
usersIdGet
User usersIdGet()
Example
import { DefaultApi, Configuration } from "placeholder-data-sdk";
const configuration = new Configuration();
const apiInstance = new DefaultApi(configuration);
let id: number; // (default to undefined)
const { status, data } = await apiInstance.usersIdGet(id);Parameters
| Name | Type | Description | Notes | | ------ | ------------ | ----------- | --------------------- | | id | [number] | | defaults to undefined |
Return type
User
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | | ----------- | ----------- | ---------------- | | 200 | User object | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User
Properties
| Name | Type | Description | Notes | | ------------ | --------------------------------- | ----------- | --------------------------------- | | id | number | | [optional] [default to undefined] | | name | string | | [optional] [default to undefined] | | username | string | | [optional] [default to undefined] | | email | string | | [optional] [default to undefined] | | phone | string | | [optional] [default to undefined] | | website | string | | [optional] [default to undefined] | | company | UserCompany | | [optional] [default to undefined] | | address | UserAddress | | [optional] [default to undefined] |
Example
import { User } from "placeholder-data-sdk";
const instance: User = {
id,
name,
username,
email,
phone,
website,
company,
address,
};[Back to Model list] [Back to API list] [Back to README]
UserAddress
Properties
| Name | Type | Description | Notes | | ----------- | --------------------------------------- | ----------- | --------------------------------- | | street | string | | [optional] [default to undefined] | | suite | string | | [optional] [default to undefined] | | city | string | | [optional] [default to undefined] | | zipcode | string | | [optional] [default to undefined] | | geo | UserAddressGeo | | [optional] [default to undefined] |
Example
import { UserAddress } from "placeholder-data-sdk";
const instance: UserAddress = {
street,
suite,
city,
zipcode,
geo,
};[Back to Model list] [Back to API list] [Back to README]
UserAddressGeo
Properties
| Name | Type | Description | Notes | | ------- | ---------- | ----------- | --------------------------------- | | lat | string | | [optional] [default to undefined] | | lng | string | | [optional] [default to undefined] |
Example
import { UserAddressGeo } from "placeholder-data-sdk";
const instance: UserAddressGeo = {
lat,
lng,
};[Back to Model list] [Back to API list] [Back to README]
UserCompany
Properties
| Name | Type | Description | Notes | | --------------- | ---------- | ----------- | --------------------------------- | | name | string | | [optional] [default to undefined] | | catchPhrase | string | | [optional] [default to undefined] | | bs | string | | [optional] [default to undefined] |
Example
import { UserCompany } from "placeholder-data-sdk";
const instance: UserCompany = {
name,
catchPhrase,
bs,
};