Introduction
This documentation provides all the information you will need to work with for this API. The application is built with Laravel 9 PHP framework & is systematically versioned (SEMVER).
Base URL
https://idmapi.smartflowtech.com
Authenticating requests
To authenticate requests, include a Authorization header with the value "{YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your access_token by logging in using the Login a user using personal access token endpoint. Remember to append Bearer to the access_token
Endpoints
Login a user using personal access token
Example request:
curl --request POST \
"http://localhost:8000/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"fugit\",
\"password\": \"a\"
}"
const url = new URL(
"http://localhost:8000/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "fugit",
"password": "a"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Issue access & refresh tokens using oauth password grant type
Example request:
curl --request POST \
"http://localhost:8000/api/auth/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"cmurazik@example.net\",
\"password\": \"et\",
\"client_id\": \"sit\",
\"client_secret\": \"et\",
\"grant_type\": \"ea\",
\"username\": \"eum\"
}"
const url = new URL(
"http://localhost:8000/api/auth/token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "cmurazik@example.net",
"password": "et",
"client_id": "sit",
"client_secret": "et",
"grant_type": "ea",
"username": "eum"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Get the logged-in user
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/user" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/user"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Display a listing of the oauth client resource.
requires authentication
Can also filter/search by name, vendor or client application
Example request:
curl --request GET \
--get "http://localhost:8000/api/oauth/clients?term=ut&per_page=16" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/clients"
);
const params = {
"term": "ut",
"per_page": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Store a newly created resource in storage.
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/oauth/clients" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"quod\",
\"redirect\": \"amet\",
\"vendor_id\": 19,
\"vendor_name\": \"molestias\",
\"client_app\": \"consequatur\"
}"
const url = new URL(
"http://localhost:8000/api/oauth/clients"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "quod",
"redirect": "amet",
"vendor_id": 19,
"vendor_name": "molestias",
"client_app": "consequatur"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Display the oauth client resource.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/oauth/clients/nihil" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/clients/nihil"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Update the specified resource in storage.
requires authentication
Example request:
curl --request PUT \
"http://localhost:8000/api/oauth/clients/quas" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/clients/quas"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Delete the specified resource from storage.
requires authentication
Example request:
curl --request DELETE \
"http://localhost:8000/api/oauth/clients/commodi" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/clients/commodi"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Revoke oauth client access to the authentication server
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/oauth/revoke_client/nihil" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/revoke_client/nihil"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Show the unencrypted secret key if the user provides the correct password to the account
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/oauth/display_secret/voluptatibus" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"password\": \"ut\"
}"
const url = new URL(
"http://localhost:8000/api/oauth/display_secret/voluptatibus"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "ut"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Display a list of all oauth tokens issued to users. Can also filter/search by users' name, email, vendor & client app
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/oauth/token_access_logs" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/token_access_logs"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Get application metrics for dashboard
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/dashboard" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/dashboard"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Blacklist a users' IP address
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/oauth/blacklist_ip/16/pariatur" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/blacklist_ip/16/pariatur"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Logout a user
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/auth/logout" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/auth/logout"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Delete a token
requires authentication
Example request:
curl --request DELETE \
"http://localhost:8000/api/oauth/delete_token/vel" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/oauth/delete_token/vel"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Display a listing of vendor groups or search by name.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/cupid/groups?term=repellat&per_page=17" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/groups"
);
const params = {
"term": "repellat",
"per_page": "17",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"vendors": []
},
{
"vendors": []
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "/?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "/",
"per_page": 20,
"to": 2,
"total": 2
}
}
Received response:
Request failed with error:
Create a new vendor group
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/cupid/groups" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"rerum\",
\"description\": \"iste\",
\"active\": false
}"
const url = new URL(
"http://localhost:8000/api/cupid/groups"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "rerum",
"description": "iste",
"active": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"vendors": []
}
}
Received response:
Request failed with error:
Display a vendor group resource.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/cupid/groups/iste" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/groups/iste"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": {
"vendors": []
}
}
Received response:
Request failed with error:
Update a vendor group.
requires authentication
Example request:
curl --request PUT \
"http://localhost:8000/api/cupid/groups/14" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"dolorem\",
\"description\": \"at\",
\"active\": true
}"
const url = new URL(
"http://localhost:8000/api/cupid/groups/14"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "dolorem",
"description": "at",
"active": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"vendors": []
}
}
Received response:
Request failed with error:
Delete a vendor group
requires authentication
Example request:
curl --request DELETE \
"http://localhost:8000/api/cupid/groups/7" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/groups/7"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Display a listing of the vendors or search by name, phone number, email, address, city, state, country.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/cupid/vendors?term=perferendis&per_page=20" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/vendors"
);
const params = {
"term": "perferendis",
"per_page": "20",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
[],
[]
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "/?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "/",
"per_page": 20,
"to": 2,
"total": 2
}
}
Received response:
Request failed with error:
Create a new vendor
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/cupid/vendors" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"quia\",
\"sm_company_id\": 11,
\"address\": \"commodi\",
\"phone_number\": \"velit\",
\"email\": \"est\",
\"country\": \"deleniti\",
\"state\": \"eaque\",
\"city\": \"omnis\",
\"products_sold\": \"ratione\",
\"payment_type\": \"dicta\",
\"has_active_paga_account\": true,
\"status\": false,
\"on_loyalty_program\": false,
\"create_wallet\": true
}"
const url = new URL(
"http://localhost:8000/api/cupid/vendors"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "quia",
"sm_company_id": 11,
"address": "commodi",
"phone_number": "velit",
"email": "est",
"country": "deleniti",
"state": "eaque",
"city": "omnis",
"products_sold": "ratione",
"payment_type": "dicta",
"has_active_paga_account": true,
"status": false,
"on_loyalty_program": false,
"create_wallet": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": []
}
Received response:
Request failed with error:
Display a vendor resource.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/cupid/vendors/tempora" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/vendors/tempora"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": []
}
Received response:
Request failed with error:
Update a vendor.
requires authentication
Example request:
curl --request PUT \
"http://localhost:8000/api/cupid/vendors/12" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"mollitia\",
\"sm_company_id\": 12,
\"address\": \"blanditiis\",
\"phone_number\": \"quia\",
\"email\": \"beatae\",
\"country\": \"distinctio\",
\"state\": \"quibusdam\",
\"city\": \"et\",
\"products_sold\": \"vel\",
\"payment_type\": \"cumque\",
\"has_active_paga_account\": true,
\"status\": false,
\"on_loyalty_program\": false,
\"create_wallet\": true
}"
const url = new URL(
"http://localhost:8000/api/cupid/vendors/12"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "mollitia",
"sm_company_id": 12,
"address": "blanditiis",
"phone_number": "quia",
"email": "beatae",
"country": "distinctio",
"state": "quibusdam",
"city": "et",
"products_sold": "vel",
"payment_type": "cumque",
"has_active_paga_account": true,
"status": false,
"on_loyalty_program": false,
"create_wallet": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": []
}
Received response:
Request failed with error:
Delete a vendor
requires authentication
Example request:
curl --request DELETE \
"http://localhost:8000/api/cupid/vendors/15" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/vendors/15"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Get all the vendors(from CUPID DB)
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/cupid/get-all-vendors" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cupid/get-all-vendors"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Update user profile & password
requires authentication
Example request:
curl --request PATCH \
"http://localhost:8000/api/profile/update-profile/5" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"ipsam\",
\"email\": \"elaina.streich@example.org\",
\"username\": \"quaerat\",
\"gender\": \"Female\",
\"phone\": \"dolores\",
\"current_password\": \"aut\",
\"password\": \"quas\"
}"
const url = new URL(
"http://localhost:8000/api/profile/update-profile/5"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "ipsam",
"email": "elaina.streich@example.org",
"username": "quaerat",
"gender": "Female",
"phone": "dolores",
"current_password": "aut",
"password": "quas"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"title": "Dr.",
"name": "Prof. Tyrell Rowe III",
"email": "dstoltenberg@example.org",
"username": "zbogan",
"email_verified_at": "2023-02-19T11:22:55.000000Z",
"phone": "442-992-9696",
"avatar": "https://via.placeholder.com/640x480.png/00ffbb?text=molestias",
"is_admin": false,
"is_vendor": false,
"updated_at": "2023-02-19T11:22:55.000000Z",
"created_at": "2023-02-19T11:22:55.000000Z",
"id": 6
}
}
Received response:
Request failed with error:
Reset user password
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/reset-password?email=nesciunt" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/reset-password"
);
const params = {
"email": "nesciunt",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Register a user to SSO
Example request:
curl --request POST \
"http://localhost:8000/api/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"quisquam\",
\"name\": \"voluptas\",
\"phone\": \"omnis\",
\"email\": \"jodie.morissette@example.org\",
\"username\": \"qui\",
\"gender\": \"Female\",
\"newsletter\": true,
\"active\": false,
\"suspended\": true,
\"is_admin\": true,
\"is_vendor\": false
}"
const url = new URL(
"http://localhost:8000/api/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "quisquam",
"name": "voluptas",
"phone": "omnis",
"email": "jodie.morissette@example.org",
"username": "qui",
"gender": "Female",
"newsletter": true,
"active": false,
"suspended": true,
"is_admin": true,
"is_vendor": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
User Endpoints
Display a listing of the users or search by name, email, address, state, country.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/users?term=consequuntur&per_page=10" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/users"
);
const params = {
"term": "consequuntur",
"per_page": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"title": "Mr.",
"name": "Daija Adams",
"email": "delmer73@example.org",
"username": "tamia.larson",
"email_verified_at": "2023-02-19T11:22:55.000000Z",
"phone": "283-933-9647",
"avatar": "https://via.placeholder.com/640x480.png/00dd00?text=exercitationem",
"is_admin": false,
"is_vendor": false,
"updated_at": "2023-02-19T11:22:55.000000Z",
"created_at": "2023-02-19T11:22:55.000000Z",
"id": 7
},
{
"title": "Prof.",
"name": "Ms. Layla Cassin",
"email": "faustino19@example.com",
"username": "lindgren.sofia",
"email_verified_at": "2023-02-19T11:22:55.000000Z",
"phone": "+1-863-815-6033",
"avatar": "https://via.placeholder.com/640x480.png/009922?text=corporis",
"is_admin": false,
"is_vendor": false,
"updated_at": "2023-02-19T11:22:55.000000Z",
"created_at": "2023-02-19T11:22:55.000000Z",
"id": 8
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "/?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "/",
"per_page": 20,
"to": 2,
"total": 2
}
}
Received response:
Request failed with error:
Create a new user
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/users" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"quos\",
\"name\": \"ipsa\",
\"phone\": \"dolorem\",
\"email\": \"gus96@example.com\",
\"username\": \"ex\",
\"gender\": \"Female\",
\"newsletter\": false,
\"active\": true,
\"suspended\": true,
\"is_admin\": false,
\"is_vendor\": true
}"
const url = new URL(
"http://localhost:8000/api/users"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "quos",
"name": "ipsa",
"phone": "dolorem",
"email": "gus96@example.com",
"username": "ex",
"gender": "Female",
"newsletter": false,
"active": true,
"suspended": true,
"is_admin": false,
"is_vendor": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"title": "Prof.",
"name": "Prof. Immanuel Carter",
"email": "rosenbaum.reina@example.org",
"username": "aletha49",
"email_verified_at": "2023-02-19T11:22:55.000000Z",
"phone": "248.562.4691",
"avatar": "https://via.placeholder.com/640x480.png/004455?text=dolorem",
"is_admin": false,
"is_vendor": false,
"updated_at": "2023-02-19T11:22:55.000000Z",
"created_at": "2023-02-19T11:22:55.000000Z",
"id": 9
}
}
Received response:
Request failed with error:
Show a specified user.
requires authentication
Example request:
curl --request GET \
--get "http://localhost:8000/api/users/19" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/users/19"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": {
"title": "Prof.",
"name": "Ava Wunsch",
"email": "milo.gusikowski@example.org",
"username": "mpouros",
"email_verified_at": "2023-02-19T11:22:55.000000Z",
"phone": "(281) 829-8262",
"avatar": "https://via.placeholder.com/640x480.png/0033bb?text=qui",
"is_admin": false,
"is_vendor": false,
"updated_at": "2023-02-19T11:22:55.000000Z",
"created_at": "2023-02-19T11:22:55.000000Z",
"id": 10
}
}
Received response:
Request failed with error:
Update the specified user
requires authentication
Example request:
curl --request PUT \
"http://localhost:8000/api/users/4" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"magnam\",
\"name\": \"dolorem\",
\"phone\": \"ullam\",
\"email\": \"linda69@example.net\",
\"username\": \"rerum\",
\"gender\": \"Male\",
\"newsletter\": true,
\"active\": true,
\"suspended\": true,
\"is_admin\": false,
\"is_vendor\": true
}"
const url = new URL(
"http://localhost:8000/api/users/4"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "magnam",
"name": "dolorem",
"phone": "ullam",
"email": "linda69@example.net",
"username": "rerum",
"gender": "Male",
"newsletter": true,
"active": true,
"suspended": true,
"is_admin": false,
"is_vendor": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"title": "Prof.",
"name": "Prof. Giovanni Schumm III",
"email": "jacobs.lesley@example.net",
"username": "ghessel",
"email_verified_at": "2023-02-19T11:22:55.000000Z",
"phone": "551-985-0882",
"avatar": "https://via.placeholder.com/640x480.png/005533?text=et",
"is_admin": false,
"is_vendor": false,
"updated_at": "2023-02-19T11:22:55.000000Z",
"created_at": "2023-02-19T11:22:55.000000Z",
"id": 11
}
}
Received response:
Request failed with error:
Delete a user
requires authentication
Example request:
curl --request DELETE \
"http://localhost:8000/api/users/14" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/users/14"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Permanently delete a user
requires authentication
Example request:
curl --request DELETE \
"http://localhost:8000/api/users/f_del_user/17" \
--header "Authorization: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/users/f_del_user/17"
);
const headers = {
"Authorization": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error: