Introduction
LaraClassifier API specification and documentation.
This documentation aims to provide all the information you need to work with our API.
Important: By default the API uses an access token set in the /.env
file with the variable APP_API_TOKEN
, whose its value
need to be added in the header of all the API requests with X-AppApiToken
as key. On the other hand, the key X-AppType
must not be added to the header... This key is only useful for the included web client and for API documentation.
Base URL
https://demo.laraclassifier.local
Authenticating requests
This API is authenticated by sending an Authorization
header with the value "Bearer {YOUR_AUTH_TOKEN}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Authentication
Log in
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/auth/login" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"login":"user@demosite.com","password":"123456","captcha_key":"quo"}'
const url = new URL(
"https://demo.laraclassifier.local/api/auth/login"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"login": "user@demosite.com",
"password": "123456",
"captcha_key": "quo"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/auth/login',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'login' => 'user@demosite.com',
'password' => '123456',
'captcha_key' => 'quo',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 3,
"name": "User Demo",
"username": null,
"created_at_formatted": "Dec 25th, 2021 at 09:58",
"photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg",
"country_code": "US",
"language_code": "en",
"user_type_id": "2",
"gender_id": "1",
"photo": "avatars\/us\/3\/e69f9a84a9246120ced00e6e1196abc7.jpg",
"about": "User Demo",
"phone": "+1980877677",
"phone_hidden": "0",
"email": "user@demosite.com",
"can_be_impersonate": null,
"disable_comments": "1",
"ip_addr": "32.130.184.40",
"provider": null,
"provider_id": null,
"email_token": null,
"phone_token": null,
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "1",
"accept_marketing_offers": "0",
"time_zone": null,
"blocked": "0",
"closed": "0",
"last_activity": "2022-02-26T01:32:15.505039Z"
},
"extra": {
"authToken": "54|dm6r1CLqL8lAUSJt658dyVoCpXhu42ptnLjpLtVa",
"tokenType": "Bearer",
"isAdmin": false
}
}
Received response:
Request failed with error:
Log out
requires authentication
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/auth/logout/19" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/auth/logout/19"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/auth/logout/19',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": "You have been logged out. See you soon.",
"result": null
}
Received response:
Request failed with error:
Forgot password
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/auth/password/email" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"login":"user@demosite.com","captcha_key":"ducimus"}'
const url = new URL(
"https://demo.laraclassifier.local/api/auth/password/email"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"login": "user@demosite.com",
"captcha_key": "ducimus"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/auth/password/email',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'login' => 'user@demosite.com',
'captcha_key' => 'ducimus',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": "We have e-mailed your password reset link!",
"result": null
}
Received response:
Request failed with error:
Reset password token
Reset password token verification
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/auth/password/token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/auth/password/token"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/auth/password/token',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (422):
{
"success": false,
"message": "The given data was invalid.",
"result": null,
"errors": {
"code": [
"The code field is required."
]
},
"error_code": 1
}
Received response:
Request failed with error:
Reset password
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/auth/password/reset" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"login":"john.doe@domain.tld","password":"js!X07$z61hLA","password_confirmation":"js!X07$z61hLA","captcha_key":"exercitationem"}'
const url = new URL(
"https://demo.laraclassifier.local/api/auth/password/reset"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"login": "john.doe@domain.tld",
"password": "js!X07$z61hLA",
"password_confirmation": "js!X07$z61hLA",
"captcha_key": "exercitationem"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/auth/password/reset',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'login' => 'john.doe@domain.tld',
'password' => 'js!X07$z61hLA',
'password_confirmation' => 'js!X07$z61hLA',
'captcha_key' => 'exercitationem',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (422):
{
"success": false,
"message": "The given data was invalid.",
"result": null,
"errors": {
"token": [
"The token field is required."
]
},
"error_code": 1
}
Received response:
Request failed with error:
Captcha
Get CAPTCHA
Calling this endpoint is mandatory if the captcha is enabled in the Admin panel. Return a JSON data with an 'img' item that contains the captcha image to show and a 'key' item that contains the generated key to send for validation.
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/captcha" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/captcha"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/captcha',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Categories
List categories
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/categories?parentId=0&embed=null&sort=-lft&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/categories"
);
let params = {
"parentId": "0",
"embed": "null",
"sort": "-lft",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/categories',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'parentId'=> '0',
'embed'=> 'null',
'sort'=> '-lft',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 1,
"parent_id": null,
"name": "Automobiles",
"slug": "automobiles",
"description": "",
"hide_description": "0",
"seo_title": "{country.name} Automobiles",
"seo_description": "{country.name} Automobiles",
"seo_keywords": "",
"picture": "app\/default\/categories\/fa-folder-default.png",
"icon_class": "fas fa-car",
"active": "1",
"lft": "1",
"rgt": "10",
"depth": "0",
"type": "classified",
"is_for_permanent": "0",
"parentClosure": null
},
{
"id": 9,
"parent_id": null,
"name": "Phones & Tablets",
"slug": "phones-and-tablets",
"description": "",
"hide_description": null,
"seo_title": "",
"seo_description": "",
"seo_keywords": "",
"picture": "app\/default\/categories\/fa-folder-default.png",
"icon_class": "fas fa-mobile-alt",
"active": "1",
"lft": "11",
"rgt": "17",
"depth": "0",
"type": "classified",
"is_for_permanent": "0",
"parentClosure": null
}
],
"links": {
"first": "http:\/\/localhost\/api\/categories?page=1",
"last": "http:\/\/localhost\/api\/categories?page=6",
"prev": null,
"next": "http:\/\/localhost\/api\/categories?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 6,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/categories?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/categories?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/categories?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/categories?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/categories?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/categories?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/categories?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/categories",
"per_page": 2,
"to": 2,
"total": 12
}
}
}
Received response:
Request failed with error:
Get category
Get category by its unique slug or ID.
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/categories/cars?parentCatSlug=automobiles" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/categories/cars"
);
let params = {
"parentCatSlug": "automobiles",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/categories/cars',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'parentCatSlug'=> 'automobiles',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 2,
"parent_id": "1",
"name": "Cars",
"slug": "cars",
"description": "",
"hide_description": null,
"seo_title": "",
"seo_description": "",
"seo_keywords": "",
"picture": "app\/default\/categories\/fa-folder-default.png",
"icon_class": "fas fa-folder",
"active": "1",
"lft": "2",
"rgt": "3",
"depth": "1",
"type": "classified",
"is_for_permanent": "0"
}
}
Received response:
Request failed with error:
List category's fields
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/categories/inventore/fields" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"language_code":"en","post_id":1}'
const url = new URL(
"https://demo.laraclassifier.local/api/categories/inventore/fields"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"language_code": "en",
"post_id": 1
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/categories/inventore/fields',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'language_code' => 'en',
'post_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Contact
Send Form
Send a message to the site owner.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/contact" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"first_name":"John","last_name":"Doe","email":"john.doe@domain.tld","message":"Nesciunt porro possimus maiores voluptatibus accusamus velit qui aspernatur.","country_code":"US","country_name":"United Sates","captcha_key":"qui"}'
const url = new URL(
"https://demo.laraclassifier.local/api/contact"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@domain.tld",
"message": "Nesciunt porro possimus maiores voluptatibus accusamus velit qui aspernatur.",
"country_code": "US",
"country_name": "United Sates",
"captcha_key": "qui"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/contact',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@domain.tld',
'message' => 'Nesciunt porro possimus maiores voluptatibus accusamus velit qui aspernatur.',
'country_code' => 'US',
'country_name' => 'United Sates',
'captcha_key' => 'qui',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Report post
Report abuse or issues
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/posts/12/report" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"report_type_id":2,"email":"john.doe@domain.tld","message":"Et sunt voluptatibus ducimus id assumenda sint.","captcha_key":"sapiente"}'
const url = new URL(
"https://demo.laraclassifier.local/api/posts/12/report"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"report_type_id": 2,
"email": "john.doe@domain.tld",
"message": "Et sunt voluptatibus ducimus id assumenda sint.",
"captcha_key": "sapiente"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/posts/12/report',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'report_type_id' => 2,
'email' => 'john.doe@domain.tld',
'message' => 'Et sunt voluptatibus ducimus id assumenda sint.',
'captcha_key' => 'sapiente',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Countries
List countries
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/countries?embed=null&sort=-name&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/countries"
);
let params = {
"embed": "null",
"sort": "-name",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/countries',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> '-name',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"code": "AL",
"name": "Albania",
"capital": "Tirana",
"continent_code": "EU",
"tld": ".al",
"currency_code": "ALL",
"phone": "355",
"languages": "sq,el",
"time_zone": "Europe\/Tirane",
"date_format": null,
"datetime_format": null,
"background_image": "app\/logo\/header-61fa587d90fd8.jpg",
"admin_type": "0",
"admin_field_active": "0",
"active": "1"
},
{
"code": "DZ",
"name": "Algeria",
"capital": "Algiers",
"continent_code": "AF",
"tld": ".dz",
"currency_code": "DZD",
"phone": "213",
"languages": "ar-DZ,fr",
"time_zone": "Africa\/Algiers",
"date_format": null,
"datetime_format": null,
"background_image": "app\/logo\/header-61fa587dcc58f.jpg",
"admin_type": "0",
"admin_field_active": "0",
"active": "1"
}
],
"links": {
"first": "http:\/\/localhost\/api\/countries?page=1",
"last": "http:\/\/localhost\/api\/countries?page=121",
"prev": null,
"next": "http:\/\/localhost\/api\/countries?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 121,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/countries?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=7",
"label": "7",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=8",
"label": "8",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=9",
"label": "9",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=120",
"label": "120",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=121",
"label": "121",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/countries",
"per_page": 2,
"to": 2,
"total": 242
}
}
}
Received response:
Request failed with error:
Get country
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/countries/DE?embed=currency" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/countries/DE"
);
let params = {
"embed": "currency",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/countries/DE',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'currency',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"code": "DE",
"name": "Germany",
"capital": "Berlin",
"continent_code": "EU",
"tld": ".de",
"currency_code": "EUR",
"phone": "49",
"languages": "de",
"time_zone": "Europe\/Berlin",
"date_format": null,
"datetime_format": null,
"background_image": "app\/logo\/header-61fa587dc7367.jpg",
"admin_type": "0",
"admin_field_active": "0",
"active": "1",
"currency": {
"code": "EUR",
"name": "Euro Member Countries",
"symbol": "€",
"html_entities": "€",
"in_left": "0",
"decimal_places": "2",
"decimal_separator": ",",
"thousand_separator": " "
}
}
}
Received response:
Request failed with error:
List admin. divisions (1)
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/countries/US/subAdmins1?embed=null&sort=-name&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/countries/US/subAdmins1"
);
let params = {
"embed": "null",
"sort": "-name",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/countries/US/subAdmins1',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> '-name',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"code": "US.AL",
"country_code": "US",
"name": "Alabama",
"active": "1"
},
{
"code": "US.AK",
"country_code": "US",
"name": "Alaska",
"active": "1"
}
],
"links": {
"first": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=1",
"last": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=26",
"prev": null,
"next": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 26,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=7",
"label": "7",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=8",
"label": "8",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=9",
"label": "9",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=25",
"label": "25",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=26",
"label": "26",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins1?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/countries\/US\/subAdmins1",
"per_page": 2,
"to": 2,
"total": 51
}
}
}
Received response:
Request failed with error:
List admin. divisions (2)
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/countries/US/subAdmins2?embed=null&sort=-name&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/countries/US/subAdmins2"
);
let params = {
"embed": "null",
"sort": "-name",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/countries/US/subAdmins2',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> '-name',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"code": "US.SC.001",
"country_code": "US",
"subadmin1_code": "US.SC",
"name": "Abbeville County",
"active": "1"
},
{
"code": "US.LA.001",
"country_code": "US",
"subadmin1_code": "US.LA",
"name": "Acadia Parish",
"active": "1"
}
],
"links": {
"first": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=1",
"last": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=1572",
"prev": null,
"next": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1572,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=7",
"label": "7",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=8",
"label": "8",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=9",
"label": "9",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=1571",
"label": "1571",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=1572",
"label": "1572",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/subAdmins2?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/countries\/US\/subAdmins2",
"per_page": 2,
"to": 2,
"total": 3143
}
}
}
Received response:
Request failed with error:
List cities
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/countries/US/cities?embed=null&sort=-name&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/countries/US/cities"
);
let params = {
"embed": "null",
"sort": "-name",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/countries/US/cities',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> '-name',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 43873,
"country_code": "US",
"name": "Abbeville",
"latitude": "34.18",
"longitude": "-82.38",
"subadmin1_code": "US.SC",
"subadmin2_code": "US.SC.001",
"population": "5191",
"time_zone": "America\/New_York",
"active": "1"
},
{
"id": 42919,
"country_code": "US",
"name": "Abbeville",
"latitude": "29.97",
"longitude": "-92.13",
"subadmin1_code": "US.LA",
"subadmin2_code": "US.LA.113",
"population": "12434",
"time_zone": "America\/Chicago",
"active": "1"
}
],
"links": {
"first": "http:\/\/localhost\/api\/countries\/US\/cities?page=1",
"last": "http:\/\/localhost\/api\/countries\/US\/cities?page=3600",
"prev": null,
"next": "http:\/\/localhost\/api\/countries\/US\/cities?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 3600,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=7",
"label": "7",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=8",
"label": "8",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=9",
"label": "9",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=3599",
"label": "3599",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=3600",
"label": "3600",
"active": false
},
{
"url": "http:\/\/localhost\/api\/countries\/US\/cities?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/countries\/US\/cities",
"per_page": 2,
"to": 2,
"total": 7200
}
}
}
Received response:
Request failed with error:
Get admin. division (1)
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/subAdmins1/CH.VD?embed=null" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/subAdmins1/CH.VD"
);
let params = {
"embed": "null",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/subAdmins1/CH.VD',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"code": "CH.VD",
"country_code": "CH",
"name": "Vaud",
"active": "1"
}
}
Received response:
Request failed with error:
Get admin. division (2)
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/subAdmins2/CH.VD.2225?embed=null" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/subAdmins2/CH.VD.2225"
);
let params = {
"embed": "null",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/subAdmins2/CH.VD.2225',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"code": "CH.VD.2225",
"country_code": "CH",
"subadmin1_code": "CH.VD",
"name": "Lausanne District",
"active": "1"
}
}
Received response:
Request failed with error:
Get city
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/cities/12544?embed=country" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/cities/12544"
);
let params = {
"embed": "country",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/cities/12544',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'country',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 12544,
"country_code": "DE",
"name": "Berlin",
"latitude": "52.52",
"longitude": "13.41",
"subadmin1_code": "DE.16",
"subadmin2_code": "DE.16.00",
"population": "3426354",
"time_zone": "Europe\/Berlin",
"active": "1",
"country": {
"code": "DE",
"name": "Germany",
"capital": "Berlin",
"continent_code": "EU",
"tld": ".de",
"currency_code": "EUR",
"phone": "49",
"languages": "de",
"time_zone": "Europe\/Berlin",
"date_format": null,
"datetime_format": null,
"background_image": "app\/logo\/header-61fa587dc7367.jpg",
"admin_type": "0",
"admin_field_active": "0",
"active": "1"
}
}
}
Received response:
Request failed with error:
Home
List sections
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/homeSections" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/homeSections"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/homeSections',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Packages
List packages
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/packages?embed=null&sort=-lft" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/packages"
);
let params = {
"embed": "null",
"sort": "-lft",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/packages',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> '-lft',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 1,
"name": "Regular List",
"short_name": "Free",
"ribbon": "red",
"has_badge": "1",
"price": "0.00",
"currency_code": "USD",
"promo_duration": null,
"duration": null,
"pictures_limit": null,
"description": "",
"facebook_ads_duration": "0",
"google_ads_duration": "0",
"twitter_ads_duration": "0",
"linkedin_ads_duration": "0",
"recommended": "0",
"active": "1",
"parent_id": null,
"lft": "2",
"rgt": "3",
"depth": "0"
},
{
"id": 2,
"name": "Top page Listing",
"short_name": "Premium",
"ribbon": "orange",
"has_badge": "1",
"price": "7.50",
"currency_code": "USD",
"promo_duration": "7",
"duration": "60",
"pictures_limit": "2",
"description": "Featured on the homepage\r\nFeatured in the category",
"facebook_ads_duration": "0",
"google_ads_duration": "0",
"twitter_ads_duration": "0",
"linkedin_ads_duration": "0",
"recommended": "1",
"active": "1",
"parent_id": null,
"lft": "4",
"rgt": "5",
"depth": "0"
},
{
"id": 3,
"name": "Top page Ad+",
"short_name": "Premium+",
"ribbon": "green",
"has_badge": "1",
"price": "9.00",
"currency_code": "USD",
"promo_duration": "30",
"duration": "120",
"pictures_limit": "8",
"description": "Featured on the homepage\r\nFeatured in the category",
"facebook_ads_duration": "0",
"google_ads_duration": "0",
"twitter_ads_duration": "0",
"linkedin_ads_duration": "0",
"recommended": "0",
"active": "1",
"parent_id": null,
"lft": "6",
"rgt": "7",
"depth": "0"
}
]
}
}
Received response:
Request failed with error:
Get package
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/packages/2?embed=currency" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/packages/2"
);
let params = {
"embed": "currency",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/packages/2',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'currency',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 2,
"name": "Top page Listing",
"short_name": "Premium",
"ribbon": "orange",
"has_badge": "1",
"price": "7.50",
"currency_code": "USD",
"promo_duration": "7",
"duration": "60",
"pictures_limit": "2",
"description": "Featured on the homepage\r\nFeatured in the category",
"facebook_ads_duration": "0",
"google_ads_duration": "0",
"twitter_ads_duration": "0",
"linkedin_ads_duration": "0",
"recommended": "1",
"active": "1",
"parent_id": null,
"lft": "4",
"rgt": "5",
"depth": "0",
"currency": {
"code": "USD",
"name": "United States Dollar",
"symbol": "$",
"html_entities": "$",
"in_left": "1",
"decimal_places": "2",
"decimal_separator": ".",
"thousand_separator": ","
}
}
}
Received response:
Request failed with error:
Pages
List pages
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/pages?excludedFromFooter=&sort=-lft&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/pages"
);
let params = {
"excludedFromFooter": "",
"sort": "-lft",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/pages',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'excludedFromFooter'=> '',
'sort'=> '-lft',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Get page
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/pages/terms" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/pages/terms"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/pages/terms',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Payment Methods
List payment methods
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/paymentMethods?countryCode=US&sort=-lft" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/paymentMethods"
);
let params = {
"countryCode": "US",
"sort": "-lft",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/paymentMethods',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'countryCode'=> 'US',
'sort'=> '-lft',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": []
}
}
Received response:
Request failed with error:
Get payment method
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/paymentMethods/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/paymentMethods/1"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/paymentMethods/1',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Entry for Models\\PaymentMethod not found",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Payments
List payments
requires authentication
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/payments?embed=null&sort=created_at&perPage=2" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/payments"
);
let params = {
"embed": "null",
"sort": "created_at",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/payments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> 'created_at',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 120,
"post_id": "97",
"package_id": "3",
"payment_method_id": "1",
"transaction_id": null,
"amount": "9.00",
"currency_code": null,
"active": "1"
},
{
"id": 22,
"post_id": "71",
"package_id": "3",
"payment_method_id": "1",
"transaction_id": null,
"amount": "9.00",
"currency_code": null,
"active": "1"
}
],
"links": {
"first": "http:\/\/localhost\/api\/payments?page=1",
"last": "http:\/\/localhost\/api\/payments?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/payments?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/payments",
"per_page": 2,
"to": 2,
"total": 2
}
}
}
Received response:
Request failed with error:
Get payment
requires authentication
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/payments/2?embed=null" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/payments/2"
);
let params = {
"embed": "null",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/payments/2',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 2,
"post_id": "8551",
"package_id": "2",
"payment_method_id": "1",
"transaction_id": null,
"amount": "7.50",
"currency_code": null,
"active": "1"
}
}
Received response:
Request failed with error:
Store payment
requires authentication
Note: This endpoint is only available for the multi steps post edition.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/payments?package=14" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"country_code":"US","post_id":2,"package_id":12,"payment_method_id":5}'
const url = new URL(
"https://demo.laraclassifier.local/api/payments"
);
let params = {
"package": "14",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"country_code": "US",
"post_id": 2,
"package_id": 12,
"payment_method_id": 5
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/payments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'package'=> '14',
],
'json' => [
'country_code' => 'US',
'post_id' => 2,
'package_id' => 12,
'payment_method_id' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Listing not found",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Pictures
Get picture
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/pictures/298?embed=null" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/pictures/298"
);
let params = {
"embed": "null",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/pictures/298',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 298,
"post_id": "107",
"filename": "files\/us\/107\/0ef55e55e21eb2b012ca30af30375b6f.jpg",
"mime_type": "image\/jpeg",
"position": "3",
"active": "1"
}
}
Received response:
Request failed with error:
Store picture
requires authentication
Note: This endpoint is only available for the multi steps post edition.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/pictures" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-F "country_code=US" \
-F "count_packages=3" \
-F "count_payment_methods=1" \
-F "post_id=2" \
-F "pictures[]=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpwDZIoT"
const url = new URL(
"https://demo.laraclassifier.local/api/pictures"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
const body = new FormData();
body.append('country_code', 'US');
body.append('count_packages', '3');
body.append('count_payment_methods', '1');
body.append('post_id', '2');
body.append('pictures[]', document.querySelector('input[name="pictures[]"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/pictures',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'multipart' => [
[
'name' => 'country_code',
'contents' => 'US'
],
[
'name' => 'count_packages',
'contents' => '3'
],
[
'name' => 'count_payment_methods',
'contents' => '1'
],
[
'name' => 'post_id',
'contents' => '2'
],
[
'name' => 'pictures[]',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpwDZIoT', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Listing not found",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Delete picture
requires authentication
Note: This endpoint is only available for the multi steps post edition. For newly created listings, the post's ID need to be added in the request input with the key 'new_post_id'. The 'new_post_id' and 'new_post_tmp_token' fields need to be removed or unset during the post edition steps.
Example request:
curl -X DELETE \
"https://demo.laraclassifier.local/api/pictures/quia" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"post_id":2}'
const url = new URL(
"https://demo.laraclassifier.local/api/pictures/quia"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"post_id": 2
}
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://demo.laraclassifier.local/api/pictures/quia',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'post_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Reorder pictures
requires authentication
Note: This endpoint is only available for the multi steps post edition.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/pictures/reorder" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-H "X-Action: bulk" \
-d '{"post_id":2,"body":"dolores"}'
const url = new URL(
"https://demo.laraclassifier.local/api/pictures/reorder"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
"X-Action": "bulk",
};
let body = {
"post_id": 2,
"body": "dolores"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/pictures/reorder',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
'X-Action' => 'bulk',
],
'json' => [
'post_id' => 2,
'body' => 'dolores',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (400):
{
"success": false,
"message": "Invalid JSON format for the \"body\" field.",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
List pictures
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/posts/id/pictures?embed=null&postId=1&latest=&sort=-position&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/id/pictures"
);
let params = {
"embed": "null",
"postId": "1",
"latest": "",
"sort": "-position",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/posts/id/pictures',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'postId'=> '1',
'latest'=> '',
'sort'=> '-position',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Posts
List listings
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/posts?embed=null&sort=created_at&perPage=2" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts"
);
let params = {
"embed": "null",
"sort": "created_at",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/posts',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> 'created_at',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 9786,
"country_code": "US",
"user_id": "1",
"category_id": "113",
"post_type_id": "2",
"title": "Post it at LaraClassifier",
"description": "<p><span style=\"color:#292b2c;font-family:Roboto, Helvetica, Arial, sans-serif;font-size:13.6px;text-align:center;background-color:#ffffff;\">Do you have something to sell, to rent, any service to offer or a job offer? Post it at LaraClassifier, its free, for local business and very easy to use!<\/span><\/p>",
"tags": [],
"price": "2000.00",
"negotiable": "1",
"contact_name": "Administrator",
"email": "admin@larapen.com",
"phone": "061228281",
"phone_hidden": null,
"address": null,
"city_id": "46448",
"lat": "40.71",
"lon": "-74.01",
"ip_addr": "::1",
"visits": "0",
"tmp_token": "71d51d06a2c07e3e4be601fb4291392b",
"email_token": null,
"phone_token": null,
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "0",
"accept_marketing_offers": "0",
"is_permanent": "0",
"reviewed": "1",
"featured": "1",
"archived": "0",
"archived_at": "2022-02-15T13:29:10.000000Z",
"deletion_mail_sent_at": null,
"fb_profile": null,
"partner": null,
"created_at": "2022-02-15T13:28:39.000000Z",
"updated_at": "2022-02-15T13:29:10.000000Z",
"slug": "post-it-at-laraclassifier",
"created_at_formatted": "Feb 15th, 2022 at 08:28",
"user_photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg"
},
{
"id": 9785,
"country_code": "US",
"user_id": "1",
"category_id": "100",
"post_type_id": "2",
"title": "Do you have something to sell",
"description": "<p><span style=\"color:#292b2c;font-family:Roboto, Helvetica, Arial, sans-serif;font-size:13.6px;text-align:center;background-color:#ffffff;\">Do you have something to sell, to rent, any service to offer or a job offer? Post it at LaraClassifier, its free, for local business and very easy to use!<\/span><\/p>",
"tags": [],
"price": "300.00",
"negotiable": "1",
"contact_name": "Administrator",
"email": "admin@larapen.com",
"phone": "061228281",
"phone_hidden": null,
"address": null,
"city_id": "48009",
"lat": "39.74",
"lon": "-104.98",
"ip_addr": "::1",
"visits": "1",
"tmp_token": "1bdffd2912435ad83a799883ff5005a6",
"email_token": null,
"phone_token": null,
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "0",
"accept_marketing_offers": "0",
"is_permanent": "0",
"reviewed": "1",
"featured": "1",
"archived": "0",
"archived_at": "2022-02-15T18:05:53.000000Z",
"deletion_mail_sent_at": null,
"fb_profile": null,
"partner": null,
"created_at": "2022-02-15T09:55:51.000000Z",
"updated_at": "2022-02-15T18:05:53.000000Z",
"slug": "do-you-have-something-to-sell",
"created_at_formatted": "Feb 15th, 2022 at 04:55",
"user_photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg"
}
]
},
"extra": {
"count": null,
"preSearch": [],
"fields": []
}
}
Received response:
Request failed with error:
Get post
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/posts/2?unactivated=1&noCache=&embed=user%2CpostType&detailed=" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/2"
);
let params = {
"unactivated": "1",
"noCache": "",
"embed": "user,postType",
"detailed": "",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/posts/2',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'unactivated'=> '1',
'noCache'=> '',
'embed'=> 'user,postType',
'detailed'=> '',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 2,
"country_code": "US",
"user_id": "1",
"category_id": "38",
"post_type_id": "2",
"title": "Urgent sell Container Home",
"description": "Quisquam soluta quidem qui porro sit eum. Expedita dolorem accusamus ut sed illo officiis sint. Deleniti dolores enim excepturi minima quis. Consequuntur non quo quo est neque non.\n\nExpedita cupiditate provident nostrum. Voluptatem tempora voluptatem quisquam molestiae. Est autem at laudantium sit. Culpa sit voluptates in rerum aut nulla. Rerum ut nulla distinctio totam ad eum esse eveniet.",
"tags": [
"et",
"dolores",
"voluptatibus"
],
"price": "99838.00",
"negotiable": "1",
"contact_name": "Administrator",
"email": "admin@larapen.com",
"phone": "+35861228281",
"phone_hidden": "0",
"address": null,
"city_id": "47008",
"lat": "41.41",
"lon": "-75.66",
"ip_addr": "61.162.28.200",
"visits": "9977",
"tmp_token": null,
"email_token": null,
"phone_token": "demoFaker",
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "1",
"accept_marketing_offers": "0",
"is_permanent": "0",
"reviewed": "1",
"featured": "1",
"archived": "0",
"archived_at": "2022-01-07T08:48:34.000000Z",
"deletion_mail_sent_at": null,
"fb_profile": null,
"partner": null,
"created_at": "2022-01-19T18:28:31.000000Z",
"updated_at": "2022-01-07T08:48:34.000000Z",
"slug": "urgent-sell-container-home",
"created_at_formatted": "Jan 19th, 2022 at 13:28",
"user_photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg",
"user": {
"id": 1,
"name": "Administrator",
"username": null,
"created_at_formatted": "Dec 25th, 2021 at 09:58",
"photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg",
"country_code": "US",
"language_code": "en",
"user_type_id": "2",
"gender_id": "1",
"photo": "avatars\/us\/1\/252f692a1ff1c9373286481c01d05c6b.jpg",
"about": "Administrator",
"phone": "+35861228281",
"phone_hidden": "0",
"email": "admin@larapen.com",
"can_be_impersonate": null,
"disable_comments": "1",
"ip_addr": "16.152.205.227",
"provider": null,
"provider_id": null,
"email_token": null,
"phone_token": null,
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "1",
"accept_marketing_offers": "0",
"time_zone": null,
"blocked": "0",
"closed": "0",
"last_activity": "2022-02-26T01:32:27.748218Z"
},
"postType": {
"id": 2,
"name": "Professional",
"active": "1"
}
}
}
Received response:
Request failed with error:
Store post
requires authentication
For both types of post's creation (Single step or Multi steps). Note: The field 'admin_code' is only available when the post's country's 'admin_type' column is set to 1 or 2 and the 'admin_field_active' column is set to 1.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/posts" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-F "category_id=1" \
-F "post_type_id=1" \
-F "title=John Doe" \
-F "description=Beatae placeat atque tempore consequatur animi magni omnis." \
-F "contact_name=John Doe" \
-F "email=john.doe@domain.tld" \
-F "phone=+17656766467" \
-F "city_id=9" \
-F "country_code=US" \
-F "admin_code=0" \
-F "price=5000" \
-F "negotiable=" \
-F "phone_hidden=" \
-F "ip_addr=saepe" \
-F "accept_marketing_offers=" \
-F "is_permanent=" \
-F "tags=car,automotive,tesla,cyber,truck" \
-F "accept_terms=" \
-F "package_id=2" \
-F "payment_method_id=5" \
-F "captcha_key=est" \
-F "pictures[]=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpqLWjLv"
const url = new URL(
"https://demo.laraclassifier.local/api/posts"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
const body = new FormData();
body.append('category_id', '1');
body.append('post_type_id', '1');
body.append('title', 'John Doe');
body.append('description', 'Beatae placeat atque tempore consequatur animi magni omnis.');
body.append('contact_name', 'John Doe');
body.append('email', 'john.doe@domain.tld');
body.append('phone', '+17656766467');
body.append('city_id', '9');
body.append('country_code', 'US');
body.append('admin_code', '0');
body.append('price', '5000');
body.append('negotiable', '');
body.append('phone_hidden', '');
body.append('ip_addr', 'saepe');
body.append('accept_marketing_offers', '');
body.append('is_permanent', '');
body.append('tags', 'car,automotive,tesla,cyber,truck');
body.append('accept_terms', '');
body.append('package_id', '2');
body.append('payment_method_id', '5');
body.append('captcha_key', 'est');
body.append('pictures[]', document.querySelector('input[name="pictures[]"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/posts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'multipart' => [
[
'name' => 'category_id',
'contents' => '1'
],
[
'name' => 'post_type_id',
'contents' => '1'
],
[
'name' => 'title',
'contents' => 'John Doe'
],
[
'name' => 'description',
'contents' => 'Beatae placeat atque tempore consequatur animi magni omnis.'
],
[
'name' => 'contact_name',
'contents' => 'John Doe'
],
[
'name' => 'email',
'contents' => 'john.doe@domain.tld'
],
[
'name' => 'phone',
'contents' => '+17656766467'
],
[
'name' => 'city_id',
'contents' => '9'
],
[
'name' => 'country_code',
'contents' => 'US'
],
[
'name' => 'admin_code',
'contents' => '0'
],
[
'name' => 'price',
'contents' => '5000'
],
[
'name' => 'negotiable',
'contents' => ''
],
[
'name' => 'phone_hidden',
'contents' => ''
],
[
'name' => 'ip_addr',
'contents' => 'saepe'
],
[
'name' => 'accept_marketing_offers',
'contents' => ''
],
[
'name' => 'is_permanent',
'contents' => ''
],
[
'name' => 'tags',
'contents' => 'car,automotive,tesla,cyber,truck'
],
[
'name' => 'accept_terms',
'contents' => ''
],
[
'name' => 'package_id',
'contents' => '2'
],
[
'name' => 'payment_method_id',
'contents' => '5'
],
[
'name' => 'captcha_key',
'contents' => 'est'
],
[
'name' => 'pictures[]',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpqLWjLv', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": "Your listing has been created.",
"result": {
"id": 9800,
"country_code": "US",
"user_id": 3,
"category_id": 1,
"post_type_id": 1,
"title": "John Doe",
"description": "<p>Beatae placeat atque tempore consequatur animi magni omnis.<\/p>",
"tags": [
"car",
"automotive",
"tesla",
"cyber",
"truck"
],
"price": "5000",
"negotiable": false,
"contact_name": "John Doe",
"email": "john.doe@domain.tld",
"phone": "+17656766467",
"phone_hidden": false,
"address": null,
"city_id": 9,
"lat": "25.79",
"lon": "55.94",
"ip_addr": "saepe",
"visits": null,
"tmp_token": "88ea06a1d49385ffbd8980f2d6052f90",
"email_token": "a792bad20f44c0c764262ae740466172",
"phone_token": null,
"verified_email": 0,
"verified_phone": 1,
"accept_terms": false,
"accept_marketing_offers": false,
"is_permanent": false,
"reviewed": 0,
"featured": null,
"archived": null,
"archived_at": "2022-02-26T01:32:28.000000Z",
"deletion_mail_sent_at": null,
"fb_profile": null,
"partner": null,
"created_at": "2022-02-26T01:32:28.000000Z",
"updated_at": "2022-02-26T01:32:28.000000Z",
"slug": "john-doe",
"created_at_formatted": "Feb 26th, 2022 at 02:32",
"user_photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg"
},
"extra": {
"payment": {
"success": false,
"message": "We have not received your payment. An error occurred.",
"result": null
},
"previousUrl": "http:\/\/demo.laraclassifier.local\/posts\/create\/payment?error=paymentMethodNotFound",
"nextUrl": "http:\/\/demo.laraclassifier.local\/posts\/create\/finish",
"paymentCancelUrl": "http:\/\/demo.laraclassifier.local\/posts\/create\/payment\/cancel",
"paymentReturnUrl": "http:\/\/demo.laraclassifier.local\/posts\/create\/payment\/success"
}
}
Received response:
Request failed with error:
Update post
requires authentication
Note: The fields 'pictures', 'package_id' and 'payment_method_id' are only available with the single step post edition. The field 'admin_code' is only available when the post's country's 'admin_type' column is set to 1 or 2 and the 'admin_field_active' column is set to 1.
Example request:
curl -X PUT \
"https://demo.laraclassifier.local/api/posts/veritatis" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-F "category_id=1" \
-F "post_type_id=1" \
-F "title=John Doe" \
-F "description=Beatae placeat atque tempore consequatur animi magni omnis." \
-F "contact_name=John Doe" \
-F "email=john.doe@domain.tld" \
-F "phone=+17656766467" \
-F "city_id=6" \
-F "country_code=US" \
-F "admin_code=0" \
-F "price=5000" \
-F "negotiable=" \
-F "phone_hidden=" \
-F "ip_addr=et" \
-F "accept_marketing_offers=" \
-F "is_permanent=" \
-F "tags=car,automotive,tesla,cyber,truck" \
-F "accept_terms=" \
-F "package_id=2" \
-F "payment_method_id=5" \
-F "pictures[]=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpAIPJqj"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/veritatis"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
const body = new FormData();
body.append('category_id', '1');
body.append('post_type_id', '1');
body.append('title', 'John Doe');
body.append('description', 'Beatae placeat atque tempore consequatur animi magni omnis.');
body.append('contact_name', 'John Doe');
body.append('email', 'john.doe@domain.tld');
body.append('phone', '+17656766467');
body.append('city_id', '6');
body.append('country_code', 'US');
body.append('admin_code', '0');
body.append('price', '5000');
body.append('negotiable', '');
body.append('phone_hidden', '');
body.append('ip_addr', 'et');
body.append('accept_marketing_offers', '');
body.append('is_permanent', '');
body.append('tags', 'car,automotive,tesla,cyber,truck');
body.append('accept_terms', '');
body.append('package_id', '2');
body.append('payment_method_id', '5');
body.append('pictures[]', document.querySelector('input[name="pictures[]"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://demo.laraclassifier.local/api/posts/veritatis',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'multipart' => [
[
'name' => 'category_id',
'contents' => '1'
],
[
'name' => 'post_type_id',
'contents' => '1'
],
[
'name' => 'title',
'contents' => 'John Doe'
],
[
'name' => 'description',
'contents' => 'Beatae placeat atque tempore consequatur animi magni omnis.'
],
[
'name' => 'contact_name',
'contents' => 'John Doe'
],
[
'name' => 'email',
'contents' => 'john.doe@domain.tld'
],
[
'name' => 'phone',
'contents' => '+17656766467'
],
[
'name' => 'city_id',
'contents' => '6'
],
[
'name' => 'country_code',
'contents' => 'US'
],
[
'name' => 'admin_code',
'contents' => '0'
],
[
'name' => 'price',
'contents' => '5000'
],
[
'name' => 'negotiable',
'contents' => ''
],
[
'name' => 'phone_hidden',
'contents' => ''
],
[
'name' => 'ip_addr',
'contents' => 'et'
],
[
'name' => 'accept_marketing_offers',
'contents' => ''
],
[
'name' => 'is_permanent',
'contents' => ''
],
[
'name' => 'tags',
'contents' => 'car,automotive,tesla,cyber,truck'
],
[
'name' => 'accept_terms',
'contents' => ''
],
[
'name' => 'package_id',
'contents' => '2'
],
[
'name' => 'payment_method_id',
'contents' => '5'
],
[
'name' => 'pictures[]',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpAIPJqj', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Delete post(s)
requires authentication
Example request:
curl -X DELETE \
"https://demo.laraclassifier.local/api/posts/expedita" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/expedita"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://demo.laraclassifier.local/api/posts/expedita',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Email: Re-send link
Re-send email verification link to the user
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/posts/vero/verify/resend/email?entitySlug=users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/vero/verify/resend/email"
);
let params = {
"entitySlug": "users",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/posts/vero/verify/resend/email',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'entitySlug'=> 'users',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
SMS: Re-send code
Re-send mobile phone verification token by SMS
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/posts/fuga/verify/resend/sms?entitySlug=users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/fuga/verify/resend/sms"
);
let params = {
"entitySlug": "users",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/posts/fuga/verify/resend/sms',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'entitySlug'=> 'users',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Verification
Verify the user's email address or mobile phone number
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/posts/verify/iusto/illum?entitySlug=users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/posts/verify/iusto/illum"
);
let params = {
"entitySlug": "users",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/posts/verify/iusto/illum',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'entitySlug'=> 'users',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Saved Posts
Store/Delete saved listing
requires authentication
Save a post/listing in favorite, or remove it from favorite.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/savedPosts" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"post_id":2}'
const url = new URL(
"https://demo.laraclassifier.local/api/savedPosts"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"post_id": 2
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/savedPosts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'post_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": "Listing saved in favorites successfully!",
"result": {
"id": 4026,
"user_id": 3,
"post_id": 2
}
}
Received response:
Request failed with error:
List saved listings
requires authentication
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/savedPosts?country_code=US&sort=created_at&perPage=2" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/savedPosts"
);
let params = {
"country_code": "US",
"sort": "created_at",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/savedPosts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'country_code'=> 'US',
'sort'=> 'created_at',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [],
"links": {
"first": "http:\/\/localhost\/api\/savedPosts?page=1",
"last": "http:\/\/localhost\/api\/savedPosts?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/savedPosts?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/savedPosts",
"per_page": 2,
"to": null,
"total": 0
}
}
}
Received response:
Request failed with error:
Delete saved listing(s)
requires authentication
Example request:
curl -X DELETE \
"https://demo.laraclassifier.local/api/savedPosts/assumenda" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/savedPosts/assumenda"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://demo.laraclassifier.local/api/savedPosts/assumenda',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Saved Searches
Store/Delete saved search
requires authentication
Save a search result in favorite, or remove it from favorite.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/savedSearches" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-d '{"url":"https:\/\/demo.laraclassifier.com\/search\/?q=test&l=","count_posts":29}'
const url = new URL(
"https://demo.laraclassifier.local/api/savedSearches"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
let body = {
"url": "https:\/\/demo.laraclassifier.com\/search\/?q=test&l=",
"count_posts": 29
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/savedSearches',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'json' => [
'url' => 'https://demo.laraclassifier.com/search/?q=test&l=',
'count_posts' => 29,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": "Search saved successfully !",
"result": {
"id": 4027,
"country_code": "US",
"user_id": 3,
"keyword": "test",
"query": "q=test&l=",
"count": 29
}
}
Received response:
Request failed with error:
List saved searches
requires authentication
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/savedSearches?sort=created_at&perPage=2" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/savedSearches"
);
let params = {
"sort": "created_at",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/savedSearches',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'sort'=> 'created_at',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"savedSearches": {
"data": [
{
"id": 3771,
"country_code": "US",
"user_id": "3",
"keyword": "velit",
"query": "q=velit",
"count": "0"
},
{
"id": 3779,
"country_code": "US",
"user_id": "3",
"keyword": "sequi",
"query": "q=sequi",
"count": "0"
}
]
},
"searchData": []
}
}
Received response:
Request failed with error:
Delete saved search(es)
requires authentication
Example request:
curl -X DELETE \
"https://demo.laraclassifier.local/api/savedSearches/amet" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/savedSearches/amet"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://demo.laraclassifier.local/api/savedSearches/amet',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Settings
List settings
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/settings" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/settings"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/settings',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Get setting
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/settings/app" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/settings/app"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/settings/app',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (429):
{
"success": false,
"message": "Too Many Requests, Please Slow Down",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Social Auth
Get target URL
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/auth/placeat" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/auth/placeat"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/auth/placeat',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Get user info
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/auth/qui/callback" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/auth/qui/callback"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/auth/qui/callback',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Threads
Store thread
Start a conversation. Creation of a new thread.
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/threads" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-F "from_name=John Doe" \
-F "from_email=john.doe@domain.tld" \
-F "from_phone=ullam" \
-F "body=Modi temporibus voluptas expedita voluptatibus voluptas veniam." \
-F "post_id=2" \
-F "captcha_key=qui" \
-F "filename=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpnUaLZd"
const url = new URL(
"https://demo.laraclassifier.local/api/threads"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
};
const body = new FormData();
body.append('from_name', 'John Doe');
body.append('from_email', 'john.doe@domain.tld');
body.append('from_phone', 'ullam');
body.append('body', 'Modi temporibus voluptas expedita voluptatibus voluptas veniam.');
body.append('post_id', '2');
body.append('captcha_key', 'qui');
body.append('filename', document.querySelector('input[name="filename"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/threads',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
],
'multipart' => [
[
'name' => 'from_name',
'contents' => 'John Doe'
],
[
'name' => 'from_email',
'contents' => 'john.doe@domain.tld'
],
[
'name' => 'from_phone',
'contents' => 'ullam'
],
[
'name' => 'body',
'contents' => 'Modi temporibus voluptas expedita voluptatibus voluptas veniam.'
],
[
'name' => 'post_id',
'contents' => '2'
],
[
'name' => 'captcha_key',
'contents' => 'qui'
],
[
'name' => 'filename',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpnUaLZd', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"success": true,
"message": "Your message has sent successfully to Administrator.",
"result": {
"id": 340,
"post_id": 2,
"subject": "Urgent sell Container Home"
},
"extra": {
"post": {
"id": 2,
"country_code": "US",
"user_id": "1",
"category_id": "38",
"post_type_id": "2",
"title": "Urgent sell Container Home",
"description": "Quisquam soluta quidem qui porro sit eum. Expedita dolorem accusamus ut sed illo officiis sint. Deleniti dolores enim excepturi minima quis. Consequuntur non quo quo est neque non.\n\nExpedita cupiditate provident nostrum. Voluptatem tempora voluptatem quisquam molestiae. Est autem at laudantium sit. Culpa sit voluptates in rerum aut nulla. Rerum ut nulla distinctio totam ad eum esse eveniet.",
"tags": [
"et",
"dolores",
"voluptatibus"
],
"price": "99838.00",
"negotiable": "1",
"contact_name": "Administrator",
"email": "admin@larapen.com",
"phone": "+35861228281",
"phone_hidden": "0",
"address": null,
"city_id": "47008",
"lat": "41.41",
"lon": "-75.66",
"ip_addr": "61.162.28.200",
"visits": "9977",
"tmp_token": null,
"email_token": null,
"phone_token": "demoFaker",
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "1",
"accept_marketing_offers": "0",
"is_permanent": "0",
"reviewed": "1",
"featured": "1",
"archived": "0",
"archived_at": "2022-01-07T08:48:34.000000Z",
"deletion_mail_sent_at": null,
"fb_profile": null,
"partner": null,
"created_at": "2022-01-19T18:28:31.000000Z",
"updated_at": "2022-01-07T08:48:34.000000Z",
"slug": "urgent-sell-container-home",
"created_at_formatted": "Jan 19th, 2022 at 13:28",
"user_photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg"
}
}
}
Received response:
Request failed with error:
List threads
requires authentication
Get all logged user's threads. Filters:
- unread: Get the logged user's unread threads
- started: Get the logged user's started threads
- important: Get the logged user's make as important threads
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/threads?filter=unread&embed=null&perPage=2" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/threads"
);
let params = {
"filter": "unread",
"embed": "null",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/threads',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'filter'=> 'unread',
'embed'=> 'null',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 8,
"post_id": "102",
"subject": "Ford Focus for sale"
},
{
"id": 11,
"post_id": "81",
"subject": "Logitech H390"
}
],
"links": {
"first": "http:\/\/localhost\/api\/threads?page=1",
"last": "http:\/\/localhost\/api\/threads?page=18",
"prev": null,
"next": "http:\/\/localhost\/api\/threads?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 18,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/threads?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=7",
"label": "7",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=8",
"label": "8",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=9",
"label": "9",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=17",
"label": "17",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=18",
"label": "18",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/threads",
"per_page": 2,
"to": 2,
"total": 35
}
}
}
Received response:
Request failed with error:
Get thread
requires authentication
Get a thread (owned by the logged user) details
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/threads/8?embed=null" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/threads/8"
);
let params = {
"embed": "null",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/threads/8',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 8,
"post_id": "102",
"subject": "Ford Focus for sale"
}
}
Received response:
Request failed with error:
Update thread
requires authentication
Example request:
curl -X PUT \
"https://demo.laraclassifier.local/api/threads/sequi" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-F "body=Modi temporibus voluptas expedita voluptatibus voluptas veniam." \
-F "filename=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phptQO4OO"
const url = new URL(
"https://demo.laraclassifier.local/api/threads/sequi"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
const body = new FormData();
body.append('body', 'Modi temporibus voluptas expedita voluptatibus voluptas veniam.');
body.append('filename', document.querySelector('input[name="filename"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://demo.laraclassifier.local/api/threads/sequi',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'multipart' => [
[
'name' => 'body',
'contents' => 'Modi temporibus voluptas expedita voluptatibus voluptas veniam.'
],
[
'name' => 'filename',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phptQO4OO', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Delete thread(s)
requires authentication
Example request:
curl -X DELETE \
"https://demo.laraclassifier.local/api/threads/ut" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/threads/ut"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://demo.laraclassifier.local/api/threads/ut',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Bulk updates
requires authentication
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/threads/bulkUpdate/ut?type=ut" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/threads/bulkUpdate/ut"
);
let params = {
"type": "ut",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/threads/bulkUpdate/ut',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'type'=> 'ut',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
List messages
requires authentication
Get all thread's messages
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/threads/293/messages?embed=null&sort=created_at&perPage=2" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/threads/293/messages"
);
let params = {
"embed": "null",
"sort": "created_at",
"perPage": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/threads/293/messages',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
'sort'=> 'created_at',
'perPage'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"data": [
{
"id": 3287,
"thread_id": "293",
"user_id": "2562",
"body": "Omnis veniam qui enim quis ut ut qui dignissimos. Labore est aliquam velit perspiciatis architecto ipsa. Molestiae quia sit ipsam deserunt quas quia aliquam. Quia debitis adipisci distinctio.",
"filename": null
},
{
"id": 3288,
"thread_id": "293",
"user_id": "3",
"body": "Rem reiciendis praesentium ullam qui velit illo. Quaerat cum fugit qui et. Nihil velit et et rerum molestias unde.",
"filename": null
}
],
"links": {
"first": "http:\/\/localhost\/api\/threads\/293\/messages?page=1",
"last": "http:\/\/localhost\/api\/threads\/293\/messages?page=11",
"prev": null,
"next": "http:\/\/localhost\/api\/threads\/293\/messages?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 11,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=1",
"label": "1",
"active": true
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=2",
"label": "2",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=3",
"label": "3",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=4",
"label": "4",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=5",
"label": "5",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=6",
"label": "6",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=7",
"label": "7",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=8",
"label": "8",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=9",
"label": "9",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=10",
"label": "10",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=11",
"label": "11",
"active": false
},
{
"url": "http:\/\/localhost\/api\/threads\/293\/messages?page=2",
"label": "Next »",
"active": false
}
],
"path": "http:\/\/localhost\/api\/threads\/293\/messages",
"per_page": 2,
"to": 2,
"total": 21
}
}
}
Received response:
Request failed with error:
Get message
requires authentication
Get a thread's message (owned by the logged user) details
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/threads/293/messages/3545?embed=null" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/threads/293/messages/3545"
);
let params = {
"embed": "null",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/threads/293/messages/3545',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'embed'=> 'null',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "The thread message with ID: 3545 was not found.",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Users
List users
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/users"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/users',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (401):
{
"success": false,
"message": "Unauthorized",
"result": null,
"error_code": 1
}
Received response:
Request failed with error:
Get user
requires authentication
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/users/3" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/users/3"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/users/3',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": null,
"result": {
"id": 3,
"name": "User Demo",
"username": null,
"created_at_formatted": "Dec 25th, 2021 at 23:58",
"photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg",
"country_code": "US",
"language_code": "en",
"user_type_id": "2",
"gender_id": "1",
"photo": "avatars\/us\/3\/e69f9a84a9246120ced00e6e1196abc7.jpg",
"about": "User Demo",
"phone": "+1980877677",
"phone_hidden": "0",
"email": "user@demosite.com",
"can_be_impersonate": null,
"disable_comments": "1",
"ip_addr": "32.130.184.40",
"provider": null,
"provider_id": null,
"email_token": null,
"phone_token": null,
"verified_email": "1",
"verified_phone": "1",
"accept_terms": "1",
"accept_marketing_offers": "0",
"time_zone": null,
"blocked": "0",
"closed": "0",
"last_activity": "2022-02-26T01:32:25.467998Z"
}
}
Received response:
Request failed with error:
Store user
Example request:
curl -X POST \
"https://demo.laraclassifier.local/api/users" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-F "country_code=US" \
-F "language_code=en" \
-F "user_type_id=1" \
-F "gender_id=1" \
-F "name=John Doe" \
-F "phone=+17656766467" \
-F "phone_hidden=" \
-F "email=john.doe@domain.tld" \
-F "username=john_doe" \
-F "password=js!X07$z61hLA" \
-F "password_confirmation=js!X07$z61hLA" \
-F "disable_comments=1" \
-F "ip_addr=ipsum" \
-F "accept_terms=1" \
-F "accept_marketing_offers=" \
-F "time_zone=America/New_York" \
-F "captcha_key=omnis" \
-F "photo=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpqBrOIC"
const url = new URL(
"https://demo.laraclassifier.local/api/users"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
const body = new FormData();
body.append('country_code', 'US');
body.append('language_code', 'en');
body.append('user_type_id', '1');
body.append('gender_id', '1');
body.append('name', 'John Doe');
body.append('phone', '+17656766467');
body.append('phone_hidden', '');
body.append('email', 'john.doe@domain.tld');
body.append('username', 'john_doe');
body.append('password', 'js!X07$z61hLA');
body.append('password_confirmation', 'js!X07$z61hLA');
body.append('disable_comments', '1');
body.append('ip_addr', 'ipsum');
body.append('accept_terms', '1');
body.append('accept_marketing_offers', '');
body.append('time_zone', 'America/New_York');
body.append('captcha_key', 'omnis');
body.append('photo', document.querySelector('input[name="photo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://demo.laraclassifier.local/api/users',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'multipart' => [
[
'name' => 'country_code',
'contents' => 'US'
],
[
'name' => 'language_code',
'contents' => 'en'
],
[
'name' => 'user_type_id',
'contents' => '1'
],
[
'name' => 'gender_id',
'contents' => '1'
],
[
'name' => 'name',
'contents' => 'John Doe'
],
[
'name' => 'phone',
'contents' => '+17656766467'
],
[
'name' => 'phone_hidden',
'contents' => ''
],
[
'name' => 'email',
'contents' => 'john.doe@domain.tld'
],
[
'name' => 'username',
'contents' => 'john_doe'
],
[
'name' => 'password',
'contents' => 'js!X07$z61hLA'
],
[
'name' => 'password_confirmation',
'contents' => 'js!X07$z61hLA'
],
[
'name' => 'disable_comments',
'contents' => '1'
],
[
'name' => 'ip_addr',
'contents' => 'ipsum'
],
[
'name' => 'accept_terms',
'contents' => '1'
],
[
'name' => 'accept_marketing_offers',
'contents' => ''
],
[
'name' => 'time_zone',
'contents' => 'America/New_York'
],
[
'name' => 'captcha_key',
'contents' => 'omnis'
],
[
'name' => 'photo',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpqBrOIC', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true,
"message": "Your account has been created.",
"result": {
"id": 3329,
"name": "John Doe",
"username": "john_doe",
"created_at_formatted": "Feb 25th, 2022 at 20:32",
"photo_url": "http:\/\/demo.laraclassifier.local\/images\/user.jpg",
"country_code": "US",
"language_code": "en",
"user_type_id": 1,
"gender_id": 1,
"photo": null,
"about": null,
"phone": "+17656766467",
"phone_hidden": false,
"email": "john.doe@domain.tld",
"can_be_impersonate": null,
"disable_comments": true,
"ip_addr": "ipsum",
"provider": null,
"provider_id": null,
"email_token": "b46529a40c8799fe72eb69784e7122d3",
"phone_token": null,
"verified_email": 0,
"verified_phone": 1,
"accept_terms": true,
"accept_marketing_offers": false,
"time_zone": "America\/New_York",
"blocked": null,
"closed": null,
"last_activity": "2022-02-26T01:32:26.368973Z"
},
"extra": {
"sendEmailVerification": {
"success": true,
"emailVerificationSent": true,
"message": "An activation link has been sent to you to verify your email address."
}
}
}
Received response:
Request failed with error:
Update user
requires authentication
Example request:
curl -X PUT \
"https://demo.laraclassifier.local/api/users/officiis" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs" \
-F "country_code=US" \
-F "language_code=en" \
-F "user_type_id=1" \
-F "gender_id=1" \
-F "name=John Doe" \
-F "phone=+17656766467" \
-F "phone_hidden=" \
-F "email=john.doe@domain.tld" \
-F "username=john_doe" \
-F "password=js!X07$z61hLA" \
-F "password_confirmation=js!X07$z61hLA" \
-F "disable_comments=1" \
-F "ip_addr=ipsam" \
-F "accept_terms=1" \
-F "accept_marketing_offers=" \
-F "time_zone=America/New_York" \
-F "photo=@/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpOx5hX5"
const url = new URL(
"https://demo.laraclassifier.local/api/users/officiis"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
const body = new FormData();
body.append('country_code', 'US');
body.append('language_code', 'en');
body.append('user_type_id', '1');
body.append('gender_id', '1');
body.append('name', 'John Doe');
body.append('phone', '+17656766467');
body.append('phone_hidden', '');
body.append('email', 'john.doe@domain.tld');
body.append('username', 'john_doe');
body.append('password', 'js!X07$z61hLA');
body.append('password_confirmation', 'js!X07$z61hLA');
body.append('disable_comments', '1');
body.append('ip_addr', 'ipsam');
body.append('accept_terms', '1');
body.append('accept_marketing_offers', '');
body.append('time_zone', 'America/New_York');
body.append('photo', document.querySelector('input[name="photo"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://demo.laraclassifier.local/api/users/officiis',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'multipart' => [
[
'name' => 'country_code',
'contents' => 'US'
],
[
'name' => 'language_code',
'contents' => 'en'
],
[
'name' => 'user_type_id',
'contents' => '1'
],
[
'name' => 'gender_id',
'contents' => '1'
],
[
'name' => 'name',
'contents' => 'John Doe'
],
[
'name' => 'phone',
'contents' => '+17656766467'
],
[
'name' => 'phone_hidden',
'contents' => ''
],
[
'name' => 'email',
'contents' => 'john.doe@domain.tld'
],
[
'name' => 'username',
'contents' => 'john_doe'
],
[
'name' => 'password',
'contents' => 'js!X07$z61hLA'
],
[
'name' => 'password_confirmation',
'contents' => 'js!X07$z61hLA'
],
[
'name' => 'disable_comments',
'contents' => '1'
],
[
'name' => 'ip_addr',
'contents' => 'ipsam'
],
[
'name' => 'accept_terms',
'contents' => '1'
],
[
'name' => 'accept_marketing_offers',
'contents' => ''
],
[
'name' => 'time_zone',
'contents' => 'America/New_York'
],
[
'name' => 'photo',
'contents' => fopen('/private/var/folders/r0/k0xbnx757k3fnz09_6g9rp6w0000gn/T/phpOx5hX5', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Delete user
requires authentication
Example request:
curl -X DELETE \
"https://demo.laraclassifier.local/api/users/cupiditate" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/users/cupiditate"
);
let headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://demo.laraclassifier.local/api/users/cupiditate',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Email: Re-send link
Re-send email verification link to the user
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/users/voluptas/verify/resend/email?entitySlug=users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/users/voluptas/verify/resend/email"
);
let params = {
"entitySlug": "users",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/users/voluptas/verify/resend/email',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'entitySlug'=> 'users',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
SMS: Re-send code
Re-send mobile phone verification token by SMS
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/users/voluptatem/verify/resend/sms?entitySlug=users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/users/voluptatem/verify/resend/sms"
);
let params = {
"entitySlug": "users",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/users/voluptatem/verify/resend/sms',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'entitySlug'=> 'users',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error:
Verification
Verify the user's email address or mobile phone number
Example request:
curl -X GET \
-G "https://demo.laraclassifier.local/api/users/verify/ex/ipsa?entitySlug=users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Language: en" \
-H "X-AppApiToken: Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=" \
-H "X-AppType: docs"
const url = new URL(
"https://demo.laraclassifier.local/api/users/verify/ex/ipsa"
);
let params = {
"entitySlug": "users",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Content-Language": "en",
"X-AppApiToken": "Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=",
"X-AppType": "docs",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://demo.laraclassifier.local/api/users/verify/ex/ipsa',
[
'headers' => [
'Accept' => 'application/json',
'Content-Language' => 'en',
'X-AppApiToken' => 'Uk1DSFlVUVhIRXpHbWt6d2pIZjlPTG15akRPN2tJTUs=',
'X-AppType' => 'docs',
],
'query' => [
'entitySlug'=> 'users',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (404):
{
"success": false,
"message": "Page Not Found."
}
Received response:
Request failed with error: